aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/keyboard.c44
1 files changed, 28 insertions, 16 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 99044239e1d..ea0f10bd110 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -705,11 +705,17 @@ cmd_error (data)
705 Vstandard_output = Qt; 705 Vstandard_output = Qt;
706 Vstandard_input = Qt; 706 Vstandard_input = Qt;
707 Vexecuting_macro = Qnil; 707 Vexecuting_macro = Qnil;
708 if (!current_perdisplay)
709 abort ();
710 current_perdisplay->Vprefix_arg = Qnil;
708 cmd_error_internal (data, 0); 711 cmd_error_internal (data, 0);
709 712
710 Vquit_flag = Qnil; 713 Vquit_flag = Qnil;
711 714
712 Vinhibit_quit = Qnil; 715 Vinhibit_quit = Qnil;
716#ifdef MULTI_PERDISPLAY
717 current_perdisplay = 0;
718#endif
713 719
714 return make_number (0); 720 return make_number (0);
715} 721}
@@ -907,8 +913,8 @@ command_loop_1 ()
907 int no_direct; 913 int no_direct;
908 int prev_modiff; 914 int prev_modiff;
909 struct buffer *prev_buffer; 915 struct buffer *prev_buffer;
916 PERDISPLAY *global_perdisplay = current_perdisplay;
910 917
911 Vprefix_arg = Qnil;
912 Vdeactivate_mark = Qnil; 918 Vdeactivate_mark = Qnil;
913 waiting_for_input = 0; 919 waiting_for_input = 0;
914 cancel_echoing (); 920 cancel_echoing ();
@@ -932,11 +938,6 @@ command_loop_1 ()
932 938
933 while (1) 939 while (1)
934 { 940 {
935 /* Install chars successfully executed in kbd macro. */
936
937 if (defining_kbd_macro && NILP (Vprefix_arg))
938 finalize_kbd_macro_chars ();
939
940 /* Make sure the current window's buffer is selected. */ 941 /* Make sure the current window's buffer is selected. */
941 if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer) 942 if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer)
942 set_buffer_internal (XBUFFER (XWINDOW (selected_window)->buffer)); 943 set_buffer_internal (XBUFFER (XWINDOW (selected_window)->buffer));
@@ -973,7 +974,7 @@ command_loop_1 ()
973 } 974 }
974 975
975#ifdef C_ALLOCA 976#ifdef C_ALLOCA
976 alloca (0); /* Cause a garbage collection now */ 977 alloca (0); /* Cause a garbage collection now */
977 /* Since we can free the most stuff here. */ 978 /* Since we can free the most stuff here. */
978#endif /* C_ALLOCA */ 979#endif /* C_ALLOCA */
979 980
@@ -995,7 +996,7 @@ command_loop_1 ()
995 call0 (Qrecompute_lucid_menubar); 996 call0 (Qrecompute_lucid_menubar);
996 997
997 /* Read next key sequence; i gets its length. */ 998 /* Read next key sequence; i gets its length. */
998 i = read_key_sequence (keybuf, (sizeof keybuf / sizeof (keybuf[0])), Qnil, 0); 999 i = read_key_sequence (keybuf, sizeof keybuf / sizeof keybuf[0], Qnil, 0);
999 1000
1000 ++num_input_keys; 1001 ++num_input_keys;
1001 1002
@@ -1010,7 +1011,7 @@ command_loop_1 ()
1010 { 1011 {
1011 cancel_echoing (); 1012 cancel_echoing ();
1012 this_command_key_count = 0; 1013 this_command_key_count = 0;
1013 continue; 1014 goto finalize;
1014 } 1015 }
1015 1016
1016 last_command_char = keybuf[i - 1]; 1017 last_command_char = keybuf[i - 1];
@@ -1057,12 +1058,12 @@ command_loop_1 ()
1057 bitch_at_user (); 1058 bitch_at_user ();
1058 defining_kbd_macro = 0; 1059 defining_kbd_macro = 0;
1059 update_mode_lines = 1; 1060 update_mode_lines = 1;
1060 Vprefix_arg = Qnil; 1061 current_perdisplay->Vprefix_arg = Qnil;
1061 1062
1062 } 1063 }
1063 else 1064 else
1064 { 1065 {
1065 if (NILP (Vprefix_arg) && ! no_direct) 1066 if (NILP (current_perdisplay->Vprefix_arg) && ! no_direct)
1066 { 1067 {
1067 /* Recognize some common commands in common situations and 1068 /* Recognize some common commands in common situations and
1068 do them directly. */ 1069 do them directly. */
@@ -1185,7 +1186,7 @@ command_loop_1 ()
1185 /* Here for a command that isn't executed directly */ 1186 /* Here for a command that isn't executed directly */
1186 1187
1187 nonundocount = 0; 1188 nonundocount = 0;
1188 if (NILP (Vprefix_arg)) 1189 if (NILP (current_perdisplay->Vprefix_arg))
1189 Fundo_boundary (); 1190 Fundo_boundary ();
1190 Fcommand_execute (this_command, Qnil); 1191 Fcommand_execute (this_command, Qnil);
1191 1192
@@ -1209,7 +1210,7 @@ command_loop_1 ()
1209 3) we want to leave this_command_key_count non-zero, so that 1210 3) we want to leave this_command_key_count non-zero, so that
1210 read_char will realize that it is re-reading a character, and 1211 read_char will realize that it is re-reading a character, and
1211 not echo it a second time. */ 1212 not echo it a second time. */
1212 if (NILP (Vprefix_arg)) 1213 if (NILP (current_perdisplay->Vprefix_arg))
1213 { 1214 {
1214 last_command = this_command; 1215 last_command = this_command;
1215 cancel_echoing (); 1216 cancel_echoing ();
@@ -1226,6 +1227,16 @@ command_loop_1 ()
1226 else if (current_buffer != prev_buffer || MODIFF != prev_modiff) 1227 else if (current_buffer != prev_buffer || MODIFF != prev_modiff)
1227 call1 (Vrun_hooks, intern ("activate-mark-hook")); 1228 call1 (Vrun_hooks, intern ("activate-mark-hook"));
1228 } 1229 }
1230
1231 finalize:
1232 /* Install chars successfully executed in kbd macro. */
1233
1234 if (defining_kbd_macro && NILP (current_perdisplay->Vprefix_arg))
1235 finalize_kbd_macro_chars ();
1236
1237#ifdef MULTI_PERDISPLAY
1238 current_perdisplay = global_perdisplay;
1239#endif
1229 } 1240 }
1230} 1241}
1231 1242
@@ -5414,8 +5425,9 @@ Otherwise, that is done only if an arg is read using the minibuffer.")
5414 struct backtrace backtrace; 5425 struct backtrace backtrace;
5415 extern int debug_on_next_call; 5426 extern int debug_on_next_call;
5416 5427
5417 prefixarg = Vprefix_arg, Vprefix_arg = Qnil; 5428 prefixarg = current_perdisplay->Vprefix_arg;
5418 Vcurrent_prefix_arg = prefixarg; 5429 current_perdisplay->Vprefix_arg = Qnil;
5430 current_perdisplay->Vcurrent_prefix_arg = prefixarg;
5419 debug_on_next_call = 0; 5431 debug_on_next_call = 0;
5420 5432
5421 if (SYMBOLP (cmd)) 5433 if (SYMBOLP (cmd))
@@ -5531,7 +5543,7 @@ DEFUN ("execute-extended-command", Fexecute_extended_command, Sexecute_extended_
5531 UNGCPRO; 5543 UNGCPRO;
5532 5544
5533 function = Fintern (function, Qnil); 5545 function = Fintern (function, Qnil);
5534 Vprefix_arg = prefixarg; 5546 current_perdisplay->Vprefix_arg = prefixarg;
5535 this_command = function; 5547 this_command = function;
5536 5548
5537 return Fcommand_execute (function, Qt); 5549 return Fcommand_execute (function, Qt);