changeset 5889:06bbb0e856d7

(read_char, read_char_minibuf_menu_prompt, read_key_sequence): Retry read_char after a buffer change.
author Karl Heuer <kwzh@gnu.org>
date Fri, 11 Feb 1994 01:34:16 +0000
parents 0d02ee7ee659
children 3a543d9ccca5
files src/keyboard.c
diffstat 1 files changed, 18 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/keyboard.c	Fri Feb 11 01:29:24 1994 +0000
+++ b/src/keyboard.c	Fri Feb 11 01:34:16 1994 +0000
@@ -1705,7 +1705,9 @@
 	internal_with_output_to_temp_buffer ("*Help*", print_help, tem0);
 
       cancel_echoing ();
-      c = read_char (0, 0, 0, Qnil, 0);
+      do
+	c = read_char (0, 0, 0, Qnil, 0);
+      while (XTYPE (c) == Lisp_Buffer);
       /* Remove the help from the frame */
       unbind_to (count, Qnil);
       prepare_menu_bars ();
@@ -1713,7 +1715,9 @@
       if (EQ (c, make_number (040)))
 	{
 	  cancel_echoing ();
-	  c = read_char (0, 0, 0, Qnil, 0);
+	  do
+	    c = read_char (0, 0, 0, Qnil, 0);
+	  while (XTYPE (c) == Lisp_Buffer);
 	}
     }
 
@@ -3870,7 +3874,9 @@
 	 */
       orig_defn_macro = defining_kbd_macro ;
       defining_kbd_macro = 0 ;
-      obj = read_char (commandflag, 0, 0, Qnil, 0);
+      do
+	obj = read_char (commandflag, 0, 0, Qnil, 0);
+      while (XTYPE (obj) == Lisp_Buffer);
       defining_kbd_macro = orig_defn_macro ;
 
       if (XTYPE (obj) != Lisp_Int)
@@ -4304,6 +4310,14 @@
 	      goto done;
 	    }
 	  
+	  /* If the current buffer has been changed from under us, the
+	     keymap may have changed, so replay the sequence.  */
+	  if (XTYPE (key) == Lisp_Buffer)
+	    {
+	      mock_input = t;
+	      goto replay_sequence;
+	    }
+
 	  /* If we have a quit that was typed in another frame, and
 	     quit_throw_to_read_char switched buffers,
 	     replay to get the right keymap.  */
@@ -4314,7 +4328,7 @@
 	      Vquit_flag = Qnil;
 	      goto replay_sequence;
 	    }
-	    
+
 	  Vquit_flag = Qnil;
 	}