diff options
| author | Gerd Moellmann | 2001-10-05 09:53:07 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2001-10-05 09:53:07 +0000 |
| commit | f0e299dedcd8ae9a35f57546afb61a69122afa30 (patch) | |
| tree | ad97b6a9e737ca5a5127efb174152003c81a41ee /src | |
| parent | 36d8561d49cf066c6dbd69cf949561983a3ee790 (diff) | |
| download | emacs-f0e299dedcd8ae9a35f57546afb61a69122afa30.tar.gz emacs-f0e299dedcd8ae9a35f57546afb61a69122afa30.zip | |
(XTread_socket): Return a non_ascii_keystroke for
unknown keysyms.
(error_msg): New variable.
(x_fatal_error_signal): New function.
(x_connection_closed): Set error_msg. Install
x_fatal_error_signal as fatal_error_signal_hook around the call to
XtCloseDisplay.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/src/xterm.c b/src/xterm.c index 33f72d987af..6a3b6ac3a11 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -10526,7 +10526,8 @@ XTread_socket (sd, bufp, numchars, expected) | |||
| 10526 | || IsKeypadKey (keysym) /* 0xff80 <= x < 0xffbe */ | 10526 | || IsKeypadKey (keysym) /* 0xff80 <= x < 0xffbe */ |
| 10527 | || IsFunctionKey (keysym) /* 0xffbe <= x < 0xffe1 */ | 10527 | || IsFunctionKey (keysym) /* 0xffbe <= x < 0xffe1 */ |
| 10528 | /* Any "vendor-specific" key is ok. */ | 10528 | /* Any "vendor-specific" key is ok. */ |
| 10529 | || (orig_keysym & (1 << 28))) | 10529 | || (orig_keysym & (1 << 28)) |
| 10530 | || (keysym != NoSymbol && nbytes == 0)) | ||
| 10530 | && ! (IsModifierKey (orig_keysym) | 10531 | && ! (IsModifierKey (orig_keysym) |
| 10531 | #ifndef HAVE_X11R5 | 10532 | #ifndef HAVE_X11R5 |
| 10532 | #ifdef XK_Mode_switch | 10533 | #ifdef XK_Mode_switch |
| @@ -11877,6 +11878,21 @@ x_connection_signal (signalnum) /* If we don't have an argument, */ | |||
| 11877 | Handling X errors | 11878 | Handling X errors |
| 11878 | ************************************************************************/ | 11879 | ************************************************************************/ |
| 11879 | 11880 | ||
| 11881 | /* Error message passed to x_connection_closed. */ | ||
| 11882 | |||
| 11883 | static char *error_msg; | ||
| 11884 | |||
| 11885 | /* Function installed as fatal_error_signal_hook.in | ||
| 11886 | x_connection_closed. Print the X error message, and exit normally, | ||
| 11887 | instead of dumping core when XtCloseDisplay fails. */ | ||
| 11888 | |||
| 11889 | static void | ||
| 11890 | x_fatal_error_signal () | ||
| 11891 | { | ||
| 11892 | fprintf (stderr, "%s\n", error_msg); | ||
| 11893 | exit (70); | ||
| 11894 | } | ||
| 11895 | |||
| 11880 | /* Handle the loss of connection to display DPY. ERROR_MESSAGE is | 11896 | /* Handle the loss of connection to display DPY. ERROR_MESSAGE is |
| 11881 | the text of an error message that lead to the connection loss. */ | 11897 | the text of an error message that lead to the connection loss. */ |
| 11882 | 11898 | ||
| @@ -11888,10 +11904,9 @@ x_connection_closed (dpy, error_message) | |||
| 11888 | struct x_display_info *dpyinfo = x_display_info_for_display (dpy); | 11904 | struct x_display_info *dpyinfo = x_display_info_for_display (dpy); |
| 11889 | Lisp_Object frame, tail; | 11905 | Lisp_Object frame, tail; |
| 11890 | int count; | 11906 | int count; |
| 11891 | char *msg; | ||
| 11892 | 11907 | ||
| 11893 | msg = (char *) alloca (strlen (error_message) + 1); | 11908 | error_msg = (char *) alloca (strlen (error_message) + 1); |
| 11894 | strcpy (msg, error_message); | 11909 | strcpy (error_msg, error_message); |
| 11895 | handling_signal = 0; | 11910 | handling_signal = 0; |
| 11896 | 11911 | ||
| 11897 | /* Prevent being called recursively because of an error condition | 11912 | /* Prevent being called recursively because of an error condition |
| @@ -11919,7 +11934,12 @@ x_connection_closed (dpy, error_message) | |||
| 11919 | /* If DPYINFO is null, this means we didn't open the display | 11934 | /* If DPYINFO is null, this means we didn't open the display |
| 11920 | in the first place, so don't try to close it. */ | 11935 | in the first place, so don't try to close it. */ |
| 11921 | if (dpyinfo) | 11936 | if (dpyinfo) |
| 11922 | XtCloseDisplay (dpy); | 11937 | { |
| 11938 | extern void (*fatal_error_signal_hook) P_ ((void)); | ||
| 11939 | fatal_error_signal_hook = x_fatal_error_signal; | ||
| 11940 | XtCloseDisplay (dpy); | ||
| 11941 | fatal_error_signal_hook = NULL; | ||
| 11942 | } | ||
| 11923 | #endif | 11943 | #endif |
| 11924 | 11944 | ||
| 11925 | /* Indicate that this display is dead. */ | 11945 | /* Indicate that this display is dead. */ |
| @@ -11960,7 +11980,7 @@ x_connection_closed (dpy, error_message) | |||
| 11960 | 11980 | ||
| 11961 | if (x_display_list == 0) | 11981 | if (x_display_list == 0) |
| 11962 | { | 11982 | { |
| 11963 | fprintf (stderr, "%s\n", msg); | 11983 | fprintf (stderr, "%s\n", error_msg); |
| 11964 | shut_down_emacs (0, 0, Qnil); | 11984 | shut_down_emacs (0, 0, Qnil); |
| 11965 | exit (70); | 11985 | exit (70); |
| 11966 | } | 11986 | } |
| @@ -11973,7 +11993,7 @@ x_connection_closed (dpy, error_message) | |||
| 11973 | TOTALLY_UNBLOCK_INPUT; | 11993 | TOTALLY_UNBLOCK_INPUT; |
| 11974 | 11994 | ||
| 11975 | clear_waiting_for_input (); | 11995 | clear_waiting_for_input (); |
| 11976 | error ("%s", msg); | 11996 | error ("%s", error_msg); |
| 11977 | } | 11997 | } |
| 11978 | 11998 | ||
| 11979 | 11999 | ||