summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGemini Lasswell <gazally@runbox.com>2018-06-24 07:17:47 -0700
committerGemini Lasswell <gazally@runbox.com>2018-07-14 08:56:21 -0700
commit86f69ed5a3a8787400424e56541af4307dd619f4 (patch)
tree80326bfe86af07d61aa56759c3af7e54f5691d56
parent6c62b9e91e14599c6ee2a0137d3388f47166c28c (diff)
downloademacs-86f69ed5a3a8787400424e56541af4307dd619f4.tar.gz
Initialize backtrace display options in backtrace-mode
* lisp/emacs-lisp/backtrace.el (backtrace-mode): Initialize backtrace-view. * lisp/emacs-lisp/debug.el (debugger-setup-buffer): Modify backtrace-view instead of setting it. * lisp/emacs-lisp/edebug.el (edebug-backtrace): Remove initialization of backtrace-view. * lisp/emacs-lisp/ert.el (ert-results-pop-to-backtrace-for-test-at-point): Remove initialization of backtrace-view.
-rw-r--r--lisp/emacs-lisp/backtrace.el8
-rw-r--r--lisp/emacs-lisp/debug.el4
-rw-r--r--lisp/emacs-lisp/edebug.el3
-rw-r--r--lisp/emacs-lisp/ert.el3
4 files changed, 9 insertions, 9 deletions
diff --git a/lisp/emacs-lisp/backtrace.el b/lisp/emacs-lisp/backtrace.el
index e4380b6f3ec..5fc436e8ec1 100644
--- a/lisp/emacs-lisp/backtrace.el
+++ b/lisp/emacs-lisp/backtrace.el
@@ -738,15 +738,16 @@ creates a backtrace-mode buffer, should usually do the following:
- Maybe set `backtrace-insert-header-function' to a function to create
header text for the buffer.
- Set `backtrace-frames' (see below).
- - Set `backtrace-view' if desired (see below).
+ - Maybe modify `backtrace-view' (see below).
- Maybe set `backtrace-print-function'.
A command which creates or switches to a Backtrace mode buffer,
such as `ert-results-pop-to-backtrace-for-test-at-point', should
initialize `backtrace-frames' to a list of `backtrace-frame'
objects (`backtrace-get-frames' is provided for that purpose, if
-desired), and `backtrace-view' to a plist describing how it wants
-the backtrace to appear. Finally, it should call `backtrace-print'.
+desired), and may optionally modify `backtrace-view', which is a
+plist describing the appearance of the backtrace. Finally, it
+should call `backtrace-print'.
`backtrace-print' calls `backtrace-insert-header-function'
followed by `backtrace-print-frame', once for each stack frame."
@@ -767,6 +768,7 @@ followed by `backtrace-print-frame', once for each stack frame."
;; was because of bytecode. Since 2009 it's been set to t, but the
;; default is t so I think this isn't necessary.
;; (set-buffer-multibyte t)
+ (setq backtrace-view (list :do-xrefs t))
(setq-local revert-buffer-function #'backtrace-revert)
(setq-local filter-buffer-substring-function #'backtrace--filter-visible)
(add-hook 'xref-backend-functions #'backtrace--xref-backend nil t))
diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el
index 707e0cfa186..2d8a8387a24 100644
--- a/lisp/emacs-lisp/debug.el
+++ b/lisp/emacs-lisp/debug.el
@@ -335,10 +335,10 @@ That buffer should be current already and in debugger-mode."
:debug-on-exit)
nil))
- (setq backtrace-view '(:do-xrefs t :show-flags t)
- backtrace-insert-header-function (lambda ()
+ (setq backtrace-insert-header-function (lambda ()
(debugger--insert-header args))
backtrace-print-function debugger-print-function)
+ (plist-put backtrace-view :show-flags t)
(backtrace-print)
;; Place point on "stack frame 0" (bug#15101).
(goto-char (point-min))
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el
index 465ba1b06d2..15bf05bd1a7 100644
--- a/lisp/emacs-lisp/edebug.el
+++ b/lisp/emacs-lisp/edebug.el
@@ -3959,8 +3959,7 @@ Otherwise call `debug' normally."
(with-current-buffer edebug-backtrace-buffer
(unless (derived-mode-p 'backtrace-mode)
(backtrace-mode))
- (setq backtrace-frames (edebug--backtrace-frames)
- backtrace-view '(:do-xrefs t))
+ (setq backtrace-frames (edebug--backtrace-frames))
(backtrace-print)
(goto-char (point-min)))))
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index 7178493ebe5..eb9695d0c12 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -2449,8 +2449,7 @@ To be used in the ERT results buffer."
(backtrace-mode))
(setq backtrace-insert-header-function
(lambda () (ert--insert-backtrace-header (ert-test-name test)))
- backtrace-frames (ert-test-result-with-condition-backtrace result)
- backtrace-view '(:do-xrefs t))
+ backtrace-frames (ert-test-result-with-condition-backtrace result))
(backtrace-print)
(goto-char (point-min)))))))