aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1994-09-22 06:26:46 +0000
committerRichard M. Stallman1994-09-22 06:26:46 +0000
commita1341f75deaa2eb38f1142278971daad09ddb3d7 (patch)
treec4add4dd39aaae7e2176dc12fbffb21f1c2a6d77
parent95e6cf3913dda77badbeeabf5327a1568d523a00 (diff)
downloademacs-a1341f75deaa2eb38f1142278971daad09ddb3d7.tar.gz
emacs-a1341f75deaa2eb38f1142278971daad09ddb3d7.zip
(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.
-rw-r--r--src/keyboard.c36
1 files 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
@@ -750,6 +750,22 @@ Lisp_Object
750cmd_error (data) 750cmd_error (data)
751 Lisp_Object data; 751 Lisp_Object data;
752{ 752{
753 Vstandard_output = Qt;
754 Vstandard_input = Qt;
755 Vexecuting_macro = Qnil;
756 cmd_error_internal (data, 0);
757
758 Vquit_flag = Qnil;
759
760 Vinhibit_quit = Qnil;
761
762 return make_number (0);
763}
764
765cmd_error_internal (data, context)
766 Lisp_Object data;
767 char *context;
768{
753 Lisp_Object errmsg, tail, errname, file_error; 769 Lisp_Object errmsg, tail, errname, file_error;
754 Lisp_Object stream; 770 Lisp_Object stream;
755 struct gcpro gcpro1; 771 struct gcpro gcpro1;
@@ -757,9 +773,6 @@ cmd_error (data)
757 773
758 Vquit_flag = Qnil; 774 Vquit_flag = Qnil;
759 Vinhibit_quit = Qt; 775 Vinhibit_quit = Qt;
760 Vstandard_output = Qt;
761 Vstandard_input = Qt;
762 Vexecuting_macro = Qnil;
763 echo_area_glyphs = 0; 776 echo_area_glyphs = 0;
764 777
765 /* If the window system or terminal frame hasn't been initialized 778 /* If the window system or terminal frame hasn't been initialized
@@ -775,6 +788,9 @@ cmd_error (data)
775 stream = Qt; 788 stream = Qt;
776 } 789 }
777 790
791 if (context != 0)
792 write_string_1 (context, -1, stream);
793
778 errname = Fcar (data); 794 errname = Fcar (data);
779 795
780 if (EQ (errname, Qerror)) 796 if (EQ (errname, Qerror))
@@ -827,11 +843,6 @@ cmd_error (data)
827 Fterpri (stream); 843 Fterpri (stream);
828 Fkill_emacs (make_number (-1)); 844 Fkill_emacs (make_number (-1));
829 } 845 }
830
831 Vquit_flag = Qnil;
832
833 Vinhibit_quit = Qnil;
834 return make_number (0);
835} 846}
836 847
837Lisp_Object command_loop_1 (); 848Lisp_Object command_loop_1 ();
@@ -1473,6 +1484,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
1473 register Lisp_Object c; 1484 register Lisp_Object c;
1474 int count; 1485 int count;
1475 jmp_buf save_jump; 1486 jmp_buf save_jump;
1487 int key_already_recorded = 0;
1476 1488
1477 if (CONSP (Vunread_command_events)) 1489 if (CONSP (Vunread_command_events))
1478 { 1490 {
@@ -1593,7 +1605,10 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
1593 { 1605 {
1594 c = read_char_minibuf_menu_prompt (commandflag, nmaps, maps); 1606 c = read_char_minibuf_menu_prompt (commandflag, nmaps, maps);
1595 if (! NILP (c)) 1607 if (! NILP (c))
1596 goto non_reread; 1608 {
1609 key_already_recorded = 1;
1610 goto non_reread;
1611 }
1597 } 1612 }
1598 1613
1599 /* If in middle of key sequence and minibuffer not active, 1614 /* If in middle of key sequence and minibuffer not active,
@@ -1731,6 +1746,9 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
1731 if (XTYPE (c) == Lisp_Buffer) 1746 if (XTYPE (c) == Lisp_Buffer)
1732 return c; 1747 return c;
1733 1748
1749 if (key_already_recorded)
1750 return c;
1751
1734 /* Wipe the echo area. */ 1752 /* Wipe the echo area. */
1735 echo_area_glyphs = 0; 1753 echo_area_glyphs = 0;
1736 1754