diff options
| author | Karl Heuer | 1994-02-11 08:05:12 +0000 |
|---|---|---|
| committer | Karl Heuer | 1994-02-11 08:05:12 +0000 |
| commit | b0f2a7bf453e9bd80d40284dd267b8e5a8e2269b (patch) | |
| tree | df38048ebd43063cba7a612ef44d22ee0c284bbe /src | |
| parent | fbb6c27bac52fcc3377b90fe31e6475256fe9232 (diff) | |
| download | emacs-b0f2a7bf453e9bd80d40284dd267b8e5a8e2269b.tar.gz emacs-b0f2a7bf453e9bd80d40284dd267b8e5a8e2269b.zip | |
(syms_of_keyboard): Add a DEFVAR for command-hook-internal.
(command_loop_1): Use it for post-command-hook.
(Fexecute_extended_command): Copy this_command_keys as a vector, not a string.
Diffstat (limited to 'src')
| -rw-r--r-- | src/keyboard.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index 9e068984647..48ca4b72a12 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -1201,7 +1201,16 @@ command_loop_1 () | |||
| 1201 | directly_done: ; | 1201 | directly_done: ; |
| 1202 | 1202 | ||
| 1203 | if (!NILP (Vpost_command_hook)) | 1203 | if (!NILP (Vpost_command_hook)) |
| 1204 | call1 (Vrun_hooks, Qpost_command_hook); | 1204 | { |
| 1205 | /* If we get an error during the post-command-hook, | ||
| 1206 | cause post-command-hook to be nil. */ | ||
| 1207 | Vcommand_hook_internal = Vpost_command_hook; | ||
| 1208 | Vpost_command_hook = Qnil; | ||
| 1209 | |||
| 1210 | call1 (Vrun_hooks, Qcommand_hook_internal); | ||
| 1211 | |||
| 1212 | Vpost_command_hook = Vcommand_hook_internal; | ||
| 1213 | } | ||
| 1205 | 1214 | ||
| 1206 | /* If there is a prefix argument, | 1215 | /* If there is a prefix argument, |
| 1207 | 1) We don't want last_command to be ``universal-argument'' | 1216 | 1) We don't want last_command to be ``universal-argument'' |
| @@ -4959,7 +4968,8 @@ DEFUN ("execute-extended-command", Fexecute_extended_command, Sexecute_extended_ | |||
| 4959 | Lisp_Object saved_keys; | 4968 | Lisp_Object saved_keys; |
| 4960 | struct gcpro gcpro1; | 4969 | struct gcpro gcpro1; |
| 4961 | 4970 | ||
| 4962 | saved_keys = Fthis_command_keys (); | 4971 | saved_keys = Fvector (this_command_key_count, |
| 4972 | XVECTOR (this_command_keys)->contents); | ||
| 4963 | buf[0] = 0; | 4973 | buf[0] = 0; |
| 4964 | GCPRO1 (saved_keys); | 4974 | GCPRO1 (saved_keys); |
| 4965 | 4975 | ||
| @@ -4989,17 +4999,15 @@ DEFUN ("execute-extended-command", Fexecute_extended_command, Sexecute_extended_ | |||
| 4989 | function, followed by a RET. */ | 4999 | function, followed by a RET. */ |
| 4990 | { | 5000 | { |
| 4991 | struct Lisp_String *str; | 5001 | struct Lisp_String *str; |
| 5002 | Lisp_Object *keys; | ||
| 4992 | int i; | 5003 | int i; |
| 4993 | Lisp_Object tem; | 5004 | Lisp_Object tem; |
| 4994 | 5005 | ||
| 4995 | this_command_key_count = 0; | 5006 | this_command_key_count = 0; |
| 4996 | 5007 | ||
| 4997 | str = XSTRING (saved_keys); | 5008 | keys = XVECTOR (saved_keys)->contents; |
| 4998 | for (i = 0; i < str->size; i++) | 5009 | for (i = 0; i < XVECTOR (saved_keys)->size; i++) |
| 4999 | { | 5010 | add_command_key (keys[i]); |
| 5000 | XFASTINT (tem) = str->data[i]; | ||
| 5001 | add_command_key (tem); | ||
| 5002 | } | ||
| 5003 | 5011 | ||
| 5004 | str = XSTRING (function); | 5012 | str = XSTRING (function); |
| 5005 | for (i = 0; i < str->size; i++) | 5013 | for (i = 0; i < str->size; i++) |
| @@ -5850,6 +5858,10 @@ and tests the value when the command returns.\n\ | |||
| 5850 | Buffer modification stores t in this variable."); | 5858 | Buffer modification stores t in this variable."); |
| 5851 | Vdeactivate_mark = Qnil; | 5859 | Vdeactivate_mark = Qnil; |
| 5852 | 5860 | ||
| 5861 | DEFVAR_LISP ("command-hook-internal", &Vcommand_hook_internal, | ||
| 5862 | "Temporary storage of pre-command-hook or post-command-hook."); | ||
| 5863 | Vcommand_hook_internal = Qnil; | ||
| 5864 | |||
| 5853 | DEFVAR_LISP ("pre-command-hook", &Vpre_command_hook, | 5865 | DEFVAR_LISP ("pre-command-hook", &Vpre_command_hook, |
| 5854 | "Normal hook run before each command is executed."); | 5866 | "Normal hook run before each command is executed."); |
| 5855 | Vpre_command_hook = Qnil; | 5867 | Vpre_command_hook = Qnil; |