* Bug#490253: Adding --quiet option to emacsclient
@ 2008-08-06 21:08 Drake Wilson
2008-08-06 22:32 ` Chong Yidong
0 siblings, 1 reply; 6+ messages in thread
From: Drake Wilson @ 2008-08-06 21:08 UTC (permalink / raw)
To: emacs-devel; +Cc: 490253
Hello, emacs-devel!
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.
CVS-based unified diff is attached. Comments would be appreciated.
---> Drake Wilson
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Adding --quiet option to emacsclient
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
2008-08-06 22:47 ` Drake Wilson
0 siblings, 2 replies; 6+ messages in thread
From: Chong Yidong @ 2008-08-06 22:32 UTC (permalink / raw)
To: Drake Wilson; +Cc: emacs-devel
> 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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* 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 ` Drake Wilson
2010-09-01 21:34 ` bug#663: " Anders Kaseorg
2008-08-06 22:47 ` Drake Wilson
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
* bug#663: Adding --quiet option to emacsclient
2008-08-06 22:47 ` Drake Wilson
@ 2010-09-01 21:34 ` Anders Kaseorg
2011-03-03 7:01 ` Glenn Morris
0 siblings, 1 reply; 6+ messages in thread
From: Anders Kaseorg @ 2010-09-01 21:34 UTC (permalink / raw)
To: 663
This is important and should possibly be on by default, because the
“Waiting for Emacs...” message has bad interactions with running
emacsclient in the background (*):
anders@balanced-tree:~$ emacsclient -c /tmp/foo &
[1] 5759
anders@balanced-tree:~$ Waiting for Emacs...<cursor ends up here>
The newline isn’t printed until the frame closes, where it’s likely to
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 dis‐
play in. You will probably want to start the editor as a background
process so that you can continue using your original window.
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#663: Adding --quiet option to emacsclient
2010-09-01 21:34 ` bug#663: " Anders Kaseorg
@ 2011-03-03 7:01 ` Glenn Morris
0 siblings, 0 replies; 6+ messages in thread
From: Glenn Morris @ 2011-03-03 7:01 UTC (permalink / raw)
To: 663-done
Version: 24.1
Thank you for the patch. Sorry about the looong delay. This will be in 24.1.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-03-03 7:01 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2010-09-01 21:34 ` bug#663: " Anders Kaseorg
2011-03-03 7:01 ` Glenn Morris
2008-08-06 22:47 ` Drake Wilson
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.