aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Templeton <[email protected]>2014-09-23 00:44:45 -0400
committerRobin Templeton <[email protected]>2015-04-20 00:29:03 -0400
commit792b3d23233b65eebe5ceeacc635175372de5fca (patch)
tree6e683eba796a9b6a5410ae4509418a850b1524c6
parent5fdac58a86e83e2d4bd272d7dd4959c3ef2100bd (diff)
cut debugger frames from backtraces
Thanks to Oleg Sivokon <[email protected]> for the report. * lisp/emacs-lisp/debug.el (debug-inner-cut): New variable. (debug-1): New function extracted from `debug'. (debug): Call `debug-1' in a new prompt, binding `debug-inner-cut' to the prompt tag. (debugger-setup-buffer): Cut the backtrace with `debug-inner-cut'.
-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.