diff options
| author | Richard M. Stallman | 2007-09-10 17:34:24 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2007-09-10 17:34:24 +0000 |
| commit | 5632bd0fc4b3f06fff0ce55d53675f285b6a43d2 (patch) | |
| tree | aea874b554008312aaf55d68b10831b0a9131423 /src | |
| parent | ebd3fa6bc82283df585963007934b70993b50e05 (diff) | |
| download | emacs-5632bd0fc4b3f06fff0ce55d53675f285b6a43d2.tar.gz emacs-5632bd0fc4b3f06fff0ce55d53675f285b6a43d2.zip | |
(x_term_init): Give error if can't open DISPLAY_NAME.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | src/xterm.c | 12 |
2 files changed, 15 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 0324d958aa4..e476eac4a3e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2007-09-10 Richard Stallman <rms@gnu.org> | ||
| 2 | |||
| 3 | * xterm.c (x_term_init): Give error if can't open DISPLAY_NAME. | ||
| 4 | |||
| 1 | 2007-09-10 Micha,Ak(Bl Cadilhac <michael@cadilhac.name> | 5 | 2007-09-10 Micha,Ak(Bl Cadilhac <michael@cadilhac.name> |
| 2 | 6 | ||
| 3 | * lisp.h (struct Lisp_Subr): Rename `prompt' field to `intspec'. | 7 | * lisp.h (struct Lisp_Subr): Rename `prompt' field to `intspec'. |
diff --git a/src/xterm.c b/src/xterm.c index 0e56b04c1b0..af35fbe8799 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -10586,9 +10586,12 @@ get_bits_and_offset (mask, bits, offset) | |||
| 10586 | *bits = nr; | 10586 | *bits = nr; |
| 10587 | } | 10587 | } |
| 10588 | 10588 | ||
| 10589 | /* Return 1 if display DISPLAY is available for use, 0 otherwise. | ||
| 10590 | But don't permanently open it, just test its availability. */ | ||
| 10591 | |||
| 10589 | int | 10592 | int |
| 10590 | x_display_ok (display) | 10593 | x_display_ok (display) |
| 10591 | const char * display; | 10594 | const char *display; |
| 10592 | { | 10595 | { |
| 10593 | int dpy_ok = 1; | 10596 | int dpy_ok = 1; |
| 10594 | Display *dpy; | 10597 | Display *dpy; |
| @@ -10601,6 +10604,10 @@ x_display_ok (display) | |||
| 10601 | return dpy_ok; | 10604 | return dpy_ok; |
| 10602 | } | 10605 | } |
| 10603 | 10606 | ||
| 10607 | /* Open a connection to X display DISPLAY_NAME, and return | ||
| 10608 | the structure that describes the open display. | ||
| 10609 | If we cannot contact the display, return null. */ | ||
| 10610 | |||
| 10604 | struct x_display_info * | 10611 | struct x_display_info * |
| 10605 | x_term_init (display_name, xrm_option, resource_name) | 10612 | x_term_init (display_name, xrm_option, resource_name) |
| 10606 | Lisp_Object display_name; | 10613 | Lisp_Object display_name; |
| @@ -10621,6 +10628,9 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 10621 | ++x_initialized; | 10628 | ++x_initialized; |
| 10622 | } | 10629 | } |
| 10623 | 10630 | ||
| 10631 | if (! x_display_ok (SDATA (display_name))) | ||
| 10632 | error ("Display %s can't be opened", SDATA (display_name)); | ||
| 10633 | |||
| 10624 | #ifdef USE_GTK | 10634 | #ifdef USE_GTK |
| 10625 | { | 10635 | { |
| 10626 | #define NUM_ARGV 10 | 10636 | #define NUM_ARGV 10 |