]> git.eshelyaron.com Git - emacs.git/commitdiff
(cmd_error_internal): New function, broken out of cmd_error.
authorRichard M. Stallman <rms@gnu.org>
Thu, 22 Sep 1994 06:26:46 +0000 (06:26 +0000)
committerRichard M. Stallman <rms@gnu.org>
Thu, 22 Sep 1994 06:26:46 +0000 (06:26 +0000)
(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

index ee2703c65ca0328bf176a32cb3993b58d6d2de77..027026f0c7e0efce8a5afce65ed56d539f2d6d0f 100644 (file)
@@ -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);
 }
 \f
 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;