|
From: | Jim Porter |
Subject: | bug#58404: 29.0.50; [PATCH] When killing Emacs from the last client, don't warn about the session having clients |
Date: | Mon, 10 Oct 2022 09:43:55 -0700 |
On 10/10/2022 1:53 AM, Eli Zaretskii wrote:
It is okay not to prompt when there's no need. That wasn't the part on which I commented, AFAIU. You said:On the other hand, I think it *would* be useful to prompt if you're in the last client, but there are other non-client frames.I'm saying that no, it will not be useful to prompt in that case: if the only frames left are non-client frames, we should not prompt, because we don't prompt when there are no client frames to begin with. Apologies if I misunderstood the use case.
Ah, I see. In that part of my original message, I wanted to say that this was a case where I thought the old code made sense, since it prompts the user then. However, I also thought that the prompt message could be more informative.
Here's why I think prompting then makes sense: when you're in an emacsclient frame and there are other non-client frames (i.e. ones "owned" by the main Emacs process), that looks very similar to the user as when you have a second emacsclient running. In other words, I think it would be good for this function to prompt when doing this:
$ emacs -Q --daemon $ emacsclient foo.txt $ emacsclient -c bar.txt ;; From either frame: M-x save-buffers-kill-emacs Or this: $ emacs -Q --daemon $ emacsclient foo.txt $ emacsclient --no-wait -c bar.txt ;; From either frame: M-x save-buffers-kill-emacs Or this: $ emacs foo.txt M-x server-start $ emacsclient -c bar.txt ;; From either frame: M-x save-buffers-kill-emacsIn all of those cases, the user would have 2 (visible) frames, possibly on different displays/terminals. Since they're visually similar, I think it makes sense to have similar prompts.
Next, if the user ran 'save-buffers-kill-emacs' a second time in any of those examples, it *wouldn't* prompt, since then all the remaining frames are associated with a single emacsclient (or no client at all).
Since the use case for this is non-obvious (it actually took me several iterations to identify all the possible cases), I updated my patch with clearer (to me) code, plus comments explaining the reasoning.
0001-Don-t-prompt-when-killing-an-Emacs-client-if-it-s-th.patch
Description: Text document
[Prev in Thread] | Current Thread | [Next in Thread] |