changeset 88014:e830695cdb7f

(decode_options): Default to a NULL display, as Emacs-22. Allow the -d option under w32 again, for those rare cases where it actually does make sense.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sat, 26 Jan 2008 21:27:38 +0000
parents b0c61850537b
children 7b54e553ca0b
files lib-src/ChangeLog lib-src/emacsclient.c
diffstat 2 files changed, 21 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lib-src/ChangeLog	Sat Jan 26 21:05:58 2008 +0000
+++ b/lib-src/ChangeLog	Sat Jan 26 21:27:38 2008 +0000
@@ -1,3 +1,9 @@
+2008-01-26  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* emacsclient.c (decode_options): Default to a NULL display, as Emacs-22.
+	Allow the -d option under w32 again, for those rare cases where it
+	actually does make sense.
+
 2008-01-25  Juanma Barranquero  <lekktu@gmail.com>
 
 	* emacsclient.c (set_tcp_socket): Don't send "\n" after
--- a/lib-src/emacsclient.c	Sat Jan 26 21:05:58 2008 +0000
+++ b/lib-src/emacsclient.c	Sat Jan 26 21:27:38 2008 +0000
@@ -479,10 +479,14 @@
      char **argv;
 {
   alternate_editor = egetenv ("ALTERNATE_EDITOR");
-#ifndef WINDOWSNT
+
+  /* We used to set `display' to $DISPLAY by default, but this changed the
+     default behavior and is sometimes inconvenient.  So instead of forcing
+     users to say "--display ''" when they want to use Emacs's existing tty
+     or display connection, we force them to use "--display $DISPLAY" if
+     they want Emacs to connect to their current display.  */
+#if 0
   display = egetenv ("DISPLAY");
-  if (display && strlen (display) == 0)
-    display = NULL;
 #endif
 
   while (1)
@@ -519,7 +523,11 @@
 	  server_file = optarg;
 	  break;
 
-#ifndef WINDOWSNT
+	  /* We used to disallow this argument in w32, but it seems better
+	     to allow it, for the occasional case where the user is
+	     connecting with a w32 client to a server compiled with X11
+	     support.  */
+#if 1 /* !defined WINDOWS */
 	case 'd':
 	  display = optarg;
 	  break;
@@ -558,6 +566,9 @@
 	}
     }
 
+  if (display && strlen (display) == 0)
+    display = NULL;
+
   if (!tty && display)
     window_system = 1;
 #if !defined (WINDOWSNT) && !defined (HAVE_CARBON)