aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2019-06-27 02:33:36 -0700
committerPaul Eggert2019-06-27 02:37:08 -0700
commit1d9bb2ff70ca65dbfdd2ec904b8f6d9e07a6e9c5 (patch)
treebb3d81f78013546d427e96efede2e6b5099acac1
parentf90e0c5661b921528e41fe2404689a7e90c16895 (diff)
downloademacs-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.el2
-rw-r--r--lisp/subr.el27
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'.
328Errors cause entry to the debugger when `debug-on-error' is non-nil.
329This can be overridden by `debug-ignored-errors'.
330
331To signal with MESSAGE without interpreting format characters
332like `%', `\\=`' and `\\='', use (error \"%s\" MESSAGE).
328In Emacs, the convention is that error messages start with a capital 333In Emacs, the convention is that error messages start with a capital
329letter but *do not* end with a period. Please follow this convention 334letter but *do not* end with a period. Please follow this convention
330for the sake of consistency. 335for the sake of consistency."
331Errors cause entry to the debugger when `debug-on-error' is
332non-nil. This can be overridden by `debug-ignored-errors'.
333
334Note: (error \"%s\" VALUE) makes the message VALUE without
335interpreting 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'.
341This is just like `error' except that `user-error's are expected to be the 341This is like `error' except that a user error (or \"pilot error\") comes
342result of an incorrect manipulation on the part of the user, rather than the 342from an incorrect manipulation by the user, not from an actual problem.
343result of an actual problem.
344In Emacs, the convention is that error messages start with a capital
345letter but *do not* end with a period. Please follow this convention
346for the sake of consistency.
347In contrast with other errors, user errors normally do not cause 343In contrast with other errors, user errors normally do not cause
348entry to the debugger, even when `debug-on-error' is non-nil. 344entry to the debugger, even when `debug-on-error' is non-nil.
349This can be overridden by `debug-ignored-errors'. 345This can be overridden by `debug-ignored-errors'.
350 346
351Note: (user-error \"%s\" VALUE) makes the message VALUE without 347To signal with MESSAGE without interpreting format characters
352interpreting format characters like `%', `\\=`', and `\\=''." 348like `%', `\\=`' and `\\='', use (error \"%s\" MESSAGE).
349In Emacs, the convention is that error messages start with a capital
350letter but *do not* end with a period. Please follow this convention
351for 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)