changeset 5077:a928c879b7ea

(read_key_sequence): If we get a quit, and current buffer has changed, replay it to get proper keymap. (quit_throw_to_read_char): Switch frames to the frame the quit was in.
author Richard M. Stallman <rms@gnu.org>
date Sat, 20 Nov 1993 04:14:34 +0000
parents b724b2f0fbc7
children 698acfd3faa3
files src/keyboard.c
diffstat 1 files changed, 18 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/keyboard.c	Sat Nov 20 04:05:45 1993 +0000
+++ b/src/keyboard.c	Sat Nov 20 04:14:34 1993 +0000
@@ -3790,6 +3790,8 @@
   Lisp_Object first_event;
 #endif
 
+  struct buffer *starting_buffer;
+
   int junk;
 
   last_nonmenu_event = Qnil;
@@ -3838,6 +3840,8 @@
      keybuf[0..mock_input] holds the sequence we should reread.  */
  replay_sequence:
 
+  starting_buffer = current_buffer;
+
   /* Build our list of keymaps.
      If we recognize a function key and replace its escape sequence in
      keybuf with its symbol, or if the sequence starts with a mouse
@@ -3867,9 +3871,7 @@
     if (! NILP (submaps[first_binding]))
       break;
 
-  /* We jump here when a function key substitution has forced us to
-     reprocess the current key sequence.  keybuf[0..mock_input] is the
-     sequence we want to reread.  */
+  /* Start from the beginning in keybuf.  */
   t = 0;
 
   /* These are no-ops the first time through, but if we restart, they
@@ -3958,6 +3960,17 @@
 	      goto done;
 	    }
 	  
+	  /* 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.  */
+	  if (EQ (key, quit_char) && current_buffer != starting_buffer)
+	    {
+	      keybuf[t++] = key;
+	      mock_input = t;
+	      Vquit_flag = Qnil;
+	      goto replay_sequence;
+	    }
+	    
 	  Vquit_flag = Qnil;
 	}
 
@@ -4994,6 +5007,8 @@
   if (poll_suppress_count == 0)
     abort ();
 #endif
+  if (XFRAME (internal_last_event_frame) != selected_frame)
+    Fhandle_switch_frame (make_lispy_switch_frame (internal_last_event_frame));
 
   _longjmp (getcjmp, 1);
 }