Mercurial > emacs
comparison src/keyboard.c @ 8302:4e5626d0b962
(Vdeferred_action_list, Vdeferred_action_function): New variables.
(command_loop_1): Handle them.
(syms_of_keyboard): Set up Lisp variables.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Wed, 20 Jul 1994 20:01:12 +0000 |
parents | 26dbb6234efd |
children | d97339356ae6 |
comparison
equal
deleted
inserted
replaced
8301:c01188c50e70 | 8302:4e5626d0b962 |
---|---|
295 /* Hooks to run before and after each command. */ | 295 /* Hooks to run before and after each command. */ |
296 Lisp_Object Qpre_command_hook, Qpost_command_hook; | 296 Lisp_Object Qpre_command_hook, Qpost_command_hook; |
297 Lisp_Object Vpre_command_hook, Vpost_command_hook; | 297 Lisp_Object Vpre_command_hook, Vpost_command_hook; |
298 Lisp_Object Qcommand_hook_internal, Vcommand_hook_internal; | 298 Lisp_Object Qcommand_hook_internal, Vcommand_hook_internal; |
299 | 299 |
300 /* List of deferred actions to be performed at a later time. | |
301 The precise format isn't relevant here; we just check whether it is nil. */ | |
302 Lisp_Object Vdeferred_action_list; | |
303 | |
304 /* Function to call to handle deferred actions, when there are any. */ | |
305 Lisp_Object Vdeferred_action_function; | |
306 | |
300 /* File in which we write all commands we read. */ | 307 /* File in which we write all commands we read. */ |
301 FILE *dribble; | 308 FILE *dribble; |
302 | 309 |
303 /* Nonzero if input is available. */ | 310 /* Nonzero if input is available. */ |
304 int input_pending; | 311 int input_pending; |
954 throw to top level. */ | 961 throw to top level. */ |
955 /* Note that the value cell will never directly contain nil | 962 /* Note that the value cell will never directly contain nil |
956 if the symbol is a local variable. */ | 963 if the symbol is a local variable. */ |
957 if (!NILP (XSYMBOL (Qpost_command_hook)->value) && !NILP (Vrun_hooks)) | 964 if (!NILP (XSYMBOL (Qpost_command_hook)->value) && !NILP (Vrun_hooks)) |
958 safe_run_hooks (Qpost_command_hook); | 965 safe_run_hooks (Qpost_command_hook); |
966 | |
967 if (!NILP (Vdeferred_action_list)) | |
968 call0 (Vdeferred_action_function); | |
959 | 969 |
960 /* Do this after running Vpost_command_hook, for consistency. */ | 970 /* Do this after running Vpost_command_hook, for consistency. */ |
961 last_command = this_command; | 971 last_command = this_command; |
962 | 972 |
963 while (1) | 973 while (1) |
1225 /* Note that the value cell will never directly contain nil | 1235 /* Note that the value cell will never directly contain nil |
1226 if the symbol is a local variable. */ | 1236 if the symbol is a local variable. */ |
1227 if (!NILP (XSYMBOL (Qpost_command_hook)->value) && !NILP (Vrun_hooks)) | 1237 if (!NILP (XSYMBOL (Qpost_command_hook)->value) && !NILP (Vrun_hooks)) |
1228 safe_run_hooks (Qpost_command_hook); | 1238 safe_run_hooks (Qpost_command_hook); |
1229 | 1239 |
1240 if (!NILP (Vdeferred_action_list)) | |
1241 call0 (Vdeferred_action_function); | |
1242 | |
1230 /* If there is a prefix argument, | 1243 /* If there is a prefix argument, |
1231 1) We don't want last_command to be ``universal-argument'' | 1244 1) We don't want last_command to be ``universal-argument'' |
1232 (that would be dumb), so don't set last_command, | 1245 (that would be dumb), so don't set last_command, |
1233 2) we want to leave echoing on so that the prefix will be | 1246 2) we want to leave echoing on so that the prefix will be |
1234 echoed as part of this key sequence, so don't call | 1247 echoed as part of this key sequence, so don't call |
6229 "Alist of system-specific X windows key symbols.\n\ | 6242 "Alist of system-specific X windows key symbols.\n\ |
6230 Each element should have the form (N . SYMBOL) where N is the\n\ | 6243 Each element should have the form (N . SYMBOL) where N is the\n\ |
6231 numeric keysym code (sans the \"system-specific\" bit 1<<28)\n\ | 6244 numeric keysym code (sans the \"system-specific\" bit 1<<28)\n\ |
6232 and SYMBOL is its name."); | 6245 and SYMBOL is its name."); |
6233 Vsystem_key_alist = Qnil; | 6246 Vsystem_key_alist = Qnil; |
6247 | |
6248 DEFVAR_LISP ("deferred-action-list", &Vdeferred_action_list, | |
6249 "List of deferred actions to be performed at a later time.\n\ | |
6250 The precise format isn't relevant here; we just check whether it is nil."); | |
6251 Vdeferred_action_list = Qnil; | |
6252 | |
6253 DEFVAR_LISP ("deferred-action-function", &Vdeferred_action_function, | |
6254 "Function to call to handle deferred actions, after each command.\n\ | |
6255 This function is called with no arguments after each command\n\ | |
6256 whenever `deferred-action-list' is non-nil."); | |
6257 Vdeferred_action_function = Qnil; | |
6234 } | 6258 } |
6235 | 6259 |
6236 keys_of_keyboard () | 6260 keys_of_keyboard () |
6237 { | 6261 { |
6238 initial_define_key (global_map, Ctl ('Z'), "suspend-emacs"); | 6262 initial_define_key (global_map, Ctl ('Z'), "suspend-emacs"); |