unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Peter Ludemann <peter.ludemann@gmail.com>
Cc: michael.albinus@gmx.de, 55599@debbugs.gnu.org
Subject: bug#55599: save-buffers-kill-emacs doesn't give a visible prompt when called from command line
Date: Tue, 24 May 2022 14:31:16 +0300	[thread overview]
Message-ID: <83k0ab5fqz.fsf@gnu.org> (raw)
In-Reply-To: <CAHjfyZ0Fd6xvxn2zxqa20_rhBS=GsBbJJCO2eQfd+3j4coSMWA@mail.gmail.com> (message from Peter Ludemann on Tue, 24 May 2022 02:29:37 -0700)

> Cc: 55599@debbugs.gnu.org
> From: Peter Ludemann <peter.ludemann@gmail.com>
> Date: Tue, 24 May 2022 02:29:37 -0700
> 
> I don't want to unconditionally save buffers; I want to conditionally save them. (Actually, I wouldn't mind if it
> didn't save the buffers at all; when I restart emacs, it finds the ".#" files, and that suffices.)
> 
> There's a more general problem here (although you might decide it's too much trouble to fix) -- it seems that
> when "emacsclient -e" is used, any prompts go to the non-existent screen rather than to the terminal. (e.g.,
> yes-or-n-p's prompt).

"emacsclient -e" is not meant to support execution of interactive Lisp
programs, especially not when there's no client frame through which to
interact with the user.  If you want interaction via emacsclient,
start emacsclient normally, and then invoke those interactive Lisp
programs in the client frame that the server opens.

I see no bugs in the behavior you report, and no change from previous
Emacs versions.  So I'm unsure what issues are being discussed here
(but see below).

> Also, save-buffers-kill-emacs does two things: (conditionally) saves the buffers and deletes the
> ~/.emacs.d/.emacs.desktop.lock file. On the other hand, the lower level kill-emacs doesn't delete the lock file
> (and the response to bug 55560 is that that's a deliberate design decision). So, there's no way of doing from
> the command line "kill-emacs-and-remove-lock-file", it seems.

You can do anything from the command line, as long as you make sure
the Lisp program you invoke via the -e switch doesn't ask any
questions.  E.g., you can invoke a Lisp program that deletes the
desktop lock file in a kill-emacs-hook, provided that you write such a
hook yourself and set it in the same Lisp program you pass via -e.

The change that triggered this bug report supports "normal" use of
emacsclient, whereby the server session is terminated interactively.
If you insist on doing that noninteractively, you will have to write
your own Lisp program to do that.  Alternatively, feel free to request
a new feature of emacsclient whereby you could terminate the server
session non-interactively via some new command-line option; then the
implementation of such a feature will have to do all that internally.





  reply	other threads:[~2022-05-24 11:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-23 19:56 bug#55599: save-buffers-kill-emacs doesn't give a visible prompt when called from command line Peter Ludemann
2022-05-24  7:34 ` Michael Albinus
2022-05-24  9:29   ` Peter Ludemann
2022-05-24 11:31     ` Eli Zaretskii [this message]
2022-05-28 18:27       ` Peter Ludemann
2022-05-28 19:25         ` Eli Zaretskii
2022-05-28 19:39           ` Eli Zaretskii
2022-05-31 19:34             ` Peter Ludemann
2022-06-01  2:30               ` Eli Zaretskii
2022-06-01 17:54                 ` Peter Ludemann
2022-06-01 19:52                   ` Eli Zaretskii
2022-06-01 20:04                     ` Peter Ludemann
2023-09-13  1:43                       ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83k0ab5fqz.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=55599@debbugs.gnu.org \
    --cc=michael.albinus@gmx.de \
    --cc=peter.ludemann@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).