signal
code: eval.c
DEFUN ("signal", Fsignal, Ssignal, 2, 2, 0,
doc: /* Signal an error. Args are ERROR-SYMBOL and associated DATA.
This function does not return.
An error symbol is a symbol wi≤th 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'. */
attributes: noreturn)
(Lisp_Object error_symbol, Lisp_Object data)
{
/* If they call us with nonsensical arguments, produce "peculiar error". */
if (NILP (error_symbol) && NILP (data))
error_symbol = Qerror;
signal_or_quit (error_symbol, data, false);
eassume (false);
}
code: example.el
(signal 'dummy '("text"))
;; 両引数に nilを指定するとerrorになる
(signal nil nil)
;; 第1引数にnilで第2引数にシンボルのリストだとエラーにならない
(signal nil '(a))
(signal 'error '(a))