unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Drake Wilson <drake@begriffli.ch>
To: emacs-pretest-bug@gnu.org
Cc: Chong Yidong <cyd@stupidchicken.com>, emacs-devel@gnu.org
Subject: Re: Adding --quiet option to emacsclient
Date: Wed, 6 Aug 2008 17:47:21 -0500	[thread overview]
Message-ID: <20080806224721.GA8325@drache.begriffli.ch> (raw)
In-Reply-To: <874p5xdbb8.fsf@stupidchicken.com>

[-- Attachment #1: Type: text/plain, Size: 876 bytes --]

Quoth Chong Yidong <cyd@stupidchicken.com>, 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

[-- Attachment #2: emacs22-emacsclient-quiet-option-2.diff --]
[-- Type: text/x-diff, Size: 2946 bytes --]

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;

      reply	other threads:[~2008-08-06 22:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-06 21:08 Bug#490253: Adding --quiet option to emacsclient Drake Wilson
2008-08-06 22:32 ` Chong Yidong
2008-08-06 22:47   ` Drake Wilson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080806224721.GA8325@drache.begriffli.ch \
    --to=drake@begriffli.ch \
    --cc=cyd@stupidchicken.com \
    --cc=emacs-devel@gnu.org \
    --cc=emacs-pretest-bug@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).