* bug#663: Adding --quiet option to emacsclient
2008-08-06 22:32 ` Chong Yidong
@ 2008-08-06 22:47 ` Drake Wilson
2008-08-06 22:47 ` Drake Wilson
1 sibling, 0 replies; 6+ messages in thread
From: Drake Wilson @ 2008-08-06 22:47 UTC (permalink / raw
To: emacs-pretest-bug; +Cc: Chong Yidong, emacs-devel
[-- 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;
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Adding --quiet option to emacsclient
2008-08-06 22:32 ` Chong Yidong
2008-08-06 22:47 ` bug#663: " Drake Wilson
@ 2008-08-06 22:47 ` Drake Wilson
2010-09-01 21:34 ` bug#663: " Anders Kaseorg
1 sibling, 1 reply; 6+ messages in thread
From: Drake Wilson @ 2008-08-06 22:47 UTC (permalink / raw
To: emacs-pretest-bug; +Cc: Chong Yidong, emacs-devel
[-- 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;
^ permalink raw reply [flat|nested] 6+ messages in thread