# HG changeset patch # User Karoly Lorentey # Date 1136469146 0 # Node ID ce06f17e2bfedee7df86576c4cdc0b596b8cab16 # Parent c69d44922688cdfa33e7e9ac62f0dca4d97eedb1 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 diff -r c69d44922688 -r ce06f17e2bfe src/keyboard.c --- a/src/keyboard.c Tue Jan 03 02:15:28 2006 +0000 +++ b/src/keyboard.c Thu Jan 05 13:52:26 2006 +0000 @@ -2876,10 +2876,11 @@ /* 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 @@ struct frame *interrupted_frame = SELECTED_FRAME (); if (setjmp (*wrong_kboard_jmpbuf)) { - int found = 0; - struct kboard *k; - - for (k = all_kboards; k; k = k->next_kboard) - if (k == interrupted_kboard) - found = 1; - if (!found) - abort (); + int found = 0; + struct kboard *k; + + 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 @@ interrupted_kboard->kbd_queue); delayed_switch_frame = Qnil; } + while (t > 0) interrupted_kboard->kbd_queue = Fcons (keybuf[--t], interrupted_kboard->kbd_queue);