[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacsclient --help output

From: Tom Tromey
Subject: emacsclient --help output
Date: 11 Mar 2003 14:33:49 -0700

This bug report will be sent to the Free Software Foundation,
not to your local site managers!
Please write in English, because the Emacs maintainers do not have
translators to read other languages for them.

Your bug report will be posted to the address@hidden mailing list,
and to the gnu.emacs.bug news group.

In GNU Emacs 21.2.1 (i386-redhat-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2002-04-08 on porky.devel.redhat.com
configured using `configure  i386-redhat-linux --prefix=/usr --exec-prefix=/usr 
--bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share 
--includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/libexec 
--localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man 
--infodir=/usr/share/info --with-gcc --with-pop --with-sound'
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.iso885915
  locale-coding-system: iso-latin-9
  default-enable-multibyte-characters: nil

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

The appended patch cleans up emacsclient --help (and other) output in
a few ways.

* According to GNU coding standards, --help should print to stdout and
  exit successfully.  Likewise --version.

* It is a bit more typical not to print full --help output in response
  to an error.

* It is a little easier to read (and more typical among GNU programs
  in my experience) the --help output if there are a couple blank

Recent input:
C-n C-p C-p C-p C-e C-b C-n C-a C-o \ n \ C-x C-s C-u 
C-n C-u C-n C-n C-a C-o \ n \ C-x C-s C-c a C-a C-k 
C-k C-u C-p C-n C-e SPC SPC A d d e d SPC s o m e SPC 
v e r t i c a <M-backspace> b l a n k SPC l i n e s 
SPC f o r SPC r e a d a b i l i t y . C-x C-s C-x s 
M-x r e p o r t - e m <tab> <return>

Recent messages:
Saving file /home/tromey/private_html/todo.html...
Wrote /home/tromey/private_html/todo.html
Mark saved where search started
Wrote /home/tromey/gnu/Emacs/emacs/lib-src/emacsclient.c [2 times]
Mark saved where search started [2 times]
Wrote /home/tromey/gnu/Emacs/emacs/lib-src/emacsclient.c [2 times]
Saving file /home/tromey/gnu/Emacs/emacs/lib-src/ChangeLog...
Wrote /home/tromey/gnu/Emacs/emacs/lib-src/ChangeLog
(No files need saving)
Loading emacsbug...done


2003-03-11  Tom Tromey  <address@hidden>

        * emacsclient.c (print_help_and_exit): Print to stdout.  Exit
        successfully.  Added some blank lines for readability.
        (decode_options): Don't call print_help_and_exit in default case.
        Print version information to stdout.
        (main): Don't call print_help_and_exit.

Index: emacsclient.c
RCS file: /cvsroot/emacs/emacs/lib-src/emacsclient.c,v
retrieving revision 1.56
diff -u -r1.56 emacsclient.c
--- emacsclient.c       2 Dec 2002 20:57:42 -0000       1.56
+++ emacsclient.c       11 Mar 2003 21:37:42 -0000
@@ -1,5 +1,5 @@
 /* Client process that communicates with GNU Emacs acting as server.
-   Copyright (C) 1986, 1987, 1994, 1999, 2000, 2001
+   Copyright (C) 1986, 1987, 1994, 1999, 2000, 2001, 2003
    Free Software Foundation, Inc.
 This file is part of GNU Emacs.
@@ -122,13 +122,18 @@
        case 'V':
-         fprintf (stderr, "emacsclient %s\n", VERSION);
-         exit (1);
+         printf ("emacsclient %s\n", VERSION);
+         exit (0);
        case 'H':
-       default:
          print_help_and_exit ();
+         break;
+       default:
+         fprintf (stderr, "Try `%s --help' for more information\n", progname);
+         exit (1);
+         break;
@@ -136,10 +141,11 @@
 print_help_and_exit ()
-  fprintf (stderr,
-          "Usage: %s [OPTIONS] FILE...\n\
+  printf (
+         "Usage: %s [OPTIONS] FILE...\n\
 Tell the Emacs server to visit the specified files.\n\
 Every FILE can be either just a FILENAME or [+LINE[:COLUMN]] FILENAME.\n\
 The following OPTIONS are accepted:\n\
 -V, --version           Just print a version info and return\n\
 -H, --help              Print this usage information message\n\
@@ -148,8 +154,9 @@
 -d, --display=DISPLAY   Visit the file in the given display\n\
 -a, --alternate-editor=EDITOR\n\
                         Editor to fallback to if the server is not running\n\
 Report bugs to address@hidden", progname);
-  exit (1);
+  exit (0);
 /* Return a copy of NAME, inserting a &
@@ -294,7 +301,11 @@
   decode_options (argc, argv);
   if (argc - optind < 1)
-    print_help_and_exit ();
+    {
+      fprintf (stderr, "%s: file name or argument required\n", progname);
+      fprintf (stderr, "Try `%s --help' for more information\n", progname);
+      exit (1);
+    }
    * Open up an AF_UNIX socket in this person's home directory

reply via email to

[Prev in Thread] Current Thread [Next in Thread]