diff options
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/eval.c b/src/eval.c index 68b48f95a44..54a646b69e9 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1131,7 +1131,6 @@ unwind_to_catch (struct handler *catch, Lisp_Object value) /* Restore certain special C variables. */ set_poll_suppress_count (catch->poll_suppress_count); unblock_input_to (catch->interrupt_input_blocked); - immediate_quit = false; do { @@ -1462,6 +1461,19 @@ process_quit_flag (void) quit (); } +/* Check quit-flag and quit if it is non-nil. Typing C-g does not + directly cause a quit; it only sets Vquit_flag. So the program + needs to call maybe_quit at times when it is safe to quit. Every + loop that might run for a long time or might not exit ought to call + maybe_quit at least once, at a safe place. Unless that is + impossible, of course. But it is very desirable to avoid creating + loops where maybe_quit is impossible. + + If quit-flag is set to `kill-emacs' the SIGINT handler has received + a request to exit Emacs when it is safe to do. + + When not quitting, process any pending signals. */ + void maybe_quit (void) { @@ -1517,7 +1529,6 @@ signal_or_quit (Lisp_Object error_symbol, Lisp_Object data, bool keyboard_quit) Lisp_Object clause = Qnil; struct handler *h; - immediate_quit = false; if (gc_in_progress || waiting_for_input) emacs_abort (); |