From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drake Wilson Newsgroups: gmane.emacs.devel,gmane.emacs.pretest.bugs Subject: Re: Adding --quiet option to emacsclient Followup-To: gmane.emacs.pretest.bugs Date: Wed, 6 Aug 2008 17:47:21 -0500 Message-ID: <20080806224721.GA8325@drache.begriffli.ch> References: <20080806210838.GA2655@drache.begriffli.ch> <874p5xdbb8.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="W/nzBZO5zC0uMSeA" X-Trace: ger.gmane.org 1218062853 584 80.91.229.12 (6 Aug 2008 22:47:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 6 Aug 2008 22:47:33 +0000 (UTC) Cc: Chong Yidong , emacs-devel@gnu.org To: emacs-pretest-bug@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Aug 07 00:48:23 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KQrnq-0001Pg-5Z for ged-emacs-devel@m.gmane.org; Thu, 07 Aug 2008 00:48:22 +0200 Original-Received: from localhost ([127.0.0.1]:38988 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KQrmu-0008Jm-El for ged-emacs-devel@m.gmane.org; Wed, 06 Aug 2008 18:47:24 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KQrmp-0008Gp-4Y for emacs-devel@gnu.org; Wed, 06 Aug 2008 18:47:19 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KQrmo-0008G4-If for emacs-devel@gnu.org; Wed, 06 Aug 2008 18:47:18 -0400 Original-Received: from [199.232.76.173] (port=39318 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KQrmo-0008G1-CA for emacs-devel@gnu.org; Wed, 06 Aug 2008 18:47:18 -0400 Original-Received: from adsl-75-55-112-14.dsl.austtx.sbcglobal.net ([75.55.112.14]:43537 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 1KQrmo-0007MB-4T for emacs-devel@gnu.org; Wed, 06 Aug 2008 18:47:18 -0400 Original-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) Original-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 Mail-Followup-To: emacs-pretest-bug@gnu.org, Chong Yidong , emacs-devel@gnu.org 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-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:102137 gmane.emacs.pretest.bugs:22798 Archived-At: --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--