aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2006-07-17 21:07:20 +0000
committerRichard M. Stallman2006-07-17 21:07:20 +0000
commit27ddcc192f668cc32cc4ee0560e5179793c4b125 (patch)
treee4b6fc5aac6e12a5920e66a58d24093da5639abf
parent04d8c47ded95adc93d1bc2082c9f8a39a9d4bb86 (diff)
downloademacs-27ddcc192f668cc32cc4ee0560e5179793c4b125.tar.gz
emacs-27ddcc192f668cc32cc4ee0560e5179793c4b125.zip
(Processing of Errors): Add command-error-function.
-rw-r--r--lispref/control.texi19
1 files changed, 15 insertions, 4 deletions
diff --git a/lispref/control.texi b/lispref/control.texi
index cabadb3b8dc..83bce85e0b3 100644
--- a/lispref/control.texi
+++ b/lispref/control.texi
@@ -849,11 +849,22 @@ executes in the environment of the @code{condition-case} that
849established it; all functions called within that @code{condition-case} 849established it; all functions called within that @code{condition-case}
850have already been exited, and the handler cannot return to them. 850have already been exited, and the handler cannot return to them.
851 851
852If there is no applicable handler for the error, the current command is 852If there is no applicable handler for the error, it terminates the
853terminated and control returns to the editor command loop, because the 853current command and returns control to the editor command loop. (The
854command loop has an implicit handler for all kinds of errors. The 854command loop has an implicit handler for all kinds of errors.) The
855command loop's handler uses the error symbol and associated data to 855command loop's handler uses the error symbol and associated data to
856print an error message. 856print an error message. You can use the variable
857@code{command-error-function} to control how this is done:
858
859@defvar command-error-function
860This variable, if non-@code{nil}, specifies a function to use to
861handle errors that return control to the Emacs command loop. The
862function should take three arguments: @var{data}, a list of the same
863form that @code{condition-case} would bind to its variable;
864@var{context}, a string describing the situation in which the error
865occurred, or (more often) @code{nil}; and @code{caller}, the Lisp
866function which called the primitive that signaled the error.
867@end defvar
857 868
858@cindex @code{debug-on-error} use 869@cindex @code{debug-on-error} use
859An error that has no explicit handler may call the Lisp debugger. The 870An error that has no explicit handler may call the Lisp debugger. The