From: Gerd Moellmann Date: Wed, 8 Dec 1999 12:00:57 +0000 (+0000) Subject: (call_debugger): When entering the debugger while redisplaying, X-Git-Tag: emacs-pretest-21.0.90~5833 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3648c84252986145a376aa406bb83e987ea0e96b;p=emacs.git (call_debugger): When entering the debugger while redisplaying, reset redisplaying_p, and go back to the top-level if the debugger returns. --- diff --git a/src/ChangeLog b/src/ChangeLog index 2989c6a3a3e..e9752f527cc 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +1999-12-08 Gerd Moellmann + + * eval.c: Remove conditional compilation on `standalone'. + (call_debugger): When entering the debugger while redisplaying, + reset redisplaying_p, and go back to the top-level if the debugger + returns. + 1999-12-07 Gerd Moellmann * xfaces.c (x_set_menu_resources_from_menu_face): Make sure 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. */ #include - #include "lisp.h" #include "blockinput.h" - -#ifndef standalone #include "commands.h" #include "keyboard.h" -#else -#define INTERACTIVE 1 -#endif - +#include "dispextern.h" #include /* This definition is duplicated in alloc.c and keyboard.c */ @@ -202,13 +196,32 @@ Lisp_Object call_debugger (arg) Lisp_Object arg; { + int debug_while_redisplaying; + Lisp_Object val; + if (lisp_eval_depth + 20 > max_lisp_eval_depth) max_lisp_eval_depth = lisp_eval_depth + 20; + if (specpdl_size + 40 > max_specpdl_size) max_specpdl_size = specpdl_size + 40; + debug_on_next_call = 0; when_entered_debugger = num_nonmacro_input_events; - return apply1 (Vdebugger, arg); + + /* Resetting redisplaying_p to 0 makes sure that debug output is + displayed if the debugger is invoked during redisplay. */ + debug_while_redisplaying = redisplaying_p; + redisplaying_p = 0; + + val = apply1 (Vdebugger, arg); + + /* Interrupting redisplay and resuming it later is not safe under + all circumstances. So, when the debugger returns, abort the + interupted redisplay by going back to the top-level. */ + if (debug_while_redisplaying) + Ftop_level (); + + return val; } void