diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2011-03-28 16:26:35 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2011-03-28 16:26:35 -0400 |
commit | f6d6298639ae43539581c2079666d76a54f1557e (patch) | |
tree | 851ead8f971b04dc30905d465e305e3d9efdf49d /doc | |
parent | 947b656632a76ebb01eda0550c34b1ac43684a98 (diff) | |
download | emacs-f6d6298639ae43539581c2079666d76a54f1557e.tar.gz |
Don't reset post-command-hook to nil upon error.
* src/eval.c (enum run_hooks_condition): Remove.
(funcall_nil, funcall_not): New functions.
(run_hook_with_args): Call each function through a `funcall' argument.
Remove `cond' argument, now redundant.
(Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
(Frun_hook_with_args_until_failure): Adjust accordingly.
(run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
* src/keyboard.c (safe_run_hook_funcall): New function.
(safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
don't set the hook to nil, but remove the offending function instead.
(Qcommand_hook_internal): Remove, unused.
(syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
Vcommand_hook_internal.
* doc/lispref/commands.texi (Command Overview): post-command-hook is not reset
to nil any more.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/lispref/ChangeLog | 5 | ||||
-rw-r--r-- | doc/lispref/commands.texi | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index c705aae4934..1eb3cfa2556 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,8 @@ +2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca> + + * commands.texi (Command Overview): post-command-hook is not reset to + nil any more. + 2011-03-19 Stefan Monnier <monnier@iro.umontreal.ca> * strings.texi (String Conversion): Don't mention diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index 4f8d554a68b..eb42ddb11a4 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi @@ -91,8 +91,9 @@ and also when the command loop is first entered. At that time, Quitting is suppressed while running @code{pre-command-hook} and @code{post-command-hook}. If an error happens while executing one of -these hooks, it terminates execution of the hook, and clears the hook -variable to @code{nil} so as to prevent an infinite loop of errors. +these hooks, it does not terminate execution of the hook; instead +the error is silenced and the function in which the error occurred +is removed from the hook. A request coming into the Emacs server (@pxref{Emacs Server,,, emacs, The GNU Emacs Manual}) runs these two hooks just as a keyboard |