diff options
| author | Gerd Moellmann | 1999-12-19 13:07:33 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 1999-12-19 13:07:33 +0000 |
| commit | 556d73147ef6a0e505d8ff651e9cd48e5fa571ca (patch) | |
| tree | 6e244b57609bbf84984500638272679d9dfb2a0e /src/eval.c | |
| parent | 3b6207313b75639a5f230b1708e59b9eaef39c2d (diff) | |
| download | emacs-556d73147ef6a0e505d8ff651e9cd48e5fa571ca.tar.gz emacs-556d73147ef6a0e505d8ff651e9cd48e5fa571ca.zip | |
(debugger_may_continue): New variable.
(syms_of_eval): Add a DEFVAR_BOOL for it.
(call_debugger): Bind it.
Diffstat (limited to 'src/eval.c')
| -rw-r--r-- | src/eval.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/eval.c b/src/eval.c index 0fb517aef2b..7fd655bb8bd 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -124,6 +124,12 @@ int max_lisp_eval_depth; | |||
| 124 | /* Nonzero means enter debugger before next function call */ | 124 | /* Nonzero means enter debugger before next function call */ |
| 125 | int debug_on_next_call; | 125 | int debug_on_next_call; |
| 126 | 126 | ||
| 127 | /* Non-zero means debuffer may continue. This is zero when the | ||
| 128 | debugger is called during redisplay, where it might not be safe to | ||
| 129 | continue the interrupted redisplay. */ | ||
| 130 | |||
| 131 | int debugger_may_continue; | ||
| 132 | |||
| 127 | /* List of conditions (non-nil atom means all) which cause a backtrace | 133 | /* List of conditions (non-nil atom means all) which cause a backtrace |
| 128 | if an error is handled by the command loop's error handler. */ | 134 | if an error is handled by the command loop's error handler. */ |
| 129 | Lisp_Object Vstack_trace_on_error; | 135 | Lisp_Object Vstack_trace_on_error; |
| @@ -197,6 +203,7 @@ call_debugger (arg) | |||
| 197 | Lisp_Object arg; | 203 | Lisp_Object arg; |
| 198 | { | 204 | { |
| 199 | int debug_while_redisplaying; | 205 | int debug_while_redisplaying; |
| 206 | int count = specpdl_ptr - specpdl; | ||
| 200 | Lisp_Object val; | 207 | Lisp_Object val; |
| 201 | 208 | ||
| 202 | if (lisp_eval_depth + 20 > max_lisp_eval_depth) | 209 | if (lisp_eval_depth + 20 > max_lisp_eval_depth) |
| @@ -212,6 +219,8 @@ call_debugger (arg) | |||
| 212 | displayed if the debugger is invoked during redisplay. */ | 219 | displayed if the debugger is invoked during redisplay. */ |
| 213 | debug_while_redisplaying = redisplaying_p; | 220 | debug_while_redisplaying = redisplaying_p; |
| 214 | redisplaying_p = 0; | 221 | redisplaying_p = 0; |
| 222 | specbind (intern ("debugger-may-continue"), | ||
| 223 | debug_while_redisplaying ? Qnil : Qt); | ||
| 215 | 224 | ||
| 216 | val = apply1 (Vdebugger, arg); | 225 | val = apply1 (Vdebugger, arg); |
| 217 | 226 | ||
| @@ -221,7 +230,7 @@ call_debugger (arg) | |||
| 221 | if (debug_while_redisplaying) | 230 | if (debug_while_redisplaying) |
| 222 | Ftop_level (); | 231 | Ftop_level (); |
| 223 | 232 | ||
| 224 | return val; | 233 | return unbind_to (count, val); |
| 225 | } | 234 | } |
| 226 | 235 | ||
| 227 | void | 236 | void |
| @@ -3045,6 +3054,11 @@ Does not apply if quit is handled by a `condition-case'."); | |||
| 3045 | DEFVAR_BOOL ("debug-on-next-call", &debug_on_next_call, | 3054 | DEFVAR_BOOL ("debug-on-next-call", &debug_on_next_call, |
| 3046 | "Non-nil means enter debugger before next `eval', `apply' or `funcall'."); | 3055 | "Non-nil means enter debugger before next `eval', `apply' or `funcall'."); |
| 3047 | 3056 | ||
| 3057 | DEFVAR_BOOL ("debugger-may-continue", &debugger_may_continue, | ||
| 3058 | "Non-nil means debugger may continue execution.\n\ | ||
| 3059 | This is nil when the debugger is called under circumstances where it\n\ | ||
| 3060 | might not be safe to continue."); | ||
| 3061 | |||
| 3048 | DEFVAR_LISP ("debugger", &Vdebugger, | 3062 | DEFVAR_LISP ("debugger", &Vdebugger, |
| 3049 | "Function to call to invoke debugger.\n\ | 3063 | "Function to call to invoke debugger.\n\ |
| 3050 | If due to frame exit, args are `exit' and the value being returned;\n\ | 3064 | If due to frame exit, args are `exit' and the value being returned;\n\ |