aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/emacs-lisp/debug.el11
1 files changed, 10 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el
index e3d5cdc341..61d8717791 100644
--- a/lisp/emacs-lisp/debug.el
+++ b/lisp/emacs-lisp/debug.el
@@ -125,6 +125,8 @@ where CAUSE can be:
- exit: called because of exit of a flagged function.
- error: called because of `debug-on-error'.")
+(defvar debug-inner-cut)
+
;;;###autoload
(setq debugger 'debug)
;;;###autoload
@@ -137,6 +139,13 @@ You may call with no args, or you may pass nil as the first arg and
any other args you like. In that case, the list of args after the
first will be printed into the backtrace buffer."
(interactive)
+ (let ((debug-inner-cut (funcall (@ (guile) make-prompt-tag))))
+ (funcall (@ (guile) call-with-prompt)
+ debug-inner-cut
+ (lambda () (apply #'debug-1 args))
+ (lambda (k &rest ignore) nil))))
+
+(defun debug-1 (&rest args)
(if inhibit-redisplay
;; Don't really try to enter debugger within an eval from redisplay.
debugger-value
@@ -274,7 +283,7 @@ That buffer should be current already."
(print-escape-newlines t)
(print-level 8)
(print-length 50))
- (backtrace))
+ (guile-backtrace debug-inner-cut 0 1))
(goto-char (point-min))
(insert "Debugger entered")
;; lambda is for debug-on-call when a function call is next.