diff options
| author | Karoly Lorentey <lorentey@elte.hu> | 2006-01-05 13:52:26 +0000 |
|---|---|---|
| committer | Karoly Lorentey <lorentey@elte.hu> | 2006-01-05 13:52:26 +0000 |
| commit | e079ecf45241cc5d2904db7ede9592f9861bb9aa (patch) | |
| tree | 7e205efc39883f268e070d1955cc534844b0916a | |
| parent | b58cb6144c59dfa3a44b9b383cf354bc2c9bebdf (diff) | |
| download | emacs-e079ecf45241cc5d2904db7ede9592f9861bb9aa.tar.gz | |
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
| -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 /* Notify the caller if a timer or sentinel or filter in the sit_for calls above have changed the current kboard. This could happen - if they start a recursive edit, like the fancy splash screen in - server.el's filter. If this longjmp wasn't here, - read_key_sequence would interpret the next key sequence using the - wrong translation tables and function keymaps. */ + if they use the minibuffer or start a recursive edit, like the + fancy splash screen in server.el's filter. If this longjmp + wasn't here, read_key_sequence would interpret the next key + sequence using the wrong translation tables and function + keymaps. */ if (NILP (c) && current_kboard != orig_kboard) { UNGCPRO; @@ -9010,14 +9011,20 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, struct frame *interrupted_frame = SELECTED_FRAME (); if (setjmp (*wrong_kboard_jmpbuf)) { - int found = 0; - struct kboard *k; + int found = 0; + struct kboard *k; - for (k = all_kboards; k; k = k->next_kboard) - if (k == interrupted_kboard) - found = 1; - if (!found) - abort (); + for (k = all_kboards; k; k = k->next_kboard) + if (k == interrupted_kboard) + found = 1; + + if (!found) + { + /* Don't touch interrupted_kboard when it's been + deleted. */ + delayed_switch_frame = Qnil; + goto replay_sequence; + } if (!NILP (delayed_switch_frame)) { @@ -9026,6 +9033,7 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, interrupted_kboard->kbd_queue); delayed_switch_frame = Qnil; } + while (t > 0) interrupted_kboard->kbd_queue = Fcons (keybuf[--t], interrupted_kboard->kbd_queue); |
