Subject: Re: bug#51993: 29.0.50; [PATCH] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files

From: Eli Zaretskii <[email-masked]>
Date: Sat, 22 Oct 2022 09:57:05 +0300

> Date: Fri, 21 Oct 2022 20:46:47 -0700
> Cc: [email-masked], [email-masked], [email-masked]
> From: Jim Porter <[email-masked]>
> 
> >>>    $ emacs -Q --daemon
> >>>    $ emacsclient -a "" -c foo.txt
> >>>    $ emacsclient -a "" -c bar.txt
> >>>
> >>>    ;; In the first client frame:
> >>>    foobar ;; Insert some text
> >>>    C-x C-c
> >>>    ;; Emacs prompts "Save file /path/to/foo.txt?..."
> >>>
> >>> Now try the above, but call `(server-stop-automatically 'delete-frame)' first (or replace `delete-frame' with `kill-terminal'; it doesn't matter). In this case, Emacs doesn't prompt to save the file.
> > 
> > I'm not sure I see the direct relevance, and I don't think I see a bug
> > in the above behavior.  I'm probably missing something, but what?
> 
> The issue in the quote above is that if you enable automatic server 
> shutdown in Emacs 29, it changes the behavior of exiting an emacsclient 
> even when it wouldn't stop the server (i.e. when there are other active 
> clients). That's surprising to me, I wouldn't expect that setting to 
> affect cases when it decides *not* to kill the Emacs daemon.

Sounds like a bug to me, because it contradicts what the doc string
says.