Change the semantics of `cider-quit` and `cider-restart`. #732

Closed
vspinu opened this Issue Aug 14, 2014 · 3 comments

Projects

None yet

2 participants

@vspinu
Contributor
vspinu commented Aug 14, 2014

cider-quit closes all cider sessions by default and it easy to close all projects at once by mistake. I think it should work the other way around: by default close only the current session, and with C-u prefix close all CIDER sessions. y-or-n query should not be necessary in either case.

I think this is what C-c C-q does everywhere else in emacs. So it's a pretty standard behavior.

cider-restart quits all sessions but restarts only the current session. This is clearly a bug but it is suggestive that behavior should be similar to cider-quit: by default restart the current session, with C-u restart all session.

@bbatsov
Member
bbatsov commented Aug 15, 2014

I'm well aware of this, but as helper buffers and repl buffers are not associated with a connection directly presently we cannot determine exactly which buffers to kill alongside the current connection buffer.
This is related to our discussion in #700.

@bbatsov bbatsov added the enhancement label Nov 15, 2014
@bbatsov
Member
bbatsov commented Dec 7, 2014

#912 reminded me of this. Now that the REPL buffer is also the connection buffer this is definitely doable.

@vspinu
Contributor
vspinu commented Dec 7, 2014

BTW, I think the expression connection buffer is misleading. It seems to me that nrepl-server process and buffer should be part of the connection1 concept as well. cider-restart/quit operates on connection as a whole, not only on client-buffer/process.

The code and documentation would become clearer if we can use client-buffer/process (=client-connection), server-buffer/process (=server-connection) and connection (client + server) trichotomy throughout. Actually, we are already using this convention in several places in nrepl-cleint.el.

The complication, of course, is that server-connection is not always there on emacs side. Thus functions that operate on the whole connection should have a warning that they operate on the client side only if server side is absent.

@bbatsov bbatsov added a commit that closed this issue Jul 4, 2015
@bbatsov bbatsov [Fix #732] Change the semantics of cider-quit and cider-restart
By default now they operate only on the currently active connection.
With a prefix argument they operate on all connections.
534e621
@bbatsov bbatsov closed this in 534e621 Jul 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment