aboutsummaryrefslogtreecommitdiffstats
path: root/src/keyboard.c
diff options
context:
space:
mode:
authorPaul Eggert2016-07-24 11:10:09 +0200
committerPaul Eggert2016-07-25 00:38:34 +0200
commit50cc08bf6e6cdc96dcdcbef388cf9cf76a15f81a (patch)
tree9cfd5f799262e0ba85d7213113bdb20302196e74 /src/keyboard.c
parent2c2b0cd07c143e33af9f7237ef4819c28764a90f (diff)
downloademacs-50cc08bf6e6cdc96dcdcbef388cf9cf76a15f81a.tar.gz
emacs-50cc08bf6e6cdc96dcdcbef388cf9cf76a15f81a.zip
‘signal’ no longer returns
Although for decades ‘signal’ has been documented to not return, a corner case in the Lisp debugger causes ‘signal’ to return. Remove the corner case and adjust Emacs internals accordingly. An alternative would be to document the corner case, but this would complicate the Lisp API unnecessarily. (Bug#24047) * src/eval.c (signal_or_quit): New function, with most of the old contents of Fsignal. (quit): New function, which uses signal_or_quit and which might return. All keyboard-based callers of Fsignal (Qquit, Qnil) changed to use this new function instead. (Fsignal): Use signal_or_quit. Now _Noreturn. All callers changed. (xsignal): Move to lisp.h. * src/lisp.h (xsignal): Now an inline function, as it's now just an alias for Fsignal.
Diffstat (limited to 'src/keyboard.c')
-rw-r--r--src/keyboard.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 8901ff055e7..ed4968486c3 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -696,7 +696,7 @@ recursive_edit_1 (void)
696 696
697 val = command_loop (); 697 val = command_loop ();
698 if (EQ (val, Qt)) 698 if (EQ (val, Qt))
699 Fsignal (Qquit, Qnil); 699 quit ();
700 /* Handle throw from read_minibuf when using minibuffer 700 /* Handle throw from read_minibuf when using minibuffer
701 while it's active but we're in another window. */ 701 while it's active but we're in another window. */
702 if (STRINGP (val)) 702 if (STRINGP (val))
@@ -7581,7 +7581,7 @@ menu_item_eval_property_1 (Lisp_Object arg)
7581 /* If we got a quit from within the menu computation, 7581 /* If we got a quit from within the menu computation,
7582 quit all the way out of it. This takes care of C-] in the debugger. */ 7582 quit all the way out of it. This takes care of C-] in the debugger. */
7583 if (CONSP (arg) && EQ (XCAR (arg), Qquit)) 7583 if (CONSP (arg) && EQ (XCAR (arg), Qquit))
7584 Fsignal (Qquit, Qnil); 7584 quit ();
7585 7585
7586 return Qnil; 7586 return Qnil;
7587} 7587}
@@ -10407,7 +10407,7 @@ handle_interrupt (bool in_signal_handler)
10407 immediate_quit = false; 10407 immediate_quit = false;
10408 pthread_sigmask (SIG_SETMASK, &empty_mask, 0); 10408 pthread_sigmask (SIG_SETMASK, &empty_mask, 0);
10409 saved = gl_state; 10409 saved = gl_state;
10410 Fsignal (Qquit, Qnil); 10410 quit ();
10411 gl_state = saved; 10411 gl_state = saved;
10412 } 10412 }
10413 else 10413 else