On 10/31/2022 5:44 AM, Eli Zaretskii wrote: >> Date: Sun, 30 Oct 2022 15:29:30 -0700 >> From: Jim Porter >> >> However, if you use 'C-x 5 0' instead, that terminates the Emacs client, >> but *doesn't* prompt to save foo.txt. I think it should prompt in this >> case too: all three of 'C-x #', 'C-x C-c', and 'C-x 5 0' have the effect >> (in this simple case) of deleting the Emacs client and returning to the >> calling process. (A user who wanted to bail out of an Emacs client >> without saving should use 'sever-edit-abort' instead.) > > I'm uneasy with this incompatible behavior change. I can think of > some legitimate use cases where "C-x 5 0" should not prompt, e.g., if > the user intends to keep editing the file, and no application is > waiting for the client to finish. Why break such flows? After thinking about this some more, I realized that I didn't properly address this part of your message. If no application is waiting for the client to finish, then the user hopefully used "--no-wait" when starting emacsclient. We could avoid prompting in that case.[1] If an application *is* waiting for the client to finish, then "--no-wait" would be unset. In that case, prompting the user has some value. See the attached patch. (I changed the code to only prompt when deleting the last frame of a *non-nowait* client.) [1] Currently, 'C-x C-c' from a nowait frame prompts via 'save-some-buffers' (so long as there's another frame; see 'server-save-buffers-kill-terminal'). Maybe we could avoid prompting then too? After prompting, it just calls 'delete-frame', so it's very similar to 'C-x 5 0' in this scenario... Still, as you say, it's probably good to be careful about making incompatible changes here.