-
-
Notifications
You must be signed in to change notification settings - Fork 645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve prompts for reusing dead REPLs #3354
Conversation
Fixes clojure-emacs#3353 Partially reverts 4004862
Another suggestion - should answering "no" to the prompt kill the dead REPL buffer instead of keeping it around? Maybe another prompt "Kill dead REPL buffer(s)? (y or n)" after they reply no to the first prompt, to make it more explicit? |
That'd be fine by me. We didn't kill it initially, as the assumption was that there might be some useful info in the dead buffer that people might want to keep around. Probably that's rarely the case. |
I'll merge your PR in its current state, as it fixes the regression that I had introduced, and we can keep doing/discussing improvements to the reuse functionality separately. Thanks for tackling this! |
Thanks! I just spotted a small inconsistency / bug with the new defcustom docstring and I was also going to submit another PR for the |
@yuhan0 Yeah, you can include the killing logic in your follow-up PR. |
Would you prefer the double prompt (reuse? y/n) -n-> (kill? y/n) or a single 3-choice prompt? |
I've also found that in very rare cases the call to (One of my ad-hoc convenience commands used |
:group 'cider | ||
:safe #'symbolp | ||
:package-version '(cider . "1.5")) | ||
|
||
(defcustom cider-reuse-dead-repls 'prompt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, it's so good to have that discussion in the archives :)
Alright then. Perhaps we can change...?
-A dead REPL %s exists. Reuse buffer?
+A dead REPL %s exists. Reuse buffer? (see also: `cider-reuse-dead-repls' defcustom)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems a bit too much to mention the defcustom, as we never do this normally. And it this change probably doesn't affect people much anyways.
Fixes the regression mentioned in #3353, which caused dead clj REPL buffers to not prompt for reuse.
Also changes the wording of the prompt as suggested in #3076, and implements a defcustom, allowing the user to always / never reuse dead repls. Defaults to the current behaviour of always prompting.
I also added my preferred
auto
behaviour which skips the prompt when there's a single unambiguousy/n
choice.Fixes #3353
Closes #3076
Before submitting the PR make sure the following things have been done (and denote this
by checking the relevant checkboxes):
eldev test
)eldev lint
) which is based onelisp-lint
and includescheckdoc
, check-declare, packaging metadata, indentation, and trailing whitespace checks.