From: Michael Mauger <mmaug@yahoo.com>
Subject: emacsclient: --quiet/--verbose
Date: Wed, 29 Nov 2006 21:34:11 -0800 (PST) [thread overview]
Message-ID: <20061130053411.89278.qmail@web62514.mail.re1.yahoo.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 490 bytes --]
As I've moved over to emacsclient from gnuclient, I've found a couple of areas where it's behavior is awkward, although not wrong per se.
This patch adds:
* a --quiet option to suppress informational messages from emacsclient
* In emacsclientw, defaults to --quiet and --no-wait
* adds --wait and --verbose options to override the defaults in emacsclientw
If it's deemed to be too late in pretest for these that's fine, but this is a small change and leads to better interaction.
[-- Attachment #2: ec-quiet.diff --]
[-- Type: text/plain, Size: 3493 bytes --]
Index: emacs/lib-src/emacsclient.c
===================================================================
RCS file: /cvsroot/emacs/emacs/lib-src/emacsclient.c,v
retrieving revision 1.96
diff -c -r1.96 emacsclient.c
*** emacs/lib-src/emacsclient.c 25 Nov 2006 00:32:40 -0000 1.96
--- emacs/lib-src/emacsclient.c 30 Nov 2006 04:50:55 -0000
***************
*** 113,118 ****
--- 113,121 ----
/* Nonzero means don't wait for a response from Emacs. --no-wait. */
int nowait = 0;
+ /* Nonzero means don't display informational messages. --quiet. */
+ int quiet = 0;
+
/* Nonzero means args are expressions to be evaluated. --eval. */
int eval = 0;
***************
*** 134,139 ****
--- 137,145 ----
struct option longopts[] =
{
{ "no-wait", no_argument, NULL, 'n' },
+ { "wait", no_argument, NULL, 'w' },
+ { "quiet", no_argument, NULL, 'q' },
+ { "verbose", no_argument, NULL, 'v' },
{ "eval", no_argument, NULL, 'e' },
{ "help", no_argument, NULL, 'H' },
{ "version", no_argument, NULL, 'V' },
***************
*** 172,177 ****
--- 178,185 ----
char *msg = buf;
va_list args;
+ if (!is_error && quiet) return;
+
va_start (args, message);
if (is_error)
***************
*** 206,218 ****
{
alternate_editor = getenv ("ALTERNATE_EDITOR");
while (1)
{
int opt = getopt_long (argc, argv,
#ifndef NO_SOCKETS_IN_FILE_SYSTEM
! "VHnea:s:f:d:",
#else
! "VHnea:f:d:",
#endif
longopts, 0);
--- 214,234 ----
{
alternate_editor = getenv ("ALTERNATE_EDITOR");
+ #ifdef WINDOWSNT
+ if (w32_window_app ())
+ {
+ nowait = 1;
+ quiet = 1;
+ }
+ #endif
+
while (1)
{
int opt = getopt_long (argc, argv,
#ifndef NO_SOCKETS_IN_FILE_SYSTEM
! "VHqvwnea:s:f:d:",
#else
! "VHqvwnea:f:d:",
#endif
longopts, 0);
***************
*** 248,258 ****
--- 264,287 ----
nowait = 1;
break;
+ case 'w':
+ nowait = 0;
+ break;
+
+ case 'q':
+ quiet = 1;
+ break;
+
+ case 'v':
+ quiet = 0;
+ break;
+
case 'e':
eval = 1;
break;
case 'V':
+ quiet = 0;
message (FALSE, "emacsclient %s\n", VERSION);
exit (EXIT_SUCCESS);
break;
***************
*** 272,277 ****
--- 301,307 ----
void
print_help_and_exit ()
{
+ quiet = 0;
message (FALSE,
"Usage: %s [OPTIONS] FILE...\n\
Tell the Emacs server to visit the specified files.\n\
***************
*** 281,287 ****
--- 311,320 ----
\n\
-V, --version Just print version info and return\n\
-H, --help Print this usage information message\n\
+ -q, --quiet Do not display informational messages\n\
+ -v, --verbose Display informational messages\n\
-e, --eval Evaluate FILE arguments as Lisp expressions\n\
+ -w, --wait Wait for the server to return\n\
-n, --no-wait Don't wait for the server to return\n\
-d, --display=DISPLAY Visit the file in the given display\n"
#ifndef NO_SOCKETS_IN_FILE_SYSTEM
***************
*** 928,934 ****
/* Maybe wait for an answer. */
if (!nowait)
{
! if (!eval)
{
printf ("Waiting for Emacs...");
needlf = 2;
--- 961,967 ----
/* Maybe wait for an answer. */
if (!nowait)
{
! if (!eval && !quiet)
{
printf ("Waiting for Emacs...");
needlf = 2;
[-- Attachment #3: Type: text/plain, Size: 142 bytes --]
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel
next reply other threads:[~2006-11-30 5:34 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-30 5:34 Michael Mauger [this message]
2006-11-30 22:59 ` emacsclient: --quiet/--verbose Juanma Barranquero
2006-11-30 23:20 ` Lennart Borgman
2006-12-01 10:12 ` Eli Zaretskii
2006-12-01 0:47 ` Michael Mauger
2006-12-01 1:10 ` Juanma Barranquero
2006-12-01 3:39 ` Michael Mauger
2006-12-02 19:03 ` Lennart Borgman
2006-12-01 9:12 ` Jason Rumney
2006-12-01 13:37 ` Richard Stallman
-- strict thread matches above, loose matches on Subject: below --
2006-12-02 22:02 Michael Mauger
2006-12-03 12:25 ` Lennart Borgman
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=20061130053411.89278.qmail@web62514.mail.re1.yahoo.com \
--to=mmaug@yahoo.com \
/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).