changeset 69607:761eaec1aae4

* dispnew.c (init_display): Check DISPLAY here. * emacs.c (main): Don't check here. * xterm.c (x_display_ok): Don't use DISPLAY env var.
author Andreas Schwab <schwab@suse.de>
date Mon, 20 Mar 2006 22:41:23 +0000
parents 40a0e06dc5aa
children 0c54773776e4
files src/ChangeLog src/dispnew.c src/emacs.c src/xterm.c
diffstat 4 files changed, 17 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Mon Mar 20 22:22:25 2006 +0000
+++ b/src/ChangeLog	Mon Mar 20 22:41:23 2006 +0000
@@ -1,3 +1,11 @@
+2006-03-20  Andreas Schwab  <schwab@suse.de>
+
+	* dispnew.c (init_display): Check DISPLAY here.
+
+	* emacs.c (main): Don't check here.
+
+	* xterm.c (x_display_ok): Don't use DISPLAY env var.
+
 2006-03-20  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* window.c (window_scroll_pixel_based): Yet another int/Lisp_Object
--- a/src/dispnew.c	Mon Mar 20 22:22:25 2006 +0000
+++ b/src/dispnew.c	Mon Mar 20 22:41:23 2006 +0000
@@ -6664,6 +6664,13 @@
 #endif
 
       display_arg = (display != 0 && *display != 0);
+
+      if (display_arg && !x_display_ok (display))
+	{
+	  fprintf (stderr, "Display %s unavailable, simulating -nw\n",
+		   display);
+	  inhibit_window_system = 1;
+	}
     }
 
   if (!inhibit_window_system && display_arg
--- a/src/emacs.c	Mon Mar 20 22:22:25 2006 +0000
+++ b/src/emacs.c	Mon Mar 20 22:41:23 2006 +0000
@@ -53,10 +53,6 @@
 #include "buffer.h"
 #include "window.h"
 
-#ifdef HAVE_X_WINDOWS
-#include "xterm.h"
-#endif
-
 #include "systty.h"
 #include "blockinput.h"
 #include "syssignal.h"
@@ -1486,14 +1482,6 @@
 
     /* Don't actually discard this arg.  */
     skip_args = count_before;
-
-    /* Do not be lenient if the user explicitly asked for a named display.  */
-    if (display_arg == 1 && !x_display_ok (displayname))
-      {
-	fprintf (stderr, "Display %s unavailable, simulating -nw\n",
-		 displayname);
-	inhibit_window_system = 1;
-      }
   }
 #endif
 
--- a/src/xterm.c	Mon Mar 20 22:22:25 2006 +0000
+++ b/src/xterm.c	Mon Mar 20 22:41:23 2006 +0000
@@ -10123,12 +10123,8 @@
     int dpy_ok = 1;
     Display *dpy;
 
-    if (!display)
-      display = getenv("DISPLAY");
-    if (!display)
-      return 0;
-
-    if ((dpy = XOpenDisplay (display)))
+    dpy = XOpenDisplay (display);
+    if (dpy)
       XCloseDisplay (dpy);
     else
       dpy_ok = 0;