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: Wed, 1 Jun 2022 13:04:42 -0700 Message-ID: References: <87r14jo02m.fsf@gmx.de> <83k0ab5fqz.fsf@gnu.org> <83fsktlari.fsf@gnu.org> <83czfxla5a.fsf@gnu.org> <83mtexglo0.fsf@gnu.org> <83mtewf9g4.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000008bac0a05e0686805" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6909"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Michael Albinus , 55599@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 01 22:06:16 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 1nwUbf-0001b6-On for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 01 Jun 2022 22:06:15 +0200 Original-Received: from localhost ([::1]:39108 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nwUbe-0001rO-DU for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 01 Jun 2022 16:06:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48594) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nwUbS-0001py-S8 for bug-gnu-emacs@gnu.org; Wed, 01 Jun 2022 16:06:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58059) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nwUbS-0003lQ-Iw for bug-gnu-emacs@gnu.org; Wed, 01 Jun 2022 16:06:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nwUbS-0006x9-3q for bug-gnu-emacs@gnu.org; Wed, 01 Jun 2022 16:06:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Peter Ludemann Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 01 Jun 2022 20:06:02 +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.165411392726678 (code B ref 55599); Wed, 01 Jun 2022 20:06:02 +0000 Original-Received: (at 55599) by debbugs.gnu.org; 1 Jun 2022 20:05:27 +0000 Original-Received: from localhost ([127.0.0.1]:51956 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nwUas-0006wD-P2 for submit@debbugs.gnu.org; Wed, 01 Jun 2022 16:05:27 -0400 Original-Received: from mail-pj1-f46.google.com ([209.85.216.46]:54979) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nwUaq-0006vx-On for 55599@debbugs.gnu.org; Wed, 01 Jun 2022 16:05:25 -0400 Original-Received: by mail-pj1-f46.google.com with SMTP id j7so3002332pjn.4 for <55599@debbugs.gnu.org>; Wed, 01 Jun 2022 13:05:24 -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=i9jf48QCAYVEulhYELXc8qF8V7nKGy66KS8TtvGfHiQ=; b=V+kQF4+0MGRmQsMJ5fAbON4sTf4dM3ywhZEqEePu9iDDudhy7xTKTb2iEiByPkJV3+ cHmE0iZ7R8zCtU8dP/PuoBSS4gtJnZ/X7qeps5cSqFeTUL/Ik0AUxn6tE9ahmP7vzFUe VEaUnZ7c9g7AbrjnK5lcjk4NVrK53FdUuM6yXoxXE3QDSzGu8qx2jNIDPWRPlby/aeuz 3xGpXPJaaxUo6TEXCsd2Vv5JJObeX6kBKDn5XQBFa1w1oAlji45LOYPzYJQJw6AHuq+1 xYrMGxhDUPBCuzt5+y4TG96yUxhh+KbXXh1G4+tfGkgXxl8owNorh8/QWm/uJAyNDF1E 2Vfg== 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=i9jf48QCAYVEulhYELXc8qF8V7nKGy66KS8TtvGfHiQ=; b=qneJBfzBEW8ePNCe/4Eqgm/OsE3VPfr0NlsgPKSXnsjXw11G2FzTOt9/ww9EgfQ8kX nAz/qplChd2SaG9NoFFIGYNHrO5FZC1T6pyvISYguSYwIvPfcdQxDFHIHHfO/tofWHzz U+6W9wZAx3zFp44CsMnfgq/G5uFp0WYXH7s8JaYN85HkjbugW+P+GLJK5hXB85abp2Ut Or9OPMefpDcp/GNukv/Aq3uMQUq74lgkjHC1UstQSOCzR4WAS433z3M68B86DhK2Kc6x BSLUTlxRZzQI0hLnFdko7tMOFXKhcIunHUUnU4MgZFPTxaycrRLuRXCPRFjnHUx9GKWW MDhQ== X-Gm-Message-State: AOAM531qdHjt2zIG13tReSy4KWdP/+UxGmYCZAZ05WvT/OT1Vd/F1CED nvBAi3e0N7Q7tzCw32MTaEyleRj7GCOnaURtnxE= X-Google-Smtp-Source: ABdhPJx7m0eFIcUcxd73pqiMBu5ocuvlu3jPdOlSDkD23Rda0ap7cBe57zXeqage/EtBv332MKy2MBiJyHS+xIovZe0= X-Received: by 2002:a17:90b:1a88:b0:1dc:e4a1:a81e with SMTP id ng8-20020a17090b1a8800b001dce4a1a81emr36283519pjb.96.1654113918756; Wed, 01 Jun 2022 13:05:18 -0700 (PDT) In-Reply-To: <83mtewf9g4.fsf@gnu.org> 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:233511 Archived-At: --0000000000008bac0a05e0686805 Content-Type: text/plain; charset="UTF-8" On Wed, 1 Jun 2022 at 12:52, Eli Zaretskii wrote: > > From: Peter Ludemann > > Date: Wed, 1 Jun 2022 10:54:02 -0700 > > Cc: Michael Albinus , 55599@debbugs.gnu.org > > > > I start the emacs daemon from a terminal by: > > emacs --daemon > > > > During startup, there might be some prompts (e.g., I get a pagination > prompt from parsing a tar file, when > > emacs is loading my last session's files), and I can deal with them at > the terminal. > > > > When I shutdown the emacs daemon, I would like to also do this at the > terminal: > > emacsclient -e '(save-buffers-kill-emacs)' > > but that doesn't work if there are any prompts (e.g., saving a file or > killing a shell process). > > A work-around is to do: > > emacsclient -c -e '(save-buffers-kill-emacs)' > > and that lets me see the prompts in the minibuffer. > > > > However, it seems that "emacsclient -e" has access to the terminal's > stderr. > > Evidence: I get an error message at the terminal (not in a minibuffer) > if I do something with an error, such as > > emacsclient -e '(man fprintf)' > > > > If stderr is being passed in to the evaluation code in daemon mode, then > it would be nice to also have stdin > > passed in, which would allow interaction at the terminal. > > stderr is not passed. What happens is that any messages sent by the > server are echoed by the client on its own stderr. > > However, the reverse direction is not supported. For it to be > supported, we need a way to tell the server to wait for the client to > return the user's response. Such a feature doesn't exist, AFAIK, so > to support it we need to extend the client-server protocol. > That sounds like a lot of work for a very small pay-off (at least, in the scenario I've given), especially as there's an easy work-around. Feel free to close this bug/feature-request as "wontfix". ;) And, again, thank-you for your prompt and very helpful responses (and your patience with someone who knows very little about the internals of emacs) --0000000000008bac0a05e0686805 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Wed, 1 Jun 2022 at 12:52, Eli Zar= etskii <eliz@gnu.org> wrote:
<= /div>
> From: Peter Lud= emann <pet= er.ludemann@gmail.com>
> Date: Wed, 1 Jun 2022 10:54:02 -0700
> Cc: Michael Albinus <michael.albinus@gmx.de>, 55599@debbugs.gnu.org
>
> I start the emacs daemon from a terminal by:
>=C2=A0 =C2=A0 =C2=A0emacs --daemon
>
> During startup, there might be some prompts (e.g., I get a pagination = prompt from parsing a tar file, when
> emacs is loading my last session's files), and I can deal with the= m at the terminal.
>
> When I shutdown the emacs daemon, I would like to also do this at the = terminal:
>=C2=A0 =C2=A0 =C2=A0emacsclient -e '(save-buffers-kill-emacs)'<= br> > but that doesn't work if there are any prompts (e.g., saving a fil= e or killing a shell process).
> A work-around is to do:
>=C2=A0 =C2=A0 =C2=A0emacsclient -c -e '(save-buffers-kill-emacs)= 9;
> and that lets me see the prompts in the minibuffer.
>
> However, it seems that "emacsclient -e" has access to the te= rminal's stderr.
> Evidence: I get an error message at the terminal (not in a minibuffer)= if I do something with an error, such as
>=C2=A0 =C2=A0 =C2=A0emacsclient -e '(man fprintf)'
>
> If stderr is being passed in to the evaluation code in daemon mode, th= en it would be nice to also have stdin
> passed in, which would allow interaction at the terminal.

stderr is not passed.=C2=A0 What happens is that any messages sent by the server are echoed by the client on its own stderr.

However, the reverse direction is not supported.=C2=A0 For it to be
supported, we need a way to tell the server to wait for the client to
return the user's response.=C2=A0 Such a feature doesn't exist, AFA= IK, so
to support it we need to extend the client-server protocol.

That sounds like a lot of work for a very small pay-off (at= least, in the scenario I've given), especially as there's an easy = work-around.=C2=A0
Feel free to close this bug/feature-request as "won= tfix". ;)

And, again, thank-you for your prompt and very helpful = responses (and your patience with someone who knows very little about the i= nternals of emacs)


=C2=A0
--0000000000008bac0a05e0686805--