Variable: command-error-function

command-error-function is a variable defined in keyboard.c.

Value

help-command-error-confusable-suggestions

Documentation

Function to output error messages.

Called with three arguments:
- the error data, a list of the form (SIGNALED-CONDITION . SIGNAL-DATA)
  such as what condition-case would bind its variable to,
- 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).

View in manual

Probably introduced at or before Emacs version 22.1.

Source Code

// Defined in /usr/src/emacs/src/keyboard.c
  DEFVAR_LISP ("command-error-function", Vcommand_error_function,
	       doc: /* Function to output error messages.
Called with three arguments:
- the error data, a list of the form (SIGNALED-CONDITION . SIGNAL-DATA)
  such as what `condition-case' would bind its variable to,
- 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).  */);