Subject: Re: bug#55599: save-buffers-kill-emacs doesn't give a visible prompt when called from command line

From: Michael Albinus <[email-masked]>
Date: Tue, 24 May 2022 09:34:57 +0200

Peter Ludemann <[email-masked]> writes:

Hi Peter,

> When I try to kill an emacs server from the command line by:
>    emacsclient -e '(save-buffers-kill-emacs)'
> nothing appears to happen if there are any unsaved buffers.
>
> I presume that this is because the prompt goes to the usual place (below
> the mode line in the screen), which of course isn't visible from the
> command line because there isn't any screen when using "emacsclient -e".
>
> This is a follow-up to bug 55560, where it was suggested that kill-emacs is
> inappropriate and instead I should use save-buffers-kill-emacs.

There is an optional ARG which lets Emacs silently save all file-visiting
buffers without asking. So you must call

  emacsclient -e '(save-buffers-kill-emacs t)'

Best regards, Michael.