Vquit_flag = Qnil; \
if (EQ (Vthrow_on_input, flag)) \
Fthrow (Vthrow_on_input, Qt); \
- Fsignal (Qquit, Qnil); \
+ quit (); \
} \
else if (pending_signals) \
process_pending_signals (); \
int nchars;
if (nargs != charset_arg_max)
- return Fsignal (Qwrong_number_of_arguments,
- Fcons (intern ("define-charset-internal"),
- make_number (nargs)));
+ Fsignal (Qwrong_number_of_arguments,
+ Fcons (intern ("define-charset-internal"),
+ make_number (nargs)));
attrs = Fmake_vector (make_number (charset_attr_max), Qnil);
return Qnil;
short_args:
- return Fsignal (Qwrong_number_of_arguments,
- Fcons (intern ("define-coding-system-internal"),
- make_number (nargs)));
+ Fsignal (Qwrong_number_of_arguments,
+ Fcons (intern ("define-coding-system-internal"),
+ make_number (nargs)));
}
}
\f
+static Lisp_Object signal_or_quit (Lisp_Object, Lisp_Object, bool);
static Lisp_Object find_handler_clause (Lisp_Object, Lisp_Object);
static bool maybe_call_debugger (Lisp_Object conditions, Lisp_Object sig,
Lisp_Object data);
Fkill_emacs (Qnil);
if (EQ (Vthrow_on_input, flag))
Fthrow (Vthrow_on_input, Qt);
- Fsignal (Qquit, Qnil);
+ quit ();
}
DEFUN ("signal", Fsignal, Ssignal, 2, 2, 0,
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'. */)
+See also the function `condition-case'. */
+ attributes: noreturn)
(Lisp_Object error_symbol, Lisp_Object data)
+{
+ signal_or_quit (error_symbol, data, false);
+ eassume (false);
+}
+
+/* Quit, in response to a keyboard quit request. */
+Lisp_Object
+quit (void)
+{
+ return signal_or_quit (Qquit, Qnil, true);
+}
+
+/* Signal an error, or quit. ERROR_SYMBOL and DATA are as with Fsignal.
+ If KEYBOARD_QUIT, this is a quit; ERROR_SYMBOL should be
+ Qquit and DATA should be Qnil, and this function may return.
+ Otherwise this function is like Fsignal and does not return. */
+
+static Lisp_Object
+signal_or_quit (Lisp_Object error_symbol, Lisp_Object data, bool keyboard_quit)
{
/* When memory is full, ERROR-SYMBOL is nil,
and DATA is (REAL-ERROR-SYMBOL . REAL-DATA).
= maybe_call_debugger (conditions, error_symbol, data);
/* We can't return values to code which signaled an error, but we
can continue code which has signaled a quit. */
- if (debugger_called && EQ (real_error_symbol, Qquit))
+ if (keyboard_quit && debugger_called && EQ (real_error_symbol, Qquit))
return Qnil;
}
fatal ("%s", SDATA (string));
}
-/* Internal version of Fsignal that never returns.
- Used for anything but Qquit (which can return from Fsignal). */
-
-void
-xsignal (Lisp_Object error_symbol, Lisp_Object data)
-{
- Fsignal (error_symbol, data);
- emacs_abort ();
-}
-
/* Like xsignal, but takes 0, 1, 2, or 3 args instead of a list. */
void
PT - BEG, Z - PT - inserted);
if (read_quit)
- Fsignal (Qquit, Qnil);
+ quit ();
/* Retval needs to be dealt with in all cases consistently. */
if (NILP (val))
val = command_loop ();
if (EQ (val, Qt))
- Fsignal (Qquit, Qnil);
+ quit ();
/* Handle throw from read_minibuf when using minibuffer
while it's active but we're in another window. */
if (STRINGP (val))
/* If we got a quit from within the menu computation,
quit all the way out of it. This takes care of C-] in the debugger. */
if (CONSP (arg) && EQ (XCAR (arg), Qquit))
- Fsignal (Qquit, Qnil);
+ quit ();
return Qnil;
}
immediate_quit = false;
pthread_sigmask (SIG_SETMASK, &empty_mask, 0);
saved = gl_state;
- Fsignal (Qquit, Qnil);
+ quit ();
gl_state = saved;
}
else
extern Lisp_Object run_hook_with_args (ptrdiff_t nargs, Lisp_Object *args,
Lisp_Object (*funcall)
(ptrdiff_t nargs, Lisp_Object *args));
-extern _Noreturn void xsignal (Lisp_Object, Lisp_Object);
+extern Lisp_Object quit (void);
+INLINE _Noreturn void
+xsignal (Lisp_Object error_symbol, Lisp_Object data)
+{
+ Fsignal (error_symbol, data);
+}
extern _Noreturn void xsignal0 (Lisp_Object);
extern _Noreturn void xsignal1 (Lisp_Object, Lisp_Object);
extern _Noreturn void xsignal2 (Lisp_Object, Lisp_Object, Lisp_Object);
if (EQ (ret, Qundefined) && window_closed)
/* Make close button pressed equivalent to C-g. */
- Fsignal (Qquit, Qnil);
+ quit ();
return ret;
}
/* Make "Cancel" equivalent to C-g unless FOR_CLICK (which means
the menu was invoked with a mouse event as POSITION). */
if (!(menuflags & MENU_FOR_CLICK))
- Fsignal (Qquit, Qnil);
+ quit ();
break;
}
/* Make "Cancel" equivalent to C-g. */
if (NILP (filename))
- Fsignal (Qquit, Qnil);
+ quit ();
return filename;
}
{
unblock_input ();
/* Make "Cancel" equivalent to C-g. */
- Fsignal (Qquit, Qnil);
+ quit ();
}
unblock_input ();
}
else
/* Make "Cancel" equivalent to C-g. */
- Fsignal (Qquit, Qnil);
+ quit ();
return Qnil;
}
else if (answer == IDNO)
lispy_answer = build_string ("No");
else
- Fsignal (Qquit, Qnil);
+ quit ();
for (temp = XCDR (contents); CONSP (temp); temp = XCDR (temp))
{
return value;
}
}
- Fsignal (Qquit, Qnil);
- return Qnil;
+ return quit ();
}
#endif /* !HAVE_DIALOGS */
\f
/* Make "Cancel" equivalent to C-g. */
if (NILP (file))
- Fsignal (Qquit, Qnil);
+ quit ();
decoded_file = DECODE_FILE (file);
/* Make "Cancel" equivalent to C-g. */
if (NILP (file))
- Fsignal (Qquit, Qnil);
+ quit ();
decoded_file = DECODE_FILE (file);
unblock_input ();
if (NILP (font))
- Fsignal (Qquit, Qnil);
+ quit ();
return unbind_to (count, font);
}
{
unblock_input ();
/* Make "Cancel" equivalent to C-g. */
- Fsignal (Qquit, Qnil);
+ quit ();
}
unblock_input ();
}
else
/* Make "Cancel" equivalent to C-g. */
- Fsignal (Qquit, Qnil);
+ quit ();
return Qnil;
}
if (!(menuflags & MENU_FOR_CLICK))
{
unblock_input ();
- Fsignal (Qquit, Qnil);
+ quit ();
}
break;
}