[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/backtrace-mode cf2dded 04/16: Always make buttons
From: |
Gemini Lasswell |
Subject: |
[Emacs-diffs] scratch/backtrace-mode cf2dded 04/16: Always make buttons from function names in backtraces |
Date: |
Fri, 27 Jul 2018 15:25:58 -0400 (EDT) |
branch: scratch/backtrace-mode
commit cf2dded8e7ee1cc2864735e7377d0c4b6b607b83
Author: Gemini Lasswell <address@hidden>
Commit: Gemini Lasswell <address@hidden>
Always make buttons from function names in backtraces
* lisp/emacs-lisp/backtrace.el (backtrace-view)
(backtrace--print-func-and-args, backtrace-mode): Always
make buttons. Remove all uses of ':do-xrefs'.
* lisp/emacs-lisp/debug.el (debugger-setup-buffer): Modify
backtrace-view instead of setting it.
* lisp/emacs-lisp/edebug.el (edebug-backtrace):
* lisp/emacs-lisp/ert.el
(ert-results-pop-to-backtrace-for-test-at-point):
Remove initialization of backtrace-view.
---
lisp/emacs-lisp/backtrace.el | 13 +++++++------
lisp/emacs-lisp/debug.el | 2 +-
lisp/emacs-lisp/edebug.el | 3 +--
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 d16edb6..bcff147 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.")
(defvar-local backtrace-view nil
"A plist describing how to render backtrace frames.
-Possible entries are :show-flags, :do-xrefs and :print-circle.")
+Possible entries are :show-flags and :print-circle.")
(defvar-local backtrace-insert-header-function nil
"Function for inserting a header for the current Backtrace buffer.
@@ -591,14 +591,14 @@ property for use by navigation."
(insert (if (and (plist-get view :show-flags) flag) "* " " "))
(put-text-property beg (point) 'backtrace-section 'func)))
-(defun backtrace--print-func-and-args (frame view)
+(defun backtrace--print-func-and-args (frame _view)
"Print the function, arguments and buffer position of a backtrace FRAME.
Format it according to VIEW."
(let* ((beg (point))
(evald (backtrace-frame-evald frame))
(fun (backtrace-frame-fun frame))
(args (backtrace-frame-args frame))
- (fun-file (and (plist-get view :do-xrefs) (symbol-file fun 'defun)))
+ (fun-file (symbol-file fun 'defun))
(fun-pt (point)))
(cond
((and evald (not debugger-stack-frame-as-list))
@@ -707,15 +707,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."
diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el
index 707e0cf..48ca32d 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."
:debug-on-exit)
nil))
- (setq backtrace-view '(:do-xrefs t :show-flags t)
+ (setq backtrace-view (plist-put backtrace-view :show-flags t)
backtrace-insert-header-function (lambda ()
(debugger--insert-header args))
backtrace-print-function debugger-print-function)
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el
index 7128370..9590695 100644
--- a/lisp/emacs-lisp/edebug.el
+++ b/lisp/emacs-lisp/edebug.el
@@ -3960,8 +3960,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 7178493..eb9695d 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)))))))
- [Emacs-diffs] branch scratch/backtrace-mode created (now 6b4f622), Gemini Lasswell, 2018/07/27
- [Emacs-diffs] scratch/backtrace-mode c7288cc 08/16: Add link in backtraces to position in buffer being evaluated (bug#14081), Gemini Lasswell, 2018/07/27
- [Emacs-diffs] scratch/backtrace-mode 80d1c52 06/16: Add prefix argument to backtrace-toggle-print-circle, Gemini Lasswell, 2018/07/27
- [Emacs-diffs] scratch/backtrace-mode b0e53a0 07/16: Add links in backtraces to functions written in C (bug#25393), Gemini Lasswell, 2018/07/27
- [Emacs-diffs] scratch/backtrace-mode 9f7943a 02/16: Add methods for strings to cl-print, Gemini Lasswell, 2018/07/27
- [Emacs-diffs] scratch/backtrace-mode 63af8c8 10/16: Change keybinding for backtrace-collapse from '=' to '-', Gemini Lasswell, 2018/07/27
- [Emacs-diffs] scratch/backtrace-mode cf2dded 04/16: Always make buttons from function names in backtraces,
Gemini Lasswell <=
- [Emacs-diffs] scratch/backtrace-mode 31cc6ce 13/16: Add a menu for backtrace-mode, Gemini Lasswell, 2018/07/27
- [Emacs-diffs] scratch/backtrace-mode 1d4502d 12/16: * lisp/emacs-lisp/debug.el (debugger-mode-map): Use easy-menu-define., Gemini Lasswell, 2018/07/27
- [Emacs-diffs] scratch/backtrace-mode 5d7034a 15/16: Move 'backtrace' from subr.el to backtrace.el, Gemini Lasswell, 2018/07/27
- [Emacs-diffs] scratch/backtrace-mode 6b4f622 16/16: Give two backtrace-mode commands better names, Gemini Lasswell, 2018/07/27
- [Emacs-diffs] scratch/backtrace-mode 1ff16de 05/16: Lazily print backtrace frame local variables, Gemini Lasswell, 2018/07/27
- [Emacs-diffs] scratch/backtrace-mode 50197e3 14/16: Add new commands to Edebug backtraces, Gemini Lasswell, 2018/07/27
- [Emacs-diffs] scratch/backtrace-mode d78464d 01/16: Support ellipsis expansion in cl-print, Gemini Lasswell, 2018/07/27
- [Emacs-diffs] scratch/backtrace-mode 06fc1ba 11/16: Add new command to expand all "..."s in a backtrace frame, Gemini Lasswell, 2018/07/27
- [Emacs-diffs] scratch/backtrace-mode 997d13a 09/16: Add more tests for backtrace-mode, Gemini Lasswell, 2018/07/27
- [Emacs-diffs] scratch/backtrace-mode 86d82db 03/16: Add backtrace-mode and use it in the debugger, ERT and Edebug, Gemini Lasswell, 2018/07/27