GNU bug report logs - #25708
25.1.91; Allow users to inhibit printing for 'emacsclient -c -t'

Previous Next

Package: emacs;

Reported by: Alex Hutcheson <alexhutcheson <at> google.com>

Date: Mon, 13 Feb 2017 19:47:02 UTC

Severity: wishlist

Tags: patch

Found in version 25.1.91

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 25708 in the body.
You can then email your comments to 25708 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#25708; Package emacs. (Mon, 13 Feb 2017 19:47:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alex Hutcheson <alexhutcheson <at> google.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 13 Feb 2017 19:47:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Alex Hutcheson <alexhutcheson <at> google.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.1.91; Allow users to inhibit printing for 'emacsclient -c -t'
Date: Mon, 13 Feb 2017 14:46:34 -0500
Sometimes I want to eval some elisp at the command line exclusively to
set up some buffers for me to work with in a new frame. For example, to
diff two files, I often do:
  emacsclient -c -e '(ediff "fileA" "fileB")

This works, but emacsclient annoyingly prints the result of the eval'ed
expression to stdout. In this case, I'll get:
  #<buffer *Ediff Control Panel*>

This output is annoying, and it can't be redirected (`emacsclient -c' on a
terminal fail to launch if stdout is redirected, for obvious reasons).

It would be great if emacsclient had a way to inhibit printing the
result, for cases where the user is only eval'ing the expressions for
their side effects.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25708; Package emacs. (Sun, 19 Feb 2017 20:55:02 GMT) Full text and rfc822 format available.

Message #8 received at 25708 <at> debbugs.gnu.org (full text, mbox):

From: peder <at> klingenberg.no (Peder O. Klingenberg)
To: Alex Hutcheson <alexhutcheson <at> google.com>
Cc: 25708 <at> debbugs.gnu.org
Subject: Re: bug#25708: 25.1.91;
 Allow users to inhibit printing for 'emacsclient -c -t'
Date: Sun, 19 Feb 2017 21:54:22 +0100
[Message part 1 (text/plain, inline)]
Alex Hutcheson <alexhutcheson <at> google.com> writes:

> It would be great if emacsclient had a way to inhibit printing the
> result, for cases where the user is only eval'ing the expressions for
> their side effects.

Emacsclient claims to have that functionality already.  From the
usage-message:

-q, --quiet		Don't display messages on success

This should, in my opinion, cover the case of successfully eval-ing
forms.  However, -q currently has no effect on output from emacs, it
only inhibits messages about connecting to emacs.

The attached patch should prevent emacsclient from printing non-error
output from emacs to the terminal.

With this the terminal stays quiet after exiting the client frame when I
do "emacsclient -q -c -e '(+ 2 3)'".  Without the -q, the terminal
prints 5 as before.

[0001-Extend-emacsclient-quiet-to-cover-eval-output.patch (text/x-patch, attachment)]

Added tag(s) patch. Request was from peder <at> klingenberg.no (Peder O. Klingenberg) to control <at> debbugs.gnu.org. (Sun, 19 Feb 2017 20:56:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25708; Package emacs. (Mon, 20 Feb 2017 03:30:02 GMT) Full text and rfc822 format available.

Message #13 received at 25708 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: peder <at> klingenberg.no (Peder O. Klingenberg)
Cc: 25708 <at> debbugs.gnu.org, alexhutcheson <at> google.com
Subject: Re: bug#25708: 25.1.91;
 Allow users to inhibit printing for 'emacsclient -c -t'
Date: Mon, 20 Feb 2017 05:29:51 +0200
> From: peder <at> klingenberg.no (Peder O. Klingenberg)
> Date: Sun, 19 Feb 2017 21:54:22 +0100
> Cc: 25708 <at> debbugs.gnu.org
> 
> > It would be great if emacsclient had a way to inhibit printing the
> > result, for cases where the user is only eval'ing the expressions for
> > their side effects.
> 
> Emacsclient claims to have that functionality already.  From the
> usage-message:
> 
> -q, --quiet		Don't display messages on success
> 
> This should, in my opinion, cover the case of successfully eval-ing
> forms.  However, -q currently has no effect on output from emacs, it
> only inhibits messages about connecting to emacs.
> 
> The attached patch should prevent emacsclient from printing non-error
> output from emacs to the terminal.
> 
> With this the terminal stays quiet after exiting the client frame when I
> do "emacsclient -q -c -e '(+ 2 3)'".  Without the -q, the terminal
> prints 5 as before.

Thanks, but I think this warrants a separate command-line option, or
maybe a special argument to --quiet.  Otherwise, it would be an
incompatible change in behavior.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25708; Package emacs. (Mon, 20 Feb 2017 08:59:02 GMT) Full text and rfc822 format available.

Message #16 received at 25708 <at> debbugs.gnu.org (full text, mbox):

From: peder <at> klingenberg.no (Peder O. Klingenberg)
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 25708 <at> debbugs.gnu.org, alexhutcheson <at> google.com
Subject: Re: bug#25708: 25.1.91;
 Allow users to inhibit printing for 'emacsclient -c -t'
Date: Mon, 20 Feb 2017 09:58:43 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

> Thanks, but I think this warrants a separate command-line option, or
> maybe a special argument to --quiet.  Otherwise, it would be an
> incompatible change in behavior.

Ok.  I'll take a stab at implementing that later today.

--
...Peder...




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25708; Package emacs. (Mon, 20 Feb 2017 17:20:02 GMT) Full text and rfc822 format available.

Message #19 received at 25708 <at> debbugs.gnu.org (full text, mbox):

From: peder <at> klingenberg.no (Peder O. Klingenberg)
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 25708 <at> debbugs.gnu.org, alexhutcheson <at> google.com
Subject: Re: bug#25708: 25.1.91;
 Allow users to inhibit printing for 'emacsclient -c -t'
Date: Mon, 20 Feb 2017 18:19:20 +0100
[Message part 1 (text/plain, inline)]
peder <at> klingenberg.no (Peder O. Klingenberg) writes:

> Ok.  I'll take a stab at implementing that later today.

How about this patch instead of my previous one?

[0001-New-option-u-quell-to-emacsclient.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
--
...Peder...

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25708; Package emacs. (Mon, 20 Feb 2017 17:36:02 GMT) Full text and rfc822 format available.

Message #22 received at 25708 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: peder <at> klingenberg.no (Peder O. Klingenberg)
Cc: 25708 <at> debbugs.gnu.org, alexhutcheson <at> google.com
Subject: Re: bug#25708: 25.1.91;
 Allow users to inhibit printing for 'emacsclient -c -t'
Date: Mon, 20 Feb 2017 19:34:44 +0200
> From: peder <at> klingenberg.no (Peder O. Klingenberg)
> Cc: 25708 <at> debbugs.gnu.org,  alexhutcheson <at> google.com
> Date: Mon, 20 Feb 2017 18:19:20 +0100
> 
> How about this patch instead of my previous one?

Looks good (but see minor comments below).  Let's wait for a few days
to give others a chance to comment.

> +/* Nonzero means don't print values returned from emacs. --quell */

Each comment should end with a period and 2 spaces.  Like this:

>  /* Nonzero means args are expressions to be evaluated.  --eval.  */


> +-u, --quell		Don't display non-error return values from the server\n\

Do we really need the "non-error" part here?  Errors don't manifest
themselves via return values, I think.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25708; Package emacs. (Mon, 20 Feb 2017 18:05:01 GMT) Full text and rfc822 format available.

Message #25 received at 25708 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: peder <at> klingenberg.no (Peder O. Klingenberg)
Cc: 25708 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>,
 alexhutcheson <at> google.com
Subject: Re: bug#25708: 25.1.91;
 Allow users to inhibit printing for 'emacsclient -c -t'
Date: Mon, 20 Feb 2017 19:04:10 +0100
On Feb 20 2017, peder <at> klingenberg.no (Peder O. Klingenberg) wrote:

> Subject: [PATCH] New option -u / -quell to emacsclient

Is quell a word?

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25708; Package emacs. (Mon, 20 Feb 2017 18:14:02 GMT) Full text and rfc822 format available.

Message #28 received at 25708 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: 25708 <at> debbugs.gnu.org, alexhutcheson <at> google.com, peder <at> klingenberg.no
Subject: Re: bug#25708: 25.1.91;
 Allow users to inhibit printing for 'emacsclient -c -t'
Date: Mon, 20 Feb 2017 20:13:34 +0200
> From: Andreas Schwab <schwab <at> linux-m68k.org>
> Cc: Eli Zaretskii <eliz <at> gnu.org>,  25708 <at> debbugs.gnu.org,  alexhutcheson <at> google.com
> Date: Mon, 20 Feb 2017 19:04:10 +0100
> 
> On Feb 20 2017, peder <at> klingenberg.no (Peder O. Klingenberg) wrote:
> 
> > Subject: [PATCH] New option -u / -quell to emacsclient
> 
> Is quell a word?

Yes, although not a widely used one.  It means "silence" or "subdue".




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25708; Package emacs. (Mon, 20 Feb 2017 18:18:02 GMT) Full text and rfc822 format available.

Message #31 received at 25708 <at> debbugs.gnu.org (full text, mbox):

From: peder <at> klingenberg.no (Peder O. Klingenberg)
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: 25708 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>,
 alexhutcheson <at> google.com
Subject: Re: bug#25708: 25.1.91;
 Allow users to inhibit printing for 'emacsclient -c -t'
Date: Mon, 20 Feb 2017 19:17:07 +0100
Andreas Schwab <schwab <at> linux-m68k.org> writes:

> Is quell a word?

Yes.  See for instance:

https://www.merriam-webster.com/dictionary/quell




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25708; Package emacs. (Mon, 20 Feb 2017 18:29:01 GMT) Full text and rfc822 format available.

Message #34 received at 25708 <at> debbugs.gnu.org (full text, mbox):

From: peder <at> klingenberg.no (Peder O. Klingenberg)
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 25708 <at> debbugs.gnu.org, alexhutcheson <at> google.com
Subject: Re: bug#25708: 25.1.91;
 Allow users to inhibit printing for 'emacsclient -c -t'
Date: Mon, 20 Feb 2017 19:28:28 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

> Each comment should end with a period and 2 spaces.  Like this:

Sorry.  I'll fix it.

> Do we really need the "non-error" part here?  Errors don't manifest
> themselves via return values, I think.

I'm not intimately familiar with the protocol between emacs and
emacsclient, but emacsclient handles a number of different return
messages from emacs.  Two of which (-print and -print-nonl) I made -u
apply to.

Another possible return message seems to be -error, which also results
in stuff being printed by emacsclient (in this case to stderr).  -u does
not suppress that kind of printing.  I thought it worth specifying, but
if that path is in practice never used, I can take that wording out.
What do people think?

--
...Peder...




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25708; Package emacs. (Mon, 20 Feb 2017 19:16:02 GMT) Full text and rfc822 format available.

Message #37 received at 25708 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 25708 <at> debbugs.gnu.org, alexhutcheson <at> google.com, peder <at> klingenberg.no
Subject: Re: bug#25708: 25.1.91;
 Allow users to inhibit printing for 'emacsclient -c -t'
Date: Mon, 20 Feb 2017 20:15:18 +0100
On Feb 20 2017, Eli Zaretskii <eliz <at> gnu.org> wrote:

>> From: Andreas Schwab <schwab <at> linux-m68k.org>
>> Cc: Eli Zaretskii <eliz <at> gnu.org>,  25708 <at> debbugs.gnu.org,  alexhutcheson <at> google.com
>> Date: Mon, 20 Feb 2017 19:04:10 +0100
>> 
>> On Feb 20 2017, peder <at> klingenberg.no (Peder O. Klingenberg) wrote:
>> 
>> > Subject: [PATCH] New option -u / -quell to emacsclient
>> 
>> Is quell a word?
>
> Yes, although not a widely used one.  It means "silence" or "subdue".

Then it's not a good word to describe the option.  Better would be
--suppress-output.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25708; Package emacs. (Mon, 20 Feb 2017 20:56:02 GMT) Full text and rfc822 format available.

Message #40 received at 25708 <at> debbugs.gnu.org (full text, mbox):

From: peder <at> klingenberg.no (Peder O. Klingenberg)
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: 25708 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>,
 alexhutcheson <at> google.com
Subject: Re: bug#25708: 25.1.91;
 Allow users to inhibit printing for 'emacsclient -c -t'
Date: Mon, 20 Feb 2017 21:55:15 +0100
[Message part 1 (text/plain, inline)]
Andreas Schwab <schwab <at> linux-m68k.org> writes:

> Then it's not a good word to describe the option.  Better would be
> --suppress-output.

I thought it succinctly expressed what the flag did, but I have no
objection to --suppress-output.

Attached is the latest version of the patch, with all objections raised
so far addressed.

[0001-New-option-u-suppress-output-to-emacsclient.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]

--
...Peder...

Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sat, 25 Feb 2017 08:34:01 GMT) Full text and rfc822 format available.

Notification sent to Alex Hutcheson <alexhutcheson <at> google.com>:
bug acknowledged by developer. (Sat, 25 Feb 2017 08:34:02 GMT) Full text and rfc822 format available.

Message #45 received at 25708-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: peder <at> klingenberg.no (Peder O. Klingenberg)
Cc: 25708-done <at> debbugs.gnu.org, schwab <at> linux-m68k.org, alexhutcheson <at> google.com
Subject: Re: bug#25708: 25.1.91;
 Allow users to inhibit printing for 'emacsclient -c -t'
Date: Sat, 25 Feb 2017 10:33:12 +0200
> From: peder <at> klingenberg.no (Peder O. Klingenberg)
> Cc: Eli Zaretskii <eliz <at> gnu.org>,  25708 <at> debbugs.gnu.org,  alexhutcheson <at> google.com
> Date: Mon, 20 Feb 2017 21:55:15 +0100
> 
> Andreas Schwab <schwab <at> linux-m68k.org> writes:
> 
> > Then it's not a good word to describe the option.  Better would be
> > --suppress-output.
> 
> I thought it succinctly expressed what the flag did, but I have no
> objection to --suppress-output.
> 
> Attached is the latest version of the patch, with all objections raised
> so far addressed.

Thanks, pushed to the master branch.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 25 Mar 2017 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 146 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.