Package: emacs22-bin-common
Version: 22.2+2-2
Severity: wishlist
File: /usr/bin/emacsclient.emacs22
Tags: patch

I see that while gnuclient was silent on success, emacsclient prints a
"Waiting for Emacs..." message.  I realize this might be useful in
some cases, but it seems irritating.  A patch is attached to add a
--quiet option.

   ---> Drake Wilson

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (990, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.24.2 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages emacs22-bin-common depends on:
ii  emacs22-common                22.2+2-2   The GNU Emacs editor's shared, arc
ii  libc6                         2.7-12     GNU C Library: Shared libraries
ii  liblockfile1                  1.07-1     NFS-safe locking library, includes

emacs22-bin-common recommends no packages.

-- no debconf information
--- emacs22-22.2+2/lib-src/emacsclient.c	2008-01-10 06:15:30.000000000 -0600
+++ emacs22-new/lib-src/emacsclient.c	2008-07-10 18:34:17.000000000 -0500
@@ -121,6 +121,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;
 
@@ -145,6 +148,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' },
@@ -323,9 +327,9 @@
     {
       int opt = getopt_long (argc, argv,
 #ifndef NO_SOCKETS_IN_FILE_SYSTEM
-			     "VHnea:s:f:d:",
+			     "VHneqa:s:f:d:",
 #else
-                             "VHnea:f:d:",
+                             "VHneqa:f:d:",
 #endif
                              longopts, 0);
 
@@ -361,6 +365,10 @@
 	  nowait = 1;
 	  break;
 
+	case 'q':
+	  quiet = 1;
+	  break;
+
 	case 'e':
 	  eval = 1;
 	  break;
@@ -396,6 +404,7 @@
 -H, --help   		Print this usage information message\n\
 -e, --eval   		Evaluate FILE arguments as Lisp 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\
@@ -769,9 +778,9 @@
   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));
+	     progname, inet_ntoa (server.sin_addr));
 
   /*
    * Open up an AF_INET socket
@@ -1170,7 +1179,7 @@
   /* Maybe wait for an answer.   */
   if (!nowait)
     {
-      if (!eval)
+      if (!eval && !quiet)
         {
           printf ("Waiting for Emacs...");
           needlf = 2;
--- emacs22-22.2+2/etc/emacsclient.1	2006-11-22 10:37:23.000000000 -0600
+++ emacs22-new/etc/emacsclient.1	2008-07-10 17:20:45.000000000 -0500
@@ -52,6 +52,9 @@
 returns
 immediately without waiting for you to "finish" the buffer in Emacs.
 .TP
+.B \-q, \-\-quiet
+do not display messages for successful editing operations.
+.TP
 .B \-e, \-\-eval
 do not visit files but instead evaluate the arguments as Emacs
 Lisp expressions.

Reply via email to