aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorDrake Wilson2011-03-02 23:00:23 -0800
committerGlenn Morris2011-03-02 23:00:23 -0800
commit0b973fc594aa04c4a22aa1aee7bc8b5c4f74c93f (patch)
tree23d0a55326d7bfb257d72757ee726a1d636911ba /lib-src
parenta915d7a1e55a887ff5bd628369ca9f2c3b2fa367 (diff)
downloademacs-0b973fc594aa04c4a22aa1aee7bc8b5c4f74c93f.tar.gz
emacs-0b973fc594aa04c4a22aa1aee7bc8b5c4f74c93f.zip
Add --quiet option for emacsclient (bug#663) (tiny change)
* lib-src/emacsclient.c (longopts): Add quiet. (decode_options): Handle q/quiet. (print_help_and_exit): Add q/quiet. (main): Suppress some messages if quiet option is used. * doc/emacs/misc.texi (emacsclient Options): Add q/quiet.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/ChangeLog7
-rw-r--r--lib-src/emacsclient.c17
2 files changed, 20 insertions, 4 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index f54ad384b13..4b50b2dddeb 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,10 @@
12011-03-03 Drake Wilson <drake@begriffli.ch> (tiny change)
2
3 * emacsclient.c (longopts): Add quiet.
4 (decode_options): Handle q/quiet.
5 (print_help_and_exit): Add q/quiet.
6 (main): Suppress some messages if quiet option is used.
7
12011-02-26 Eli Zaretskii <eliz@gnu.org> 82011-02-26 Eli Zaretskii <eliz@gnu.org>
2 9
3 * Makefile.in (fakemail${EXEEXT}): Depend on lib/ignore-value.h. 10 * Makefile.in (fakemail${EXEEXT}): Depend on lib/ignore-value.h.
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index 836891ae6aa..abc9aee37c1 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -129,6 +129,9 @@ char **main_argv;
129/* Nonzero means don't wait for a response from Emacs. --no-wait. */ 129/* Nonzero means don't wait for a response from Emacs. --no-wait. */
130int nowait = 0; 130int nowait = 0;
131 131
132/* Nonzero means don't print messages for successful operations. --quiet. */
133int quiet = 0;
134
132/* Nonzero means args are expressions to be evaluated. --eval. */ 135/* Nonzero means args are expressions to be evaluated. --eval. */
133int eval = 0; 136int eval = 0;
134 137
@@ -164,6 +167,7 @@ static void fail (void) NO_RETURN;
164struct option longopts[] = 167struct option longopts[] =
165{ 168{
166 { "no-wait", no_argument, NULL, 'n' }, 169 { "no-wait", no_argument, NULL, 'n' },
170 { "quiet", no_argument, NULL, 'q' },
167 { "eval", no_argument, NULL, 'e' }, 171 { "eval", no_argument, NULL, 'e' },
168 { "help", no_argument, NULL, 'H' }, 172 { "help", no_argument, NULL, 'H' },
169 { "version", no_argument, NULL, 'V' }, 173 { "version", no_argument, NULL, 'V' },
@@ -523,9 +527,9 @@ decode_options (int argc, char **argv)
523 { 527 {
524 int opt = getopt_long_only (argc, argv, 528 int opt = getopt_long_only (argc, argv,
525#ifndef NO_SOCKETS_IN_FILE_SYSTEM 529#ifndef NO_SOCKETS_IN_FILE_SYSTEM
526 "VHnea:s:f:d:tc", 530 "VHneqa:s:f:d:tc",
527#else 531#else
528 "VHnea:f:d:tc", 532 "VHneqa:f:d:tc",
529#endif 533#endif
530 longopts, 0); 534 longopts, 0);
531 535
@@ -569,6 +573,10 @@ decode_options (int argc, char **argv)
569 eval = 1; 573 eval = 1;
570 break; 574 break;
571 575
576 case 'q':
577 quiet = 1;
578 break;
579
572 case 'V': 580 case 'V':
573 message (FALSE, "emacsclient %s\n", VERSION); 581 message (FALSE, "emacsclient %s\n", VERSION);
574 exit (EXIT_SUCCESS); 582 exit (EXIT_SUCCESS);
@@ -660,6 +668,7 @@ The following OPTIONS are accepted:\n\
660 use the current Emacs frame\n\ 668 use the current Emacs frame\n\
661-e, --eval Evaluate the FILE arguments as ELisp expressions\n\ 669-e, --eval Evaluate the FILE arguments as ELisp expressions\n\
662-n, --no-wait Don't wait for the server to return\n\ 670-n, --no-wait Don't wait for the server to return\n\
671-q, --quiet Don't display messages on success\n\
663-d DISPLAY, --display=DISPLAY\n\ 672-d DISPLAY, --display=DISPLAY\n\
664 Visit the file in the given display\n\ 673 Visit the file in the given display\n\
665--parent-id=ID Open in parent window ID, via XEmbed\n" 674--parent-id=ID Open in parent window ID, via XEmbed\n"
@@ -986,7 +995,7 @@ set_tcp_socket (void)
986 if (! get_server_config (&server, auth_string)) 995 if (! get_server_config (&server, auth_string))
987 return INVALID_SOCKET; 996 return INVALID_SOCKET;
988 997
989 if (server.sin_addr.s_addr != inet_addr ("127.0.0.1")) 998 if (server.sin_addr.s_addr != inet_addr ("127.0.0.1") && !quiet)
990 message (FALSE, "%s: connected to remote socket at %s\n", 999 message (FALSE, "%s: connected to remote socket at %s\n",
991 progname, inet_ntoa (server.sin_addr)); 1000 progname, inet_ntoa (server.sin_addr));
992 1001
@@ -1712,7 +1721,7 @@ main (int argc, char **argv)
1712 send_to_emacs (emacs_socket, "\n"); 1721 send_to_emacs (emacs_socket, "\n");
1713 1722
1714 /* Wait for an answer. */ 1723 /* Wait for an answer. */
1715 if (!eval && !tty && !nowait) 1724 if (!eval && !tty && !nowait && !quiet)
1716 { 1725 {
1717 printf ("Waiting for Emacs..."); 1726 printf ("Waiting for Emacs...");
1718 needlf = 2; 1727 needlf = 2;