From a1341f75deaa2eb38f1142278971daad09ddb3d7 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Thu, 22 Sep 1994 06:26:46 +0000 Subject: [PATCH] (cmd_error_internal): New function, broken out of cmd_error. (read_char): Don't return right away when read_char_minibuf_menu_prompt returns non-nil. Instead, set key_already_recorded, which inhibits most but not all of the work at non_reread. --- src/keyboard.c | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/src/keyboard.c b/src/keyboard.c index ee2703c65ca..027026f0c7e 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -749,6 +749,22 @@ recursive_edit_unwind (buffer) Lisp_Object cmd_error (data) Lisp_Object data; +{ + Vstandard_output = Qt; + Vstandard_input = Qt; + Vexecuting_macro = Qnil; + cmd_error_internal (data, 0); + + Vquit_flag = Qnil; + + Vinhibit_quit = Qnil; + + return make_number (0); +} + +cmd_error_internal (data, context) + Lisp_Object data; + char *context; { Lisp_Object errmsg, tail, errname, file_error; Lisp_Object stream; @@ -757,9 +773,6 @@ cmd_error (data) Vquit_flag = Qnil; Vinhibit_quit = Qt; - Vstandard_output = Qt; - Vstandard_input = Qt; - Vexecuting_macro = Qnil; echo_area_glyphs = 0; /* If the window system or terminal frame hasn't been initialized @@ -775,6 +788,9 @@ cmd_error (data) stream = Qt; } + if (context != 0) + write_string_1 (context, -1, stream); + errname = Fcar (data); if (EQ (errname, Qerror)) @@ -827,11 +843,6 @@ cmd_error (data) Fterpri (stream); Fkill_emacs (make_number (-1)); } - - Vquit_flag = Qnil; - - Vinhibit_quit = Qnil; - return make_number (0); } Lisp_Object command_loop_1 (); @@ -1473,6 +1484,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu) register Lisp_Object c; int count; jmp_buf save_jump; + int key_already_recorded = 0; if (CONSP (Vunread_command_events)) { @@ -1593,7 +1605,10 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu) { c = read_char_minibuf_menu_prompt (commandflag, nmaps, maps); if (! NILP (c)) - goto non_reread; + { + key_already_recorded = 1; + goto non_reread; + } } /* If in middle of key sequence and minibuffer not active, @@ -1731,6 +1746,9 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu) if (XTYPE (c) == Lisp_Buffer) return c; + if (key_already_recorded) + return c; + /* Wipe the echo area. */ echo_area_glyphs = 0; -- 2.39.5