- 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
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
(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.