diff options
| author | Gerd Moellmann | 1999-12-08 12:00:57 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 1999-12-08 12:00:57 +0000 |
| commit | 3648c84252986145a376aa406bb83e987ea0e96b (patch) | |
| tree | 207bb4ec0b47b0e0643c42f38ab460aff9631654 /src/eval.c | |
| parent | 3e569d228e68690d53bea93614652dc39d8289fd (diff) | |
| download | emacs-3648c84252986145a376aa406bb83e987ea0e96b.tar.gz emacs-3648c84252986145a376aa406bb83e987ea0e96b.zip | |
(call_debugger): When entering the debugger while redisplaying,
reset redisplaying_p, and go back to the top-level if the debugger
returns.
Diffstat (limited to 'src/eval.c')
| -rw-r--r-- | src/eval.c | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/src/eval.c b/src/eval.c index f911433e712..0fb517aef2b 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -20,17 +20,11 @@ Boston, MA 02111-1307, USA. */ | |||
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | #include <config.h> | 22 | #include <config.h> |
| 23 | |||
| 24 | #include "lisp.h" | 23 | #include "lisp.h" |
| 25 | #include "blockinput.h" | 24 | #include "blockinput.h" |
| 26 | |||
| 27 | #ifndef standalone | ||
| 28 | #include "commands.h" | 25 | #include "commands.h" |
| 29 | #include "keyboard.h" | 26 | #include "keyboard.h" |
| 30 | #else | 27 | #include "dispextern.h" |
| 31 | #define INTERACTIVE 1 | ||
| 32 | #endif | ||
| 33 | |||
| 34 | #include <setjmp.h> | 28 | #include <setjmp.h> |
| 35 | 29 | ||
| 36 | /* This definition is duplicated in alloc.c and keyboard.c */ | 30 | /* This definition is duplicated in alloc.c and keyboard.c */ |
| @@ -202,13 +196,32 @@ Lisp_Object | |||
| 202 | call_debugger (arg) | 196 | call_debugger (arg) |
| 203 | Lisp_Object arg; | 197 | Lisp_Object arg; |
| 204 | { | 198 | { |
| 199 | int debug_while_redisplaying; | ||
| 200 | Lisp_Object val; | ||
| 201 | |||
| 205 | if (lisp_eval_depth + 20 > max_lisp_eval_depth) | 202 | if (lisp_eval_depth + 20 > max_lisp_eval_depth) |
| 206 | max_lisp_eval_depth = lisp_eval_depth + 20; | 203 | max_lisp_eval_depth = lisp_eval_depth + 20; |
| 204 | |||
| 207 | if (specpdl_size + 40 > max_specpdl_size) | 205 | if (specpdl_size + 40 > max_specpdl_size) |
| 208 | max_specpdl_size = specpdl_size + 40; | 206 | max_specpdl_size = specpdl_size + 40; |
| 207 | |||
| 209 | debug_on_next_call = 0; | 208 | debug_on_next_call = 0; |
| 210 | when_entered_debugger = num_nonmacro_input_events; | 209 | when_entered_debugger = num_nonmacro_input_events; |
| 211 | return apply1 (Vdebugger, arg); | 210 | |
| 211 | /* Resetting redisplaying_p to 0 makes sure that debug output is | ||
| 212 | displayed if the debugger is invoked during redisplay. */ | ||
| 213 | debug_while_redisplaying = redisplaying_p; | ||
| 214 | redisplaying_p = 0; | ||
| 215 | |||
| 216 | val = apply1 (Vdebugger, arg); | ||
| 217 | |||
| 218 | /* Interrupting redisplay and resuming it later is not safe under | ||
| 219 | all circumstances. So, when the debugger returns, abort the | ||
| 220 | interupted redisplay by going back to the top-level. */ | ||
| 221 | if (debug_while_redisplaying) | ||
| 222 | Ftop_level (); | ||
| 223 | |||
| 224 | return val; | ||
| 212 | } | 225 | } |
| 213 | 226 | ||
| 214 | void | 227 | void |