changeset 83451:ce06f17e2bfe

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
author Karoly Lorentey <lorentey@elte.hu>
date Thu, 05 Jan 2006 13:52:26 +0000
parents c69d44922688
children 02980fcccc43
files src/keyboard.c
diffstat 1 files changed, 20 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- 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);