changeset 84667:f2c11a35b0e3

(current_frame): Change the default. (longopts): Replace --current-frame by --create-frame. (decode_options): Reverse the meaning of -c. (print_help_and_exit): Update help text accordingly. (main): Remove the -version and -good-version messages.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Thu, 20 Sep 2007 01:11:57 +0000
parents 5470b7f77216
children 143bf32d4d58
files lib-src/ChangeLog lib-src/emacsclient.c
diffstat 2 files changed, 27 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/lib-src/ChangeLog	Wed Sep 19 20:50:40 2007 +0000
+++ b/lib-src/ChangeLog	Thu Sep 20 01:11:57 2007 +0000
@@ -1,3 +1,11 @@
+2007-09-20  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* emacsclient.c (current_frame): Change the default.
+	(longopts): Replace --current-frame by --create-frame.
+	(decode_options): Reverse the meaning of -c.
+	(print_help_and_exit): Update help text accordingly.
+	(main): Remove the -version and -good-version messages.
+
 2007-09-12  Glenn Morris  <rgm@gnu.org>
 
 	* Makefile.in (SOURCES, unlock, relock): Delete.
@@ -13,8 +21,7 @@
 
 2007-08-29  Jason Rumney  <jasonr@gnu.org>
 
-	* emacsclient.c (SEND_STRING, SEND_QUOTED): Remove obfuscation
-	macros.
+	* emacsclient.c (SEND_STRING, SEND_QUOTED): Remove obfuscation macros.
 	(quote_argument, set_tcp_socket, handle_sigcont, handle_sigtstp):
 	(main): Expand removed macros inline.
 	(main) [WINDOWSNT]: Don't call ttyname.  Don't recognize -suspend
@@ -25,10 +32,9 @@
 
 	* emacsclient.c (signal.h): New include.
 	(sys/stat.h, errno.h): Always include, even on WINDOWSNT.
-	(DIRECTORY_SEP, IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP): Copy
-	definitions here from src/lisp.h.
-	(main_argc, main_argv, current_frame, window_system, tty): New
-	variables.
+	(DIRECTORY_SEP, IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
+	Copy definitions here from src/lisp.h.
+	(main_argc, main_argv, current_frame, window_system, tty): New vars.
 	(longopts): Add tty, current-frame.
 	(xmalloc, xstrdup): New functions.
 	(get_current_dir_name): New function, copied from src/sysdep.c.
@@ -54,10 +60,10 @@
 	verification.  If tty is set, check TERM, and pass name and type
 	to Emacs.  Pass window_system to Emacs.  Move sending of eval to
 	optind loop.  Send -position, -file to Emacs.  Call fsync after
-	fflush.  Check for a client/server version match. Handle
-	-emacs-pid, -window-system-unsupported, -print, -error, -suspend
-	commands.  Don't exit prematurely on --no-wait, let Emacs close
-	the connection for us.  When creating a new frame, send
+	fflush.  Check for a client/server version match.
+	Handle -emacs-pid, -window-system-unsupported, -print, -error, and
+	-suspend commands.  Don't exit prematurely on --no-wait, let Emacs
+	close the connection for us.  When creating a new frame, send
 	environment and pwd to Emacs.  Send current-frame to Emacs.
 
 2007-08-25  Eli Zaretskii  <eliz@gnu.org>
@@ -378,8 +384,7 @@
 	suggest using options to make them explicit.
 	(AUTH_KEY_LENGTH, SEND_BUFFER_SIZE): New constants.
 	(send_buffer, sblen): New variables.
-	(send_to_emacs): New function to buffer output and send it with
-	send().
+	(send_to_emacs): New function to buffer output and send it with `send'.
 	(quote_file_name): Use SEND_STRING.
 	(close_winsock, initialize_sockets): New functions to load and
 	unload Winsock.
@@ -485,8 +490,8 @@
 
 2006-05-23  Francesco Potort,Al(B  <pot@gnu.org>
 
-	* pop.c (pop_open, socket_connection, KPOP_SERVICE): Added
-	comments explaining why the "kpop" service is never used.
+	* pop.c (pop_open, socket_connection, KPOP_SERVICE):
+	Add comments explaining why the "kpop" service is never used.
 
 2006-05-13  Eli Zaretskii  <eliz@gnu.org>
 
@@ -594,7 +599,7 @@
 
 	* makefile.w32-in (../src/config.h): Don't overwrite.  Print a
 	message instead.
-	(../src/paths.h): Removed.
+	(../src/paths.h): Remove.
 
 2005-07-27  Juanma Barranquero  <lekktu@gmail.com>
 
@@ -972,7 +977,7 @@
 
 2003-01-06  Kim F. Storm  <storm@cua.dk>
 
-	* pop.c (__P): Renamed from _P to avoid problems on Cygwin.
+	* pop.c (__P): Rename from _P to avoid problems on Cygwin.
 	All uses changed.
 
 2002-12-18  Andrew Innes  <andrewi@gnu.org>
--- a/lib-src/emacsclient.c	Wed Sep 19 20:50:40 2007 +0000
+++ b/lib-src/emacsclient.c	Thu Sep 20 01:11:57 2007 +0000
@@ -144,8 +144,8 @@
 /* Nonzero means args are expressions to be evaluated.  --eval.  */
 int eval = 0;
 
-/* Nonzero means don't open a new frame.  --current-frame.  */
-int current_frame = 0;
+/* Nonzero means don't open a new frame.  Inverse of --create-frame.  */
+int current_frame = 1;
 
 /* Nonzero means open a new graphical frame. */
 int window_system = 0;
@@ -178,7 +178,7 @@
   { "help",	no_argument,	   NULL, 'H' },
   { "version",	no_argument,	   NULL, 'V' },
   { "tty",	no_argument,       NULL, 't' },
-  { "current-frame", no_argument,  NULL, 'c' },
+  { "create-frame", no_argument,   NULL, 'c' },
   { "alternate-editor", required_argument, NULL, 'a' },
 #ifndef NO_SOCKETS_IN_FILE_SYSTEM
   { "socket-name",	required_argument, NULL, 's' },
@@ -442,7 +442,7 @@
           break;
 
         case 'c':
-          current_frame = 1;
+          current_frame = 0;
           break;
 
 	case 'H':
@@ -495,7 +495,7 @@
 -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\
--c, --current-frame  	Do not create a new frame;\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\
 -n, --no-wait		Don't wait for the server to return\n\
@@ -1300,11 +1300,6 @@
   w32_give_focus ();
 #endif
 
-  /* First of all, send our version number for verification. */
-  send_to_emacs (emacs_socket, "-version ");
-  send_to_emacs (emacs_socket, VERSION);
-  send_to_emacs (emacs_socket, " ");
-
   /* Send over our environment. */
   if (!current_frame)
     {
@@ -1464,11 +1459,7 @@
       while (p > string && *p == '\n')
         *p-- = 0;
 
-      if (strprefix ("-good-version ", string))
-        {
-          /* -good-version: The versions match. */
-        }
-      else if (strprefix ("-emacs-pid ", string))
+      if (strprefix ("-emacs-pid ", string))
         {
           /* -emacs-pid PID: The process id of the Emacs process. */
           emacs_pid = strtol (string + strlen ("-emacs-pid"), NULL, 10);