]> git.eshelyaron.com Git - emacs.git/commitdiff
(x_term_init): Give error if can't open DISPLAY_NAME.
authorRichard M. Stallman <rms@gnu.org>
Mon, 10 Sep 2007 17:34:24 +0000 (17:34 +0000)
committerRichard M. Stallman <rms@gnu.org>
Mon, 10 Sep 2007 17:34:24 +0000 (17:34 +0000)
src/ChangeLog
src/xterm.c

index 0324d958aa4630368f7703821c21105988655529..e476eac4a3eaf1b58e23a546f3ef2135f6809601 100644 (file)
@@ -1,3 +1,7 @@
+2007-09-10  Richard Stallman  <rms@gnu.org>
+
+       * xterm.c (x_term_init): Give error if can't open DISPLAY_NAME.
+
 2007-09-10  Micha\e,Ak\e(Bl Cadilhac  <michael@cadilhac.name>
 
        * lisp.h (struct Lisp_Subr): Rename `prompt' field to `intspec'.
index 0e56b04c1b0de4a6a1a245498e898f5c249253c1..af35fbe87992fdcfa8ada888655d3ff1d8f62387 100644 (file)
@@ -10586,9 +10586,12 @@ get_bits_and_offset (mask, bits, offset)
   *bits = nr;
 }
 
+/* Return 1 if display DISPLAY is available for use, 0 otherwise.
+   But don't permanently open it, just test its availability.  */
+
 int
 x_display_ok (display)
-    const char * display;
+    const char *display;
 {
     int dpy_ok = 1;
     Display *dpy;
@@ -10601,6 +10604,10 @@ x_display_ok (display)
     return dpy_ok;
 }
 
+/* Open a connection to X display DISPLAY_NAME, and return
+   the structure that describes the open display.
+   If we cannot contact the display, return null.  */
+
 struct x_display_info *
 x_term_init (display_name, xrm_option, resource_name)
      Lisp_Object display_name;
@@ -10621,6 +10628,9 @@ x_term_init (display_name, xrm_option, resource_name)
       ++x_initialized;
     }
 
+  if (! x_display_ok (SDATA (display_name)))
+    error ("Display %s can't be opened", SDATA (display_name));
+
 #ifdef USE_GTK
   {
 #define NUM_ARGV 10