changeset 26947:7987a6499aaa

(debugger_may_continue): New variable. (syms_of_eval): Add a DEFVAR_BOOL for it. (call_debugger): Bind it.
author Gerd Moellmann <gerd@gnu.org>
date Sun, 19 Dec 1999 13:07:33 +0000
parents 9e0e23a92539
children 5385b12ef9a8
files src/eval.c
diffstat 1 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/eval.c	Sun Dec 19 11:22:35 1999 +0000
+++ b/src/eval.c	Sun Dec 19 13:07:33 1999 +0000
@@ -124,6 +124,12 @@
 /* Nonzero means enter debugger before next function call */
 int debug_on_next_call;
 
+/* Non-zero means debuffer may continue.  This is zero when the
+   debugger is called during redisplay, where it might not be safe to
+   continue the interrupted redisplay. */
+
+int debugger_may_continue;
+
 /* List of conditions (non-nil atom means all) which cause a backtrace
    if an error is handled by the command loop's error handler.  */
 Lisp_Object Vstack_trace_on_error;
@@ -197,6 +203,7 @@
      Lisp_Object arg;
 {
   int debug_while_redisplaying;
+  int count = specpdl_ptr - specpdl;
   Lisp_Object val;
   
   if (lisp_eval_depth + 20 > max_lisp_eval_depth)
@@ -212,6 +219,8 @@
      displayed if the debugger is invoked during redisplay.  */
   debug_while_redisplaying = redisplaying_p;
   redisplaying_p = 0;
+  specbind (intern ("debugger-may-continue"),
+	    debug_while_redisplaying ? Qnil : Qt);
   
   val = apply1 (Vdebugger, arg);
 
@@ -221,7 +230,7 @@
   if (debug_while_redisplaying)
     Ftop_level ();
 
-  return val;
+  return unbind_to (count, val);
 }
 
 void
@@ -3045,6 +3054,11 @@
   DEFVAR_BOOL ("debug-on-next-call", &debug_on_next_call,
     "Non-nil means enter debugger before next `eval', `apply' or `funcall'.");
 
+  DEFVAR_BOOL ("debugger-may-continue", &debugger_may_continue,
+    "Non-nil means debugger may continue execution.\n\
+This is nil when the debugger is called under circumstances where it\n\
+might not be safe to continue.");
+
   DEFVAR_LISP ("debugger", &Vdebugger,
     "Function to call to invoke debugger.\n\
 If due to frame exit, args are `exit' and the value being returned;\n\