diff options
| author | Karl Heuer | 1994-02-11 01:34:16 +0000 |
|---|---|---|
| committer | Karl Heuer | 1994-02-11 01:34:16 +0000 |
| commit | 3cb8101157d70088bbc7e30fe1f270485b7da659 (patch) | |
| tree | 11114388defe8a50e28db427c6c9f599a12c1301 /src | |
| parent | 6c82d689cf98eff0b9456ca89b54973686431709 (diff) | |
| download | emacs-3cb8101157d70088bbc7e30fe1f270485b7da659.tar.gz emacs-3cb8101157d70088bbc7e30fe1f270485b7da659.zip | |
(read_char, read_char_minibuf_menu_prompt, read_key_sequence): Retry read_char
after a buffer change.
Diffstat (limited to 'src')
| -rw-r--r-- | src/keyboard.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index a50062e0e7e..9e068984647 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -1705,7 +1705,9 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu) | |||
| 1705 | internal_with_output_to_temp_buffer ("*Help*", print_help, tem0); | 1705 | internal_with_output_to_temp_buffer ("*Help*", print_help, tem0); |
| 1706 | 1706 | ||
| 1707 | cancel_echoing (); | 1707 | cancel_echoing (); |
| 1708 | c = read_char (0, 0, 0, Qnil, 0); | 1708 | do |
| 1709 | c = read_char (0, 0, 0, Qnil, 0); | ||
| 1710 | while (XTYPE (c) == Lisp_Buffer); | ||
| 1709 | /* Remove the help from the frame */ | 1711 | /* Remove the help from the frame */ |
| 1710 | unbind_to (count, Qnil); | 1712 | unbind_to (count, Qnil); |
| 1711 | prepare_menu_bars (); | 1713 | prepare_menu_bars (); |
| @@ -1713,7 +1715,9 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu) | |||
| 1713 | if (EQ (c, make_number (040))) | 1715 | if (EQ (c, make_number (040))) |
| 1714 | { | 1716 | { |
| 1715 | cancel_echoing (); | 1717 | cancel_echoing (); |
| 1716 | c = read_char (0, 0, 0, Qnil, 0); | 1718 | do |
| 1719 | c = read_char (0, 0, 0, Qnil, 0); | ||
| 1720 | while (XTYPE (c) == Lisp_Buffer); | ||
| 1717 | } | 1721 | } |
| 1718 | } | 1722 | } |
| 1719 | 1723 | ||
| @@ -3870,7 +3874,9 @@ read_char_minibuf_menu_prompt(commandflag, nmaps, maps) | |||
| 3870 | */ | 3874 | */ |
| 3871 | orig_defn_macro = defining_kbd_macro ; | 3875 | orig_defn_macro = defining_kbd_macro ; |
| 3872 | defining_kbd_macro = 0 ; | 3876 | defining_kbd_macro = 0 ; |
| 3873 | obj = read_char (commandflag, 0, 0, Qnil, 0); | 3877 | do |
| 3878 | obj = read_char (commandflag, 0, 0, Qnil, 0); | ||
| 3879 | while (XTYPE (obj) == Lisp_Buffer); | ||
| 3874 | defining_kbd_macro = orig_defn_macro ; | 3880 | defining_kbd_macro = orig_defn_macro ; |
| 3875 | 3881 | ||
| 3876 | if (XTYPE (obj) != Lisp_Int) | 3882 | if (XTYPE (obj) != Lisp_Int) |
| @@ -4304,6 +4310,14 @@ read_key_sequence (keybuf, bufsize, prompt) | |||
| 4304 | goto done; | 4310 | goto done; |
| 4305 | } | 4311 | } |
| 4306 | 4312 | ||
| 4313 | /* If the current buffer has been changed from under us, the | ||
| 4314 | keymap may have changed, so replay the sequence. */ | ||
| 4315 | if (XTYPE (key) == Lisp_Buffer) | ||
| 4316 | { | ||
| 4317 | mock_input = t; | ||
| 4318 | goto replay_sequence; | ||
| 4319 | } | ||
| 4320 | |||
| 4307 | /* If we have a quit that was typed in another frame, and | 4321 | /* If we have a quit that was typed in another frame, and |
| 4308 | quit_throw_to_read_char switched buffers, | 4322 | quit_throw_to_read_char switched buffers, |
| 4309 | replay to get the right keymap. */ | 4323 | replay to get the right keymap. */ |
| @@ -4314,7 +4328,7 @@ read_key_sequence (keybuf, bufsize, prompt) | |||
| 4314 | Vquit_flag = Qnil; | 4328 | Vquit_flag = Qnil; |
| 4315 | goto replay_sequence; | 4329 | goto replay_sequence; |
| 4316 | } | 4330 | } |
| 4317 | 4331 | ||
| 4318 | Vquit_flag = Qnil; | 4332 | Vquit_flag = Qnil; |
| 4319 | } | 4333 | } |
| 4320 | 4334 | ||