emacs-devel
[Top][All Lists]
Advanced

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

implement "emacsclient -nw"


From: Dan Nicolaescu
Subject: implement "emacsclient -nw"
Date: Sun, 07 Sep 2008 03:55:48 -0700

One of the TODO items for emacsclient is to accept `-nw' as a synonym to `-t' 
for consistency with emacs, which uses `-nw'.

The patch below does that.  It has the drawback that it also accepts
`--nw', but that does not seem to be a big deal.

Can someone that is familiar with getopt say if this patch is an
acceptable solution?  I'll update the docs if this patch gets checked in.

--- emacsclient.c.~1.130.~      2008-07-31 00:46:04.000000000 -0700
+++ emacsclient.c       2008-09-07 03:35:36.000000000 -0700
@@ -156,6 +156,7 @@ struct option longopts[] =
   { "help",    no_argument,       NULL, 'H' },
   { "version", no_argument,       NULL, 'V' },
   { "tty",     no_argument,       NULL, 't' },
+  { "nw",      no_argument,       NULL, 't' },
   { "create-frame", no_argument,   NULL, 'c' },
   { "alternate-editor", required_argument, NULL, 'a' },
 #ifndef NO_SOCKETS_IN_FILE_SYSTEM
@@ -474,7 +475,7 @@ decode_options (argc, argv)
 
   while (1)
     {
-      int opt = getopt_long (argc, argv,
+      int opt = getopt_long_only (argc, argv,
 #ifndef NO_SOCKETS_IN_FILE_SYSTEM
                             "VHnea:s:f:d:tc",
 #else
@@ -601,7 +602,7 @@ Every FILE can be either just a FILENAME
 The following OPTIONS are accepted:\n\
 -V, --version          Just print version info and return\n\
 -H, --help             Print this usage information message\n\
--t, --tty              Open a new Emacs frame on the current terminal\n\
+-nw, -t, --tty                 Open a new Emacs frame on the current 
terminal\n\
 -c, --create-frame     Create a new frame instead of trying to\n\
                        use the current Emacs frame\n\
 -e, --eval             Evaluate the FILE arguments as ELisp expressions\n\




reply via email to

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