From unknown Sun Aug 17 04:18:07 2025 X-Loop: don@donarmstrong.com Subject: bug#663: Adding --quiet option to emacsclient Reply-To: Drake Wilson , 663@debbugs.gnu.org Resent-From: Drake Wilson Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Wed, 06 Aug 2008 23:15:05 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 663 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.121806404912955 (code B ref -1); Wed, 06 Aug 2008 23:15:05 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-7.9 required=4.0 tests=BAYES_00,FOURLA, FVGT_m_MULTI_ODD,MURPHY_DRUGS_REL8,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 6 Aug 2008 23:07:29 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m76N7PdH012940 for ; Wed, 6 Aug 2008 16:07:26 -0700 Received: from mail.gnu.org ([199.232.76.166]:55649 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1KQs5F-0003V6-WB for emacs-pretest-bug@gnu.org; Wed, 06 Aug 2008 19:06:22 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1KQs6E-0003AT-Dy for emacs-pretest-bug@gnu.org; Wed, 06 Aug 2008 19:07:24 -0400 Received: from adsl-75-55-112-14.dsl.austtx.sbcglobal.net ([75.55.112.14]:50795 helo=zwischenschaltung.begriffli.ch) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KQs6D-0003A5-Uo for emacs-pretest-bug@gnu.org; Wed, 06 Aug 2008 19:07:22 -0400 Received: from drache.begriffli.ch (drache [192.168.2.1]) by zwischenschaltung.begriffli.ch (Postfix) with ESMTP id 60DF527589; Wed, 6 Aug 2008 17:47:16 -0500 (CDT) Received: from drake by drache.begriffli.ch with local (Exim 4.69) (envelope-from ) id 1KQrmr-0002Ap-Ul; Wed, 06 Aug 2008 17:47:21 -0500 Date: Wed, 6 Aug 2008 17:47:21 -0500 From: Drake Wilson To: emacs-pretest-bug@gnu.org Cc: Chong Yidong , emacs-devel@gnu.org Message-ID: <20080806224721.GA8325@drache.begriffli.ch> Mail-Followup-To: emacs-pretest-bug@gnu.org, Chong Yidong , emacs-devel@gnu.org References: <20080806210838.GA2655@drache.begriffli.ch> <874p5xdbb8.fsf@stupidchicken.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="W/nzBZO5zC0uMSeA" Content-Disposition: inline In-Reply-To: <874p5xdbb8.fsf@stupidchicken.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-Greylist: delayed 1203 seconds by postgrey-1.27 at monty-python; Wed, 06 Aug 2008 19:07:21 EDT --W/nzBZO5zC0uMSeA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Quoth Chong Yidong , on 2008-08-06 18:32:27 -0400: > > In the Debian BTS wishlist ticket #490253, I requested a --quiet > > option for emacsclient; currently, it prints a "Waiting for Emacs..." > > message that cannot be turned off, which I found annoying. I have > > updated the patch I provided in that report to apply against the CVS > > version of Emacs; it would be nice if this feature could make it into > > Emacs 23. > > Emacs 23 is in feature freeze. Could you please send your patch to > emacs-pretest-bug@gnu.org, so that it is entered in our bug tracker? > Then after the release, we'll see if this can be included. Thanks. Very well. Forwarding now. Hello, emacs-pretest-bug. (Also re-cc'ing emacs-devel, since I think my actual diff got eaten somewhere along the way; probably I just miscommanded my mailer.) ---> Drake Wilson --W/nzBZO5zC0uMSeA Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="emacs22-emacsclient-quiet-option-2.diff" Index: doc/emacs/misc.texi =================================================================== RCS file: /sources/emacs/emacs/doc/emacs/misc.texi,v retrieving revision 1.6 diff -u -r1.6 misc.texi --- doc/emacs/misc.texi 13 Jun 2008 08:06:41 -0000 1.6 +++ doc/emacs/misc.texi 6 Aug 2008 19:12:31 -0000 @@ -1412,6 +1412,10 @@ setting for the @env{EDITOR} environment variable will always give you an editor, even if no Emacs server is running: + The option @samp{-q} or @samp{--quiet} causes @code{emacsclient} to +not display messages about waiting for Emacs or connecting to remote +server sockets. + @example EDITOR="emacsclient --alternate-editor emacs +%d %s" @end example Index: lib-src/emacsclient.c =================================================================== RCS file: /sources/emacs/emacs/lib-src/emacsclient.c,v retrieving revision 1.130 diff -u -r1.130 emacsclient.c --- lib-src/emacsclient.c 31 Jul 2008 05:33:38 -0000 1.130 +++ lib-src/emacsclient.c 6 Aug 2008 19:12:32 -0000 @@ -119,6 +119,9 @@ /* Nonzero means don't wait for a response from Emacs. --no-wait. */ int nowait = 0; +/* Nonzero means don't print messages for successful operations. --quiet. */ +int quiet = 0; + /* Nonzero means args are expressions to be evaluated. --eval. */ int eval = 0; @@ -152,6 +155,7 @@ struct option longopts[] = { { "no-wait", no_argument, NULL, 'n' }, + { "quiet", no_argument, NULL, 'q' }, { "eval", no_argument, NULL, 'e' }, { "help", no_argument, NULL, 'H' }, { "version", no_argument, NULL, 'V' }, @@ -476,9 +480,9 @@ { int opt = getopt_long (argc, argv, #ifndef NO_SOCKETS_IN_FILE_SYSTEM - "VHnea:s:f:d:tc", + "VHneqa:s:f:d:tc", #else - "VHnea:f:d:tc", + "VHneqa:f:d:tc", #endif longopts, 0); @@ -524,6 +528,10 @@ eval = 1; break; + case 'q': + quiet = 1; + break; + case 'V': message (FALSE, "emacsclient %s\n", VERSION); exit (EXIT_SUCCESS); @@ -606,6 +614,7 @@ use the current Emacs frame\n\ -e, --eval Evaluate the FILE arguments as ELisp expressions\n\ -n, --no-wait Don't wait for the server to return\n\ +-q, --quiet Don't display messages on success\n\ -d, --display=DISPLAY Visit the file in the given display\n" #ifndef NO_SOCKETS_IN_FILE_SYSTEM "-s, --socket-name=FILENAME\n\ @@ -950,7 +959,7 @@ if (! get_server_config (&server, auth_string)) return INVALID_SOCKET; - if (server.sin_addr.s_addr != inet_addr ("127.0.0.1")) + if (server.sin_addr.s_addr != inet_addr ("127.0.0.1") && !quiet) message (FALSE, "%s: connected to remote socket at %s\n", progname, inet_ntoa (server.sin_addr)); @@ -1549,7 +1558,7 @@ send_to_emacs (emacs_socket, "\n"); /* Wait for an answer. */ - if (!eval && !tty && !nowait) + if (!eval && !tty && !nowait && !quiet) { printf ("Waiting for Emacs..."); needlf = 2; --W/nzBZO5zC0uMSeA-- From unknown Sun Aug 17 04:18:07 2025 X-Loop: help-debbugs@gnu.org Subject: bug#663: Adding --quiet option to emacsclient References: <20080806224721.GA8325@drache.begriffli.ch> In-Reply-To: <20080806224721.GA8325@drache.begriffli.ch> Resent-From: Anders Kaseorg Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 01 Sep 2010 22:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 663 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 663@debbugs.gnu.org Received: via spool by 663-submit@debbugs.gnu.org id=B663.128338161821441 (code B ref 663); Wed, 01 Sep 2010 22:54:01 +0000 Received: (at 663) by debbugs.gnu.org; 1 Sep 2010 22:53:38 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OqwBW-0005Zm-Jx for submit@debbugs.gnu.org; Wed, 01 Sep 2010 18:53:38 -0400 Received: from dmz-mailsec-scanner-4.mit.edu ([18.9.25.15]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OquvH-00054I-Pl for 663@debbugs.gnu.org; Wed, 01 Sep 2010 17:32:48 -0400 X-AuditID: 1209190f-b7bf7ae00000628e-b7-4c7ec6e9c08c Received: from mailhub-auth-4.mit.edu ( [18.7.62.39]) by dmz-mailsec-scanner-4.mit.edu (Symantec Brightmail Gateway) with SMTP id 9B.BE.25230.9E6CE7C4; Wed, 1 Sep 2010 17:34:33 -0400 (EDT) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id o81LYTqx013389 for <663@debbugs.gnu.org>; Wed, 1 Sep 2010 17:34:29 -0400 Received: from localhost (LINERVA.MIT.EDU [18.181.0.232]) (authenticated bits=0) (User authenticated as andersk@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id o81LYRB5012742 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT) for <663@debbugs.gnu.org>; Wed, 1 Sep 2010 17:34:28 -0400 (EDT) Date: Wed, 1 Sep 2010 17:34:27 -0400 (EDT) From: Anders Kaseorg Message-ID: User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Brightmail-Tracker: AAAAAA== X-Spam-Score: -0.7 (/) X-Mailman-Approved-At: Wed, 01 Sep 2010 18:53:37 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.7 (-) This is important and should possibly be on by default, because the=20 =E2=80=9CWaiting for Emacs...=E2=80=9D message has bad interactions with ru= nning=20 emacsclient in the background (*): anders@balanced-tree:~$ emacsclient -c /tmp/foo & [1] 5759 anders@balanced-tree:~$ Waiting for Emacs... The newline isn=E2=80=99t printed until the frame closes, where it=E2=80=99= s likely to=20 interrupt my typing of another command. Anders (*) As recommended by the emacs(1) manpage: Using Emacs with X Emacs has been tailored to work well with the X window system. If = you run Emacs from under X windows, it will create its own X window to d= is=E2=80=90 play in. You will probably want to start the editor as a backgro= und process so that you can continue using your original window. From unknown Sun Aug 17 04:18:07 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Drake Wilson Subject: bug#663: closed (Re: Adding --quiet option to emacsclient) Message-ID: References: <20080806224721.GA8325@drache.begriffli.ch> X-Gnu-PR-Message: they-closed 663 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 663@debbugs.gnu.org Date: Thu, 03 Mar 2011 07:02:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1299135722-1598-1" This is a multi-part message in MIME format... ------------=_1299135722-1598-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #663: Adding --quiet option to emacsclient which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 663@debbugs.gnu.org. --=20 663: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D663 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1299135722-1598-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 663-done) by debbugs.gnu.org; 3 Mar 2011 07:01:28 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Pv2XQ-0000P3-7T for submit@debbugs.gnu.org; Thu, 03 Mar 2011 02:01:28 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Pv2XO-0000Os-Ko for 663-done@debbugs.gnu.org; Thu, 03 Mar 2011 02:01:27 -0500 Received: from localhost ([127.0.0.1]:46906) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pv2XJ-0007gk-4g; Thu, 03 Mar 2011 02:01:21 -0500 From: Glenn Morris To: 663-done@debbugs.gnu.org Subject: Re: Adding --quiet option to emacsclient References: X-Spook: JPL Adriatic InfoSec Al Jazeera high security TELINT ISEC X-Ran: ]L)PzM|IN^K (Anders Kaseorg's message of "Wed, 1 Sep 2010 17:34:27 -0400 (EDT)") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -6.3 (------) X-Debbugs-Envelope-To: 663-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) Version: 24.1 Thank you for the patch. Sorry about the looong delay. This will be in 24.1. ------------=_1299135722-1598-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit >From drake@begriffli.ch Wed Aug 6 16:07:29 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-7.9 required=4.0 tests=BAYES_00,FOURLA, FVGT_m_MULTI_ODD,MURPHY_DRUGS_REL8,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 6 Aug 2008 23:07:29 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m76N7PdH012940 for ; Wed, 6 Aug 2008 16:07:26 -0700 Received: from mail.gnu.org ([199.232.76.166]:55649 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1KQs5F-0003V6-WB for emacs-pretest-bug@gnu.org; Wed, 06 Aug 2008 19:06:22 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1KQs6E-0003AT-Dy for emacs-pretest-bug@gnu.org; Wed, 06 Aug 2008 19:07:24 -0400 Received: from adsl-75-55-112-14.dsl.austtx.sbcglobal.net ([75.55.112.14]:50795 helo=zwischenschaltung.begriffli.ch) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KQs6D-0003A5-Uo for emacs-pretest-bug@gnu.org; Wed, 06 Aug 2008 19:07:22 -0400 Received: from drache.begriffli.ch (drache [192.168.2.1]) by zwischenschaltung.begriffli.ch (Postfix) with ESMTP id 60DF527589; Wed, 6 Aug 2008 17:47:16 -0500 (CDT) Received: from drake by drache.begriffli.ch with local (Exim 4.69) (envelope-from ) id 1KQrmr-0002Ap-Ul; Wed, 06 Aug 2008 17:47:21 -0500 Date: Wed, 6 Aug 2008 17:47:21 -0500 From: Drake Wilson To: emacs-pretest-bug@gnu.org Cc: Chong Yidong , emacs-devel@gnu.org Subject: Re: Adding --quiet option to emacsclient Message-ID: <20080806224721.GA8325@drache.begriffli.ch> Mail-Followup-To: emacs-pretest-bug@gnu.org, Chong Yidong , emacs-devel@gnu.org References: <20080806210838.GA2655@drache.begriffli.ch> <874p5xdbb8.fsf@stupidchicken.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="W/nzBZO5zC0uMSeA" Content-Disposition: inline In-Reply-To: <874p5xdbb8.fsf@stupidchicken.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-Greylist: delayed 1203 seconds by postgrey-1.27 at monty-python; Wed, 06 Aug 2008 19:07:21 EDT --W/nzBZO5zC0uMSeA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Quoth Chong Yidong , on 2008-08-06 18:32:27 -0400: > > In the Debian BTS wishlist ticket #490253, I requested a --quiet > > option for emacsclient; currently, it prints a "Waiting for Emacs..." > > message that cannot be turned off, which I found annoying. I have > > updated the patch I provided in that report to apply against the CVS > > version of Emacs; it would be nice if this feature could make it into > > Emacs 23. > > Emacs 23 is in feature freeze. Could you please send your patch to > emacs-pretest-bug@gnu.org, so that it is entered in our bug tracker? > Then after the release, we'll see if this can be included. Thanks. Very well. Forwarding now. Hello, emacs-pretest-bug. (Also re-cc'ing emacs-devel, since I think my actual diff got eaten somewhere along the way; probably I just miscommanded my mailer.) ---> Drake Wilson --W/nzBZO5zC0uMSeA Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="emacs22-emacsclient-quiet-option-2.diff" Index: doc/emacs/misc.texi =================================================================== RCS file: /sources/emacs/emacs/doc/emacs/misc.texi,v retrieving revision 1.6 diff -u -r1.6 misc.texi --- doc/emacs/misc.texi 13 Jun 2008 08:06:41 -0000 1.6 +++ doc/emacs/misc.texi 6 Aug 2008 19:12:31 -0000 @@ -1412,6 +1412,10 @@ setting for the @env{EDITOR} environment variable will always give you an editor, even if no Emacs server is running: + The option @samp{-q} or @samp{--quiet} causes @code{emacsclient} to +not display messages about waiting for Emacs or connecting to remote +server sockets. + @example EDITOR="emacsclient --alternate-editor emacs +%d %s" @end example Index: lib-src/emacsclient.c =================================================================== RCS file: /sources/emacs/emacs/lib-src/emacsclient.c,v retrieving revision 1.130 diff -u -r1.130 emacsclient.c --- lib-src/emacsclient.c 31 Jul 2008 05:33:38 -0000 1.130 +++ lib-src/emacsclient.c 6 Aug 2008 19:12:32 -0000 @@ -119,6 +119,9 @@ /* Nonzero means don't wait for a response from Emacs. --no-wait. */ int nowait = 0; +/* Nonzero means don't print messages for successful operations. --quiet. */ +int quiet = 0; + /* Nonzero means args are expressions to be evaluated. --eval. */ int eval = 0; @@ -152,6 +155,7 @@ struct option longopts[] = { { "no-wait", no_argument, NULL, 'n' }, + { "quiet", no_argument, NULL, 'q' }, { "eval", no_argument, NULL, 'e' }, { "help", no_argument, NULL, 'H' }, { "version", no_argument, NULL, 'V' }, @@ -476,9 +480,9 @@ { int opt = getopt_long (argc, argv, #ifndef NO_SOCKETS_IN_FILE_SYSTEM - "VHnea:s:f:d:tc", + "VHneqa:s:f:d:tc", #else - "VHnea:f:d:tc", + "VHneqa:f:d:tc", #endif longopts, 0); @@ -524,6 +528,10 @@ eval = 1; break; + case 'q': + quiet = 1; + break; + case 'V': message (FALSE, "emacsclient %s\n", VERSION); exit (EXIT_SUCCESS); @@ -606,6 +614,7 @@ use the current Emacs frame\n\ -e, --eval Evaluate the FILE arguments as ELisp expressions\n\ -n, --no-wait Don't wait for the server to return\n\ +-q, --quiet Don't display messages on success\n\ -d, --display=DISPLAY Visit the file in the given display\n" #ifndef NO_SOCKETS_IN_FILE_SYSTEM "-s, --socket-name=FILENAME\n\ @@ -950,7 +959,7 @@ if (! get_server_config (&server, auth_string)) return INVALID_SOCKET; - if (server.sin_addr.s_addr != inet_addr ("127.0.0.1")) + if (server.sin_addr.s_addr != inet_addr ("127.0.0.1") && !quiet) message (FALSE, "%s: connected to remote socket at %s\n", progname, inet_ntoa (server.sin_addr)); @@ -1549,7 +1558,7 @@ send_to_emacs (emacs_socket, "\n"); /* Wait for an answer. */ - if (!eval && !tty && !nowait) + if (!eval && !tty && !nowait && !quiet) { printf ("Waiting for Emacs..."); needlf = 2; --W/nzBZO5zC0uMSeA-- ------------=_1299135722-1598-1--