diff options
| author | Karoly Lorentey | 2006-01-05 13:52:26 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2006-01-05 13:52:26 +0000 |
| commit | e079ecf45241cc5d2904db7ede9592f9861bb9aa (patch) | |
| tree | 7e205efc39883f268e070d1955cc534844b0916a /src | |
| parent | b58cb6144c59dfa3a44b9b383cf354bc2c9bebdf (diff) | |
| download | emacs-e079ecf45241cc5d2904db7ede9592f9861bb9aa.tar.gz emacs-e079ecf45241cc5d2904db7ede9592f9861bb9aa.zip | |
Fix abort() in read_key_sequence.
* src/keyboard.c (read_char): Enhance comment before extra longjmp to
wrong_kboard_jmpbuf.
(read_key_sequence): Handle deleted interrupted_kboards correctly; that
is a legal case.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-491
Diffstat (limited to 'src')
| -rw-r--r-- | src/keyboard.c | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index cd10c1fde6c..d923cfd31a8 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -2876,10 +2876,11 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, wrong_kboard_j | |||
| 2876 | 2876 | ||
| 2877 | /* Notify the caller if a timer or sentinel or filter in the sit_for | 2877 | /* Notify the caller if a timer or sentinel or filter in the sit_for |
| 2878 | calls above have changed the current kboard. This could happen | 2878 | calls above have changed the current kboard. This could happen |
| 2879 | if they start a recursive edit, like the fancy splash screen in | 2879 | if they use the minibuffer or start a recursive edit, like the |
| 2880 | server.el's filter. If this longjmp wasn't here, | 2880 | fancy splash screen in server.el's filter. If this longjmp |
| 2881 | read_key_sequence would interpret the next key sequence using the | 2881 | wasn't here, read_key_sequence would interpret the next key |
| 2882 | wrong translation tables and function keymaps. */ | 2882 | sequence using the wrong translation tables and function |
| 2883 | keymaps. */ | ||
| 2883 | if (NILP (c) && current_kboard != orig_kboard) | 2884 | if (NILP (c) && current_kboard != orig_kboard) |
| 2884 | { | 2885 | { |
| 2885 | UNGCPRO; | 2886 | UNGCPRO; |
| @@ -9010,14 +9011,20 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, | |||
| 9010 | struct frame *interrupted_frame = SELECTED_FRAME (); | 9011 | struct frame *interrupted_frame = SELECTED_FRAME (); |
| 9011 | if (setjmp (*wrong_kboard_jmpbuf)) | 9012 | if (setjmp (*wrong_kboard_jmpbuf)) |
| 9012 | { | 9013 | { |
| 9013 | int found = 0; | 9014 | int found = 0; |
| 9014 | struct kboard *k; | 9015 | struct kboard *k; |
| 9015 | 9016 | ||
| 9016 | for (k = all_kboards; k; k = k->next_kboard) | 9017 | for (k = all_kboards; k; k = k->next_kboard) |
| 9017 | if (k == interrupted_kboard) | 9018 | if (k == interrupted_kboard) |
| 9018 | found = 1; | 9019 | found = 1; |
| 9019 | if (!found) | 9020 | |
| 9020 | abort (); | 9021 | if (!found) |
| 9022 | { | ||
| 9023 | /* Don't touch interrupted_kboard when it's been | ||
| 9024 | deleted. */ | ||
| 9025 | delayed_switch_frame = Qnil; | ||
| 9026 | goto replay_sequence; | ||
| 9027 | } | ||
| 9021 | 9028 | ||
| 9022 | if (!NILP (delayed_switch_frame)) | 9029 | if (!NILP (delayed_switch_frame)) |
| 9023 | { | 9030 | { |
| @@ -9026,6 +9033,7 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, | |||
| 9026 | interrupted_kboard->kbd_queue); | 9033 | interrupted_kboard->kbd_queue); |
| 9027 | delayed_switch_frame = Qnil; | 9034 | delayed_switch_frame = Qnil; |
| 9028 | } | 9035 | } |
| 9036 | |||
| 9029 | while (t > 0) | 9037 | while (t > 0) |
| 9030 | interrupted_kboard->kbd_queue | 9038 | interrupted_kboard->kbd_queue |
| 9031 | = Fcons (keybuf[--t], interrupted_kboard->kbd_queue); | 9039 | = Fcons (keybuf[--t], interrupted_kboard->kbd_queue); |