like `%', `\\=`' and `\\='', use (error \"%s\" MESSAGE).
In Emacs, the convention is that error messages start with a capital
letter but *do not* end with a period. Please follow this convention
-for the sake of consistency."
+for the sake of consistency.
+
+To alter the look of the displayed error messages, you can use
+the `command-error-function' variable."
(declare (advertised-calling-convention (string &rest args) "23.1"))
(signal 'error (list (apply #'format-message args))))
like `%', `\\=`' and `\\='', use (user-error \"%s\" MESSAGE).
In Emacs, the convention is that error messages start with a capital
letter but *do not* end with a period. Please follow this convention
-for the sake of consistency."
+for the sake of consistency.
+
+To alter the look of the displayed error messages, you can use
+the `command-error-function' variable."
(signal 'user-error (list (apply #'format-message format args))))
(defun define-error (name message &optional parent)
- the context (a string which normally goes at the start of the message),
- the Lisp function within which the error was signaled.
+For instance, to make error messages stand out more in the echo area,
+you could say something like:
+
+ (setq command-error-function
+ (lambda (data _ _)
+ (message "%s" (propertize (error-message-string data)
+ \\='face \\='error))))
+
Also see `set-message-function' (which controls how non-error messages
are displayed). */);
Vcommand_error_function = intern ("command-error-default-function");