From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Peter Ludemann Newsgroups: gmane.emacs.bugs Subject: bug#55599: save-buffers-kill-emacs doesn't give a visible prompt when called from command line Date: Tue, 24 May 2022 02:29:37 -0700 Message-ID: References: <87r14jo02m.fsf@gmx.de> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000009afd5005dfbe9aaa" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8613"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 55599@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 24 11:50:50 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ntRBi-00021i-CH for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 24 May 2022 11:50:50 +0200 Original-Received: from localhost ([::1]:53460 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ntRBg-00073U-QT for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 24 May 2022 05:50:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42086) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntQsY-0003o9-9q for bug-gnu-emacs@gnu.org; Tue, 24 May 2022 05:31:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57169) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ntQsX-0005I1-VC for bug-gnu-emacs@gnu.org; Tue, 24 May 2022 05:31:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ntQsX-0001o8-O2 for bug-gnu-emacs@gnu.org; Tue, 24 May 2022 05:31:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Peter Ludemann Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 24 May 2022 09:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55599 X-GNU-PR-Package: emacs Original-Received: via spool by 55599-submit@debbugs.gnu.org id=B55599.16533846246899 (code B ref 55599); Tue, 24 May 2022 09:31:01 +0000 Original-Received: (at 55599) by debbugs.gnu.org; 24 May 2022 09:30:24 +0000 Original-Received: from localhost ([127.0.0.1]:51066 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ntQrw-0001nD-C4 for submit@debbugs.gnu.org; Tue, 24 May 2022 05:30:24 -0400 Original-Received: from mail-pf1-f181.google.com ([209.85.210.181]:45049) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ntQrs-0001mw-Ai for 55599@debbugs.gnu.org; Tue, 24 May 2022 05:30:23 -0400 Original-Received: by mail-pf1-f181.google.com with SMTP id x143so15941095pfc.11 for <55599@debbugs.gnu.org>; Tue, 24 May 2022 02:30:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Gen1gFF5T3PY2s4yoc7ZWJGgZ8Mhogzw4ChOQ3qSLz0=; b=UWqgxpJyITMTJsEjzMyXTBg7CRlw+imTUcqUa2g37R8EapBi75ybcVzLeijf9UE0x6 TtGaIEv7Nmm3RWEIiVvHlOxqLX8qLrg+/vCCpQq2E1AZwXNqKGsbutZIClHB9vlsi2xg 00q0L/Vxjjy0DAJGU8NwEOK8viBg9HqOcStQi103NxsE0z5AF7eB7WBRjcEitD3HeG91 +D0p0UlmCxrGlqFQ0mPu9KkoxgGh6GG/kbieN27k53adxf/9J4cA8dAJl5LvYzntKJgE Jg3D6jZaPu5a7Z7yZVd0kmX0hrQPj0RmPhtiY+44GVOs8nKtqvheNdlYE70sHWumGZkV sMNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Gen1gFF5T3PY2s4yoc7ZWJGgZ8Mhogzw4ChOQ3qSLz0=; b=YUmwJpVmu1FUy8nfA8ETPhOEuH4gwLrANmVuHtLooAMky0GEo2e/0z1219RSaKlRCo XWANdV53mMrMoyXoakM06nfvVDglCKbvHWNoci7So+K8OwRj8hXZNfB3+n6rwzYd86L2 EQxQTAf5xNnYklI3MOjqotWdar2yju7KDeqxUGkpX5cg2yUN/Fn5V9djHsIenMar+vzT IxVBCDwaHBjx74I4OeQTLzvUM8SuA8uu2ntPaVxP2cLR2npJ6NhsOZBw70A5FHxULBbQ 80mAlW5VCeRLOroXei8w2R3Hfb2hu03lZgMViEutFbCWGg2ztPLxkJdqCD0rLeDS07IO wOqA== X-Gm-Message-State: AOAM533VxDd+Z8i6QFuDBNe5uIN8xpGBm7seQvSd91osZ/ZjMenrM9Vq O4Wp3+JBYF05kg+aA4fx0Zhn8IgY92d5WzX2lZE= X-Google-Smtp-Source: ABdhPJzKAxcZiMD7TIT81U2vORLcQBhP8kqR7p4k5Fz82BbJMlPEIGIjGq4UsOH8uVFoyQsAAGGYYSCWI8ssN+wqgn8= X-Received: by 2002:a05:6a00:2d0:b0:518:95f8:d00a with SMTP id b16-20020a056a0002d000b0051895f8d00amr11374128pft.8.1653384614180; Tue, 24 May 2022 02:30:14 -0700 (PDT) In-Reply-To: <87r14jo02m.fsf@gmx.de> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:232993 Archived-At: --0000000000009afd5005dfbe9aaa Content-Type: text/plain; charset="UTF-8" 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). 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. On Tue, 24 May 2022 at 00:34, Michael Albinus wrote: > Peter Ludemann 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. > --0000000000009afd5005dfbe9aaa Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I don't want to unconditionally save buffers; I want to con= ditionally 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 (althoug= h 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 scre= en rather than to the terminal. (e.g., yes-or-n-p's prompt).

=
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, th= e lower level kill-emacs doesn't delete the lock file (and the response= to bug=C2=A055560 is that that's a deliberate design decision). So, th= ere's no way of doing from the command line "kill-emacs-and-remove= -lock-file", it seems.

On Tue, 24 May 2022 at 00:34, Michael Albi= nus <michael= .albinus@gmx.de> wrote:
Peter Ludemann <peter.ludemann@gmail.com> writes:

Hi Peter,

> When I try to kill an emacs server from the command line by:
>=C2=A0 =C2=A0 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 (bel= ow
> the mode line in the screen), which of course isn't visible from t= he
> command line because there isn't any screen when using "emacs= client -e".
>
> This is a follow-up to bug 55560, where it was suggested that kill-ema= cs 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

=C2=A0 emacsclient -e '(save-buffers-kill-emacs t)'

Best regards, Michael.
--0000000000009afd5005dfbe9aaa--