diff options
| author | Lars Ingebrigtsen | 2021-07-21 16:53:54 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2021-07-21 16:53:54 +0200 |
| commit | da4b3973deb5eb271d79568092ad25560b65dbf8 (patch) | |
| tree | 6d38e326f3529472159b3aca3fa3ab9999d5e1a5 /src/eval.c | |
| parent | e3b8ddd5005903465ec86823559a2e884c7b13f2 (diff) | |
| download | emacs-da4b3973deb5eb271d79568092ad25560b65dbf8.tar.gz emacs-da4b3973deb5eb271d79568092ad25560b65dbf8.zip | |
Make `C-g' after `M-x' not give a backtrace unless required
* src/eval.c (signal_quit_p): New function.
(maybe_call_debugger): React to all `quit' signals (bug#49675).
* src/keyboard.c (cmd_error_internal, menu_item_eval_property_1):
Ditto.
Diffstat (limited to 'src/eval.c')
| -rw-r--r-- | src/eval.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/eval.c b/src/eval.c index b76ced79d61..ddf7e703fc2 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -2026,6 +2026,18 @@ skip_debugger (Lisp_Object conditions, Lisp_Object data) | |||
| 2026 | return 0; | 2026 | return 0; |
| 2027 | } | 2027 | } |
| 2028 | 2028 | ||
| 2029 | /* Say whether SIGNAL is a `quit' symbol (or inherits from it). */ | ||
| 2030 | bool | ||
| 2031 | signal_quit_p (Lisp_Object signal) | ||
| 2032 | { | ||
| 2033 | Lisp_Object list; | ||
| 2034 | |||
| 2035 | return EQ (signal, Qquit) | ||
| 2036 | || (Fsymbolp (signal) | ||
| 2037 | && CONSP (list = Fget (signal, Qerror_conditions)) | ||
| 2038 | && Fmemq (Qquit, list)); | ||
| 2039 | } | ||
| 2040 | |||
| 2029 | /* Call the debugger if calling it is currently enabled for CONDITIONS. | 2041 | /* Call the debugger if calling it is currently enabled for CONDITIONS. |
| 2030 | SIG and DATA describe the signal. There are two ways to pass them: | 2042 | SIG and DATA describe the signal. There are two ways to pass them: |
| 2031 | = SIG is the error symbol, and DATA is the rest of the data. | 2043 | = SIG is the error symbol, and DATA is the rest of the data. |
| @@ -2044,7 +2056,7 @@ maybe_call_debugger (Lisp_Object conditions, Lisp_Object sig, Lisp_Object data) | |||
| 2044 | ! input_blocked_p () | 2056 | ! input_blocked_p () |
| 2045 | && NILP (Vinhibit_debugger) | 2057 | && NILP (Vinhibit_debugger) |
| 2046 | /* Does user want to enter debugger for this kind of error? */ | 2058 | /* Does user want to enter debugger for this kind of error? */ |
| 2047 | && (EQ (sig, Qquit) | 2059 | && (signal_quit_p (sig) |
| 2048 | ? debug_on_quit | 2060 | ? debug_on_quit |
| 2049 | : wants_debugger (Vdebug_on_error, conditions)) | 2061 | : wants_debugger (Vdebug_on_error, conditions)) |
| 2050 | && ! skip_debugger (conditions, combined_data) | 2062 | && ! skip_debugger (conditions, combined_data) |