diff options
| -rw-r--r-- | lisp/emacs-lisp/backtrace.el | 13 | ||||
| -rw-r--r-- | lisp/emacs-lisp/debug.el | 2 | ||||
| -rw-r--r-- | lisp/emacs-lisp/edebug.el | 3 | ||||
| -rw-r--r-- | lisp/emacs-lisp/ert.el | 3 |
4 files changed, 10 insertions, 11 deletions
diff --git a/lisp/emacs-lisp/backtrace.el b/lisp/emacs-lisp/backtrace.el index d16edb6a6cf..bcff14705c7 100644 --- a/lisp/emacs-lisp/backtrace.el +++ b/lisp/emacs-lisp/backtrace.el | |||
| @@ -146,7 +146,7 @@ This should be a list of `backtrace-frame' objects.") | |||
| 146 | 146 | ||
| 147 | (defvar-local backtrace-view nil | 147 | (defvar-local backtrace-view nil |
| 148 | "A plist describing how to render backtrace frames. | 148 | "A plist describing how to render backtrace frames. |
| 149 | Possible entries are :show-flags, :do-xrefs and :print-circle.") | 149 | Possible entries are :show-flags and :print-circle.") |
| 150 | 150 | ||
| 151 | (defvar-local backtrace-insert-header-function nil | 151 | (defvar-local backtrace-insert-header-function nil |
| 152 | "Function for inserting a header for the current Backtrace buffer. | 152 | "Function for inserting a header for the current Backtrace buffer. |
| @@ -591,14 +591,14 @@ property for use by navigation." | |||
| 591 | (insert (if (and (plist-get view :show-flags) flag) "* " " ")) | 591 | (insert (if (and (plist-get view :show-flags) flag) "* " " ")) |
| 592 | (put-text-property beg (point) 'backtrace-section 'func))) | 592 | (put-text-property beg (point) 'backtrace-section 'func))) |
| 593 | 593 | ||
| 594 | (defun backtrace--print-func-and-args (frame view) | 594 | (defun backtrace--print-func-and-args (frame _view) |
| 595 | "Print the function, arguments and buffer position of a backtrace FRAME. | 595 | "Print the function, arguments and buffer position of a backtrace FRAME. |
| 596 | Format it according to VIEW." | 596 | Format it according to VIEW." |
| 597 | (let* ((beg (point)) | 597 | (let* ((beg (point)) |
| 598 | (evald (backtrace-frame-evald frame)) | 598 | (evald (backtrace-frame-evald frame)) |
| 599 | (fun (backtrace-frame-fun frame)) | 599 | (fun (backtrace-frame-fun frame)) |
| 600 | (args (backtrace-frame-args frame)) | 600 | (args (backtrace-frame-args frame)) |
| 601 | (fun-file (and (plist-get view :do-xrefs) (symbol-file fun 'defun))) | 601 | (fun-file (symbol-file fun 'defun)) |
| 602 | (fun-pt (point))) | 602 | (fun-pt (point))) |
| 603 | (cond | 603 | (cond |
| 604 | ((and evald (not debugger-stack-frame-as-list)) | 604 | ((and evald (not debugger-stack-frame-as-list)) |
| @@ -707,15 +707,16 @@ creates a backtrace-mode buffer, should usually do the following: | |||
| 707 | - Maybe set `backtrace-insert-header-function' to a function to create | 707 | - Maybe set `backtrace-insert-header-function' to a function to create |
| 708 | header text for the buffer. | 708 | header text for the buffer. |
| 709 | - Set `backtrace-frames' (see below). | 709 | - Set `backtrace-frames' (see below). |
| 710 | - Set `backtrace-view' if desired (see below). | 710 | - Maybe modify `backtrace-view' (see below). |
| 711 | - Maybe set `backtrace-print-function'. | 711 | - Maybe set `backtrace-print-function'. |
| 712 | 712 | ||
| 713 | A command which creates or switches to a Backtrace mode buffer, | 713 | A command which creates or switches to a Backtrace mode buffer, |
| 714 | such as `ert-results-pop-to-backtrace-for-test-at-point', should | 714 | such as `ert-results-pop-to-backtrace-for-test-at-point', should |
| 715 | initialize `backtrace-frames' to a list of `backtrace-frame' | 715 | initialize `backtrace-frames' to a list of `backtrace-frame' |
| 716 | objects (`backtrace-get-frames' is provided for that purpose, if | 716 | objects (`backtrace-get-frames' is provided for that purpose, if |
| 717 | desired), and `backtrace-view' to a plist describing how it wants | 717 | desired), and may optionally modify `backtrace-view', which is a |
| 718 | the backtrace to appear. Finally, it should call `backtrace-print'. | 718 | plist describing the appearance of the backtrace. Finally, it |
| 719 | should call `backtrace-print'. | ||
| 719 | 720 | ||
| 720 | `backtrace-print' calls `backtrace-insert-header-function' | 721 | `backtrace-print' calls `backtrace-insert-header-function' |
| 721 | followed by `backtrace-print-frame', once for each stack frame." | 722 | followed by `backtrace-print-frame', once for each stack frame." |
diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el index 707e0cfa186..48ca32ddd83 100644 --- a/lisp/emacs-lisp/debug.el +++ b/lisp/emacs-lisp/debug.el | |||
| @@ -335,7 +335,7 @@ That buffer should be current already and in debugger-mode." | |||
| 335 | :debug-on-exit) | 335 | :debug-on-exit) |
| 336 | nil)) | 336 | nil)) |
| 337 | 337 | ||
| 338 | (setq backtrace-view '(:do-xrefs t :show-flags t) | 338 | (setq backtrace-view (plist-put backtrace-view :show-flags t) |
| 339 | backtrace-insert-header-function (lambda () | 339 | backtrace-insert-header-function (lambda () |
| 340 | (debugger--insert-header args)) | 340 | (debugger--insert-header args)) |
| 341 | backtrace-print-function debugger-print-function) | 341 | backtrace-print-function debugger-print-function) |
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index b22c8952da0..3bf9cb9a488 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el | |||
| @@ -4007,8 +4007,7 @@ Otherwise call `debug' normally." | |||
| 4007 | (with-current-buffer edebug-backtrace-buffer | 4007 | (with-current-buffer edebug-backtrace-buffer |
| 4008 | (unless (derived-mode-p 'backtrace-mode) | 4008 | (unless (derived-mode-p 'backtrace-mode) |
| 4009 | (backtrace-mode)) | 4009 | (backtrace-mode)) |
| 4010 | (setq backtrace-frames (edebug--backtrace-frames) | 4010 | (setq backtrace-frames (edebug--backtrace-frames)) |
| 4011 | backtrace-view '(:do-xrefs t)) | ||
| 4012 | (backtrace-print) | 4011 | (backtrace-print) |
| 4013 | (goto-char (point-min))))) | 4012 | (goto-char (point-min))))) |
| 4014 | 4013 | ||
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." | |||
| 2449 | (backtrace-mode)) | 2449 | (backtrace-mode)) |
| 2450 | (setq backtrace-insert-header-function | 2450 | (setq backtrace-insert-header-function |
| 2451 | (lambda () (ert--insert-backtrace-header (ert-test-name test))) | 2451 | (lambda () (ert--insert-backtrace-header (ert-test-name test))) |
| 2452 | backtrace-frames (ert-test-result-with-condition-backtrace result) | 2452 | backtrace-frames (ert-test-result-with-condition-backtrace result)) |
| 2453 | backtrace-view '(:do-xrefs t)) | ||
| 2454 | (backtrace-print) | 2453 | (backtrace-print) |
| 2455 | (goto-char (point-min))))))) | 2454 | (goto-char (point-min))))))) |
| 2456 | 2455 | ||