Function: signal

signal is a function defined in eval.c.

Signature

(signal ERROR-SYMBOL DATA)

Documentation

Signal an error. Args are ERROR-SYMBOL and associated DATA.

This function does not return.

When noninteractive is non-nil (in particular, in batch mode), an unhandled error calls kill-emacs, which terminates the Emacs session with a non-zero exit code.

An error symbol is a symbol with an error-conditions property that is a list of condition names. The symbol should be non-nil. A handler for any of those names will get to handle this signal. The symbol error should normally be one of them.

DATA should be a list. Its elements are printed as part of the error message. See Info anchor (elisp)Definition of signal for some details on how this error message is constructed. If the signal is handled, DATA is made available to the handler. See also the function condition-case.

View in manual

Probably introduced at or before Emacs version 17.

Source Code

// Defined in /usr/src/emacs/src/eval.c
{
  /* If they call us with nonsensical arguments, produce "peculiar error".  */
  if (NILP (error_symbol) && !CONSP (data))
    error_symbol = Qerror;
  signal_or_quit (error_symbol, data, false);
  eassume (false);
}