diff options
| author | Paul Eggert | 2019-06-27 02:33:36 -0700 |
|---|---|---|
| committer | Paul Eggert | 2019-06-27 02:37:08 -0700 |
| commit | 1d9bb2ff70ca65dbfdd2ec904b8f6d9e07a6e9c5 (patch) | |
| tree | bb3d81f78013546d427e96efede2e6b5099acac1 | |
| parent | f90e0c5661b921528e41fe2404689a7e90c16895 (diff) | |
| download | emacs-1d9bb2ff70ca65dbfdd2ec904b8f6d9e07a6e9c5.tar.gz emacs-1d9bb2ff70ca65dbfdd2ec904b8f6d9e07a6e9c5.zip | |
Tweak ‘error’ and ‘user-error’ doc strings
* lisp/net/tramp.el (tramp-user-error):
* lisp/subr.el (user-error):
Say that user errors are sometimes called pilot errors.
* lisp/subr.el (error, user-error):
Reorder wording to discuss mechanism first, then formatting advice,
rather than going back and forth between the two topics.
Tighten up the wording a bit.
| -rw-r--r-- | lisp/net/tramp.el | 2 | ||||
| -rw-r--r-- | lisp/subr.el | 27 |
2 files changed, 14 insertions, 15 deletions
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 1abed4e717a..3efac8d74f9 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -1860,7 +1860,7 @@ an input event arrives. The other arguments are passed to `tramp-error'." | |||
| 1860 | 1860 | ||
| 1861 | ;; We must make it a defun, because it is used earlier already. | 1861 | ;; We must make it a defun, because it is used earlier already. |
| 1862 | (defun tramp-user-error (vec-or-proc fmt-string &rest arguments) | 1862 | (defun tramp-user-error (vec-or-proc fmt-string &rest arguments) |
| 1863 | "Signal a user error." | 1863 | "Signal a user error (or \"pilot error\")." |
| 1864 | (unwind-protect | 1864 | (unwind-protect |
| 1865 | (apply | 1865 | (apply |
| 1866 | #'tramp-error vec-or-proc | 1866 | #'tramp-error vec-or-proc |
diff --git a/lisp/subr.el b/lisp/subr.el index fcad2ccf0a2..4a1649f6019 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -325,31 +325,30 @@ This function accepts any number of arguments, but ignores them." | |||
| 325 | ;; Signal a compile-error if the first arg is missing. | 325 | ;; Signal a compile-error if the first arg is missing. |
| 326 | (defun error (&rest args) | 326 | (defun error (&rest args) |
| 327 | "Signal an error, making a message by passing ARGS to `format-message'. | 327 | "Signal an error, making a message by passing ARGS to `format-message'. |
| 328 | Errors cause entry to the debugger when `debug-on-error' is non-nil. | ||
| 329 | This can be overridden by `debug-ignored-errors'. | ||
| 330 | |||
| 331 | To signal with MESSAGE without interpreting format characters | ||
| 332 | like `%', `\\=`' and `\\='', use (error \"%s\" MESSAGE). | ||
| 328 | In Emacs, the convention is that error messages start with a capital | 333 | In Emacs, the convention is that error messages start with a capital |
| 329 | letter but *do not* end with a period. Please follow this convention | 334 | letter but *do not* end with a period. Please follow this convention |
| 330 | for the sake of consistency. | 335 | for the sake of consistency." |
| 331 | Errors cause entry to the debugger when `debug-on-error' is | ||
| 332 | non-nil. This can be overridden by `debug-ignored-errors'. | ||
| 333 | |||
| 334 | Note: (error \"%s\" VALUE) makes the message VALUE without | ||
| 335 | interpreting format characters like `%', `\\=`', and `\\=''." | ||
| 336 | (declare (advertised-calling-convention (string &rest args) "23.1")) | 336 | (declare (advertised-calling-convention (string &rest args) "23.1")) |
| 337 | (signal 'error (list (apply #'format-message args)))) | 337 | (signal 'error (list (apply #'format-message args)))) |
| 338 | 338 | ||
| 339 | (defun user-error (format &rest args) | 339 | (defun user-error (format &rest args) |
| 340 | "Signal a user error, making a message by passing ARGS to `format-message'. | 340 | "Signal a user error, making a message by passing ARGS to `format-message'. |
| 341 | This is just like `error' except that `user-error's are expected to be the | 341 | This is like `error' except that a user error (or \"pilot error\") comes |
| 342 | result of an incorrect manipulation on the part of the user, rather than the | 342 | from an incorrect manipulation by the user, not from an actual problem. |
| 343 | result of an actual problem. | ||
| 344 | In Emacs, the convention is that error messages start with a capital | ||
| 345 | letter but *do not* end with a period. Please follow this convention | ||
| 346 | for the sake of consistency. | ||
| 347 | In contrast with other errors, user errors normally do not cause | 343 | In contrast with other errors, user errors normally do not cause |
| 348 | entry to the debugger, even when `debug-on-error' is non-nil. | 344 | entry to the debugger, even when `debug-on-error' is non-nil. |
| 349 | This can be overridden by `debug-ignored-errors'. | 345 | This can be overridden by `debug-ignored-errors'. |
| 350 | 346 | ||
| 351 | Note: (user-error \"%s\" VALUE) makes the message VALUE without | 347 | To signal with MESSAGE without interpreting format characters |
| 352 | interpreting format characters like `%', `\\=`', and `\\=''." | 348 | like `%', `\\=`' and `\\='', use (error \"%s\" MESSAGE). |
| 349 | In Emacs, the convention is that error messages start with a capital | ||
| 350 | letter but *do not* end with a period. Please follow this convention | ||
| 351 | for the sake of consistency." | ||
| 353 | (signal 'user-error (list (apply #'format-message format args)))) | 352 | (signal 'user-error (list (apply #'format-message format args)))) |
| 354 | 353 | ||
| 355 | (defun define-error (name message &optional parent) | 354 | (defun define-error (name message &optional parent) |