comparison src/keyboard.c @ 6208:db4139d43f8a

(command_loop_1, read_key_sequence, Fcommand_execute): Don't call Vrun_hooks if it is nil.
author Richard M. Stallman <rms@gnu.org>
date Sat, 05 Mar 1994 20:35:52 +0000
parents ba6268a3dee9
children 6ecf8ea4bd8d
comparison
equal deleted inserted replaced
6207:993ca5adfcd1 6208:db4139d43f8a
910 this_command_key_count = 0; 910 this_command_key_count = 0;
911 last_command = this_command; 911 last_command = this_command;
912 912
913 /* Make sure this hook runs after commands that get errors and 913 /* Make sure this hook runs after commands that get errors and
914 throw to top level. */ 914 throw to top level. */
915 if (!NILP (Vpost_command_hook)) 915 if (!NILP (Vpost_command_hook) && !NILP (Vrun_hooks))
916 { 916 {
917 /* If we get an error during the post-command-hook, 917 /* If we get an error during the post-command-hook,
918 cause post-command-hook to be nil. */ 918 cause post-command-hook to be nil. */
919 Vcommand_hook_internal = Vpost_command_hook; 919 Vcommand_hook_internal = Vpost_command_hook;
920 Vpost_command_hook = Qnil; 920 Vpost_command_hook = Qnil;
1037 last_point_position = PT; 1037 last_point_position = PT;
1038 1038
1039 /* Execute the command. */ 1039 /* Execute the command. */
1040 1040
1041 this_command = cmd; 1041 this_command = cmd;
1042 if (!NILP (Vpre_command_hook)) 1042 if (!NILP (Vpre_command_hook) && !NILP (Vrun_hooks))
1043 { 1043 {
1044 /* If we get an error during the pre-command-hook, 1044 /* If we get an error during the pre-command-hook,
1045 cause pre-command-hook to be nil. */ 1045 cause pre-command-hook to be nil. */
1046 Vcommand_hook_internal = Vpre_command_hook; 1046 Vcommand_hook_internal = Vpre_command_hook;
1047 Vpre_command_hook = Qnil; 1047 Vpre_command_hook = Qnil;
1174 Fcommand_execute (this_command, Qnil); 1174 Fcommand_execute (this_command, Qnil);
1175 1175
1176 } 1176 }
1177 directly_done: ; 1177 directly_done: ;
1178 1178
1179 if (!NILP (Vpost_command_hook)) 1179 if (!NILP (Vpost_command_hook) && !NILP (Vrun_hooks))
1180 { 1180 {
1181 /* If we get an error during the post-command-hook, 1181 /* If we get an error during the post-command-hook,
1182 cause post-command-hook to be nil. */ 1182 cause post-command-hook to be nil. */
1183 Vcommand_hook_internal = Vpost_command_hook; 1183 Vcommand_hook_internal = Vpost_command_hook;
1184 Vpost_command_hook = Qnil; 1184 Vpost_command_hook = Qnil;
1202 last_command = this_command; 1202 last_command = this_command;
1203 cancel_echoing (); 1203 cancel_echoing ();
1204 this_command_key_count = 0; 1204 this_command_key_count = 0;
1205 } 1205 }
1206 1206
1207 if (!NILP (current_buffer->mark_active)) 1207 if (!NILP (current_buffer->mark_active) && !NILP (Vrun_hooks))
1208 { 1208 {
1209 if (!NILP (Vdeactivate_mark) && !NILP (Vtransient_mark_mode)) 1209 if (!NILP (Vdeactivate_mark) && !NILP (Vtransient_mark_mode))
1210 { 1210 {
1211 current_buffer->mark_active = Qnil; 1211 current_buffer->mark_active = Qnil;
1212 call1 (Vrun_hooks, intern ("deactivate-mark-hook")); 1212 call1 (Vrun_hooks, intern ("deactivate-mark-hook"));
4520 if (EQ (posn, Qmenu_bar)) 4520 if (EQ (posn, Qmenu_bar))
4521 { 4521 {
4522 if (t + 1 >= bufsize) 4522 if (t + 1 >= bufsize)
4523 error ("key sequence too long"); 4523 error ("key sequence too long");
4524 /* Run the Lucid hook. */ 4524 /* Run the Lucid hook. */
4525 call1 (Vrun_hooks, Qactivate_menubar_hook); 4525 if (!NILP (Vrun_hooks))
4526 call1 (Vrun_hooks, Qactivate_menubar_hook);
4526 /* If it has changed current-menubar from previous value, 4527 /* If it has changed current-menubar from previous value,
4527 really recompute the menubar from the value. */ 4528 really recompute the menubar from the value. */
4528 if (! NILP (Vlucid_menu_bar_dirty_flag)) 4529 if (! NILP (Vlucid_menu_bar_dirty_flag))
4529 call0 (Qrecompute_lucid_menubar); 4530 call0 (Qrecompute_lucid_menubar);
4530 keybuf[t] = posn; 4531 keybuf[t] = posn;
4991 debug_on_next_call = 0; 4992 debug_on_next_call = 0;
4992 4993
4993 if (XTYPE (cmd) == Lisp_Symbol) 4994 if (XTYPE (cmd) == Lisp_Symbol)
4994 { 4995 {
4995 tem = Fget (cmd, Qdisabled); 4996 tem = Fget (cmd, Qdisabled);
4996 if (!NILP (tem)) 4997 if (!NILP (tem) && !NILP (Vrun_hooks))
4997 return call1 (Vrun_hooks, Qdisabled_command_hook); 4998 return call1 (Vrun_hooks, Qdisabled_command_hook);
4998 } 4999 }
4999 5000
5000 while (1) 5001 while (1)
5001 { 5002 {