diff options
Diffstat (limited to 'lisp/subr.el')
| -rw-r--r-- | lisp/subr.el | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lisp/subr.el b/lisp/subr.el index f67f70f85c9..094710b026c 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -291,21 +291,27 @@ This function accepts any number of arguments, but ignores them." | |||
| 291 | 291 | ||
| 292 | ;; Signal a compile-error if the first arg is missing. | 292 | ;; Signal a compile-error if the first arg is missing. |
| 293 | (defun error (&rest args) | 293 | (defun error (&rest args) |
| 294 | "Signal an error, making error message by passing all args to `format'. | 294 | "Signal an error, making a message by passing args to `format-message'. |
| 295 | In Emacs, the convention is that error messages start with a capital | 295 | In Emacs, the convention is that error messages start with a capital |
| 296 | letter but *do not* end with a period. Please follow this convention | 296 | letter but *do not* end with a period. Please follow this convention |
| 297 | for the sake of consistency." | 297 | for the sake of consistency. |
| 298 | |||
| 299 | Note: (error \"%s\" VALUE) makes the message VALUE without | ||
| 300 | interpreting format characters like `%', `\\=`', and `\\=''." | ||
| 298 | (declare (advertised-calling-convention (string &rest args) "23.1")) | 301 | (declare (advertised-calling-convention (string &rest args) "23.1")) |
| 299 | (signal 'error (list (apply #'format-message args)))) | 302 | (signal 'error (list (apply #'format-message args)))) |
| 300 | 303 | ||
| 301 | (defun user-error (format &rest args) | 304 | (defun user-error (format &rest args) |
| 302 | "Signal a pilot error, making error message by passing all args to `format'. | 305 | "Signal a pilot error, making a message by passing args to `format-message'. |
| 303 | In Emacs, the convention is that error messages start with a capital | 306 | In Emacs, the convention is that error messages start with a capital |
| 304 | letter but *do not* end with a period. Please follow this convention | 307 | letter but *do not* end with a period. Please follow this convention |
| 305 | for the sake of consistency. | 308 | for the sake of consistency. |
| 306 | This is just like `error' except that `user-error's are expected to be the | 309 | This is just like `error' except that `user-error's are expected to be the |
| 307 | result of an incorrect manipulation on the part of the user, rather than the | 310 | result of an incorrect manipulation on the part of the user, rather than the |
| 308 | result of an actual problem." | 311 | result of an actual problem. |
| 312 | |||
| 313 | Note: (user-error \"%s\" VALUE) makes the message VALUE without | ||
| 314 | interpreting format characters like `%', `\\=`', and `\\=''." | ||
| 309 | (signal 'user-error (list (apply #'format-message format args)))) | 315 | (signal 'user-error (list (apply #'format-message format args)))) |
| 310 | 316 | ||
| 311 | (defun define-error (name message &optional parent) | 317 | (defun define-error (name message &optional parent) |
| @@ -1123,6 +1129,7 @@ The return value is a positive integer." | |||
| 1123 | 1129 | ||
| 1124 | (defun posnp (obj) | 1130 | (defun posnp (obj) |
| 1125 | "Return non-nil if OBJ appears to be a valid `posn' object specifying a window. | 1131 | "Return non-nil if OBJ appears to be a valid `posn' object specifying a window. |
| 1132 | A `posn' object is returned from functions such as `event-start'. | ||
| 1126 | If OBJ is a valid `posn' object, but specifies a frame rather | 1133 | If OBJ is a valid `posn' object, but specifies a frame rather |
| 1127 | than a window, return nil." | 1134 | than a window, return nil." |
| 1128 | ;; FIXME: Correct the behavior of this function so that all valid | 1135 | ;; FIXME: Correct the behavior of this function so that all valid |