From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: peder@klingenberg.no (Peder O. Klingenberg) Newsgroups: gmane.emacs.bugs Subject: bug#25708: 25.1.91; Allow users to inhibit printing for 'emacsclient -c -t' Date: Sun, 19 Feb 2017 21:54:22 +0100 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1487537714 12312 195.159.176.226 (19 Feb 2017 20:55:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 19 Feb 2017 20:55:14 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (darwin) Cc: 25708@debbugs.gnu.org To: Alex Hutcheson Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Feb 19 21:55:11 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cfYVg-0002jn-Ka for geb-bug-gnu-emacs@m.gmane.org; Sun, 19 Feb 2017 21:55:08 +0100 Original-Received: from localhost ([::1]:35058 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cfYVm-0003WA-Hd for geb-bug-gnu-emacs@m.gmane.org; Sun, 19 Feb 2017 15:55:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38260) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cfYVg-0003Ur-2r for bug-gnu-emacs@gnu.org; Sun, 19 Feb 2017 15:55:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cfYVa-00009z-ID for bug-gnu-emacs@gnu.org; Sun, 19 Feb 2017 15:55:08 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48332) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cfYVa-00009h-E2 for bug-gnu-emacs@gnu.org; Sun, 19 Feb 2017 15:55:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cfYVa-0008CZ-7W for bug-gnu-emacs@gnu.org; Sun, 19 Feb 2017 15:55:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: peder@klingenberg.no (Peder O. Klingenberg) Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 19 Feb 2017 20:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25708 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25708-submit@debbugs.gnu.org id=B25708.148753767931490 (code B ref 25708); Sun, 19 Feb 2017 20:55:02 +0000 Original-Received: (at 25708) by debbugs.gnu.org; 19 Feb 2017 20:54:39 +0000 Original-Received: from localhost ([127.0.0.1]:46531 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cfYVC-0008Bp-U4 for submit@debbugs.gnu.org; Sun, 19 Feb 2017 15:54:39 -0500 Original-Received: from tarrant.klingenberg.no ([80.91.231.253]:56541) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cfYVB-0008Bh-JS for 25708@debbugs.gnu.org; Sun, 19 Feb 2017 15:54:38 -0500 Original-Received: from [94.102.36.20] (helo=modesty.localdomain) by tarrant.klingenberg.no with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1cfYV0-0000P7-Kz; Sun, 19 Feb 2017 21:54:33 +0100 Original-Received: by modesty.localdomain (Postfix, from userid 502) id 531D41710FB2; Sun, 19 Feb 2017 21:54:22 +0100 (CET) In-Reply-To: (Alex Hutcheson's message of "Mon, 13 Feb 2017 14:46:34 -0500") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:129551 Archived-At: --=-=-= Content-Type: text/plain Alex Hutcheson 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. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Extend-emacsclient-quiet-to-cover-eval-output.patch >From 6d3e185a9ddacd94b8950775e3fb056c568fc66d Mon Sep 17 00:00:00 2001 From: "Peder O. Klingenberg" Date: Sun, 19 Feb 2017 20:59:14 +0100 Subject: [PATCH] Extend emacsclient --quiet to cover eval output * lib-src/emacsclient.c (main): Extend --quiet flag to suppress printing of eval-results. (Bug#25708) --- lib-src/emacsclient.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index 70709ecec0..65ea5541b8 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c @@ -1860,19 +1860,25 @@ main (int argc, char **argv) else if (strprefix ("-print ", p)) { /* -print STRING: Print STRING on the terminal. */ - str = unquote_argument (p + strlen ("-print ")); - if (needlf) - printf ("\n"); - printf ("%s", str); - needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n'; - } + if (!quiet) + { + str = unquote_argument (p + strlen ("-print ")); + if (needlf) + printf ("\n"); + printf ("%s", str); + needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n'; + } + } else if (strprefix ("-print-nonl ", p)) { /* -print-nonl STRING: Print STRING on the terminal. Used to continue a preceding -print command. */ - str = unquote_argument (p + strlen ("-print-nonl ")); - printf ("%s", str); - needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n'; + if (!quiet) + { + str = unquote_argument (p + strlen ("-print-nonl ")); + printf ("%s", str); + needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n'; + } } else if (strprefix ("-error ", p)) { -- 2.11.0 --=-=-=--