diff options
Diffstat (limited to 'src/eval.c')
| -rw-r--r-- | src/eval.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/eval.c b/src/eval.c index e9f118c5cb9..fa7b2d06031 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -52,15 +52,6 @@ Lisp_Object Vautoload_queue; | |||
| 52 | is shutting down. */ | 52 | is shutting down. */ |
| 53 | Lisp_Object Vrun_hooks; | 53 | Lisp_Object Vrun_hooks; |
| 54 | 54 | ||
| 55 | /* The value of num_nonmacro_input_events as of the last time we | ||
| 56 | started to enter the debugger. If we decide to enter the debugger | ||
| 57 | again when this is still equal to num_nonmacro_input_events, then we | ||
| 58 | know that the debugger itself has an error, and we should just | ||
| 59 | signal the error instead of entering an infinite loop of debugger | ||
| 60 | invocations. */ | ||
| 61 | |||
| 62 | static intmax_t when_entered_debugger; | ||
| 63 | |||
| 64 | /* The function from which the last `signal' was called. Set in | 55 | /* The function from which the last `signal' was called. Set in |
| 65 | Fsignal. */ | 56 | Fsignal. */ |
| 66 | /* FIXME: We should probably get rid of this! */ | 57 | /* FIXME: We should probably get rid of this! */ |
| @@ -1835,7 +1826,8 @@ maybe_call_debugger (Lisp_Object conditions, Lisp_Object sig, Lisp_Object data) | |||
| 1835 | ? debug_on_quit | 1826 | ? debug_on_quit |
| 1836 | : wants_debugger (Vdebug_on_error, conditions)) | 1827 | : wants_debugger (Vdebug_on_error, conditions)) |
| 1837 | && ! skip_debugger (conditions, combined_data) | 1828 | && ! skip_debugger (conditions, combined_data) |
| 1838 | /* RMS: What's this for? */ | 1829 | /* See commentary on definition of |
| 1830 | `internal-when-entered-debugger'. */ | ||
| 1839 | && when_entered_debugger < num_nonmacro_input_events) | 1831 | && when_entered_debugger < num_nonmacro_input_events) |
| 1840 | { | 1832 | { |
| 1841 | call_debugger (list2 (Qerror, combined_data)); | 1833 | call_debugger (list2 (Qerror, combined_data)); |
| @@ -4170,6 +4162,18 @@ Note that `debug-on-error', `debug-on-quit' and friends | |||
| 4170 | still determine whether to handle the particular condition. */); | 4162 | still determine whether to handle the particular condition. */); |
| 4171 | Vdebug_on_signal = Qnil; | 4163 | Vdebug_on_signal = Qnil; |
| 4172 | 4164 | ||
| 4165 | /* The value of num_nonmacro_input_events as of the last time we | ||
| 4166 | started to enter the debugger. If we decide to enter the debugger | ||
| 4167 | again when this is still equal to num_nonmacro_input_events, then we | ||
| 4168 | know that the debugger itself has an error, and we should just | ||
| 4169 | signal the error instead of entering an infinite loop of debugger | ||
| 4170 | invocations. */ | ||
| 4171 | DEFSYM (Qinternal_when_entered_debugger, "internal-when-entered-debugger"); | ||
| 4172 | DEFVAR_INT ("internal-when-entered-debugger", when_entered_debugger, | ||
| 4173 | doc: /* The number of keyboard events as of last time `debugger' was called. | ||
| 4174 | Used to avoid infinite loops if the debugger itself has an error. | ||
| 4175 | Don't set this unless you're sure that can't happen. */); | ||
| 4176 | |||
| 4173 | /* When lexical binding is being used, | 4177 | /* When lexical binding is being used, |
| 4174 | Vinternal_interpreter_environment is non-nil, and contains an alist | 4178 | Vinternal_interpreter_environment is non-nil, and contains an alist |
| 4175 | of lexically-bound variable, or (t), indicating an empty | 4179 | of lexically-bound variable, or (t), indicating an empty |