diff options
| author | Richard M. Stallman | 2006-07-17 21:07:20 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2006-07-17 21:07:20 +0000 |
| commit | 27ddcc192f668cc32cc4ee0560e5179793c4b125 (patch) | |
| tree | e4b6fc5aac6e12a5920e66a58d24093da5639abf | |
| parent | 04d8c47ded95adc93d1bc2082c9f8a39a9d4bb86 (diff) | |
| download | emacs-27ddcc192f668cc32cc4ee0560e5179793c4b125.tar.gz emacs-27ddcc192f668cc32cc4ee0560e5179793c4b125.zip | |
(Processing of Errors): Add command-error-function.
| -rw-r--r-- | lispref/control.texi | 19 |
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 | |||
| 849 | established it; all functions called within that @code{condition-case} | 849 | established it; all functions called within that @code{condition-case} |
| 850 | have already been exited, and the handler cannot return to them. | 850 | have already been exited, and the handler cannot return to them. |
| 851 | 851 | ||
| 852 | If there is no applicable handler for the error, the current command is | 852 | If there is no applicable handler for the error, it terminates the |
| 853 | terminated and control returns to the editor command loop, because the | 853 | current command and returns control to the editor command loop. (The |
| 854 | command loop has an implicit handler for all kinds of errors. The | 854 | command loop has an implicit handler for all kinds of errors.) The |
| 855 | command loop's handler uses the error symbol and associated data to | 855 | command loop's handler uses the error symbol and associated data to |
| 856 | print an error message. | 856 | print 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 | ||
| 860 | This variable, if non-@code{nil}, specifies a function to use to | ||
| 861 | handle errors that return control to the Emacs command loop. The | ||
| 862 | function should take three arguments: @var{data}, a list of the same | ||
| 863 | form that @code{condition-case} would bind to its variable; | ||
| 864 | @var{context}, a string describing the situation in which the error | ||
| 865 | occurred, or (more often) @code{nil}; and @code{caller}, the Lisp | ||
| 866 | function 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 |
| 859 | An error that has no explicit handler may call the Lisp debugger. The | 870 | An error that has no explicit handler may call the Lisp debugger. The |