summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2022-09-09 19:29:21 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2022-09-09 19:29:21 +0200
commit04a6fd378f0996c14c3cf9e4905f56df231aa500 (patch)
tree7efe4f78cabf5cfa0c0c67705a3a816f0047b93b
parent4cc78bcfd1f82829b92dff53abf4adf45641b4b2 (diff)
downloademacs-04a6fd378f0996c14c3cf9e4905f56df231aa500.tar.gz
Don't bind `s' in the normal backtrace map
* lisp/emacs-lisp/backtrace.el (backtrace-mode-map): Don't bind the "s" command, because it's meaningless outside modes that have set the backtrace-goto-source-functions variable (and only edebug does that) (bug#57674). * lisp/emacs-lisp/edebug.el (edebug-pop-to-backtrace): Use it. (edebug-backtrace-mode-map, edebug-backtrace-mode): New mode.
-rw-r--r--lisp/emacs-lisp/backtrace.el1
-rw-r--r--lisp/emacs-lisp/edebug.el9
-rw-r--r--test/lisp/emacs-lisp/edebug-tests.el3
3 files changed, 11 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/backtrace.el b/lisp/emacs-lisp/backtrace.el
index 70473770d16..4ffe6f573c6 100644
--- a/lisp/emacs-lisp/backtrace.el
+++ b/lisp/emacs-lisp/backtrace.el
@@ -209,7 +209,6 @@ frames where the source code location is known.")
"v" #'backtrace-toggle-locals
"#" #'backtrace-toggle-print-circle
":" #'backtrace-toggle-print-gensym
- "s" #'backtrace-goto-source
"RET" #'backtrace-help-follow-symbol
"+" #'backtrace-multi-line
"-" #'backtrace-single-line
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el
index 763848c0c9b..c916ec431e4 100644
--- a/lisp/emacs-lisp/edebug.el
+++ b/lisp/emacs-lisp/edebug.el
@@ -4179,6 +4179,7 @@ from Edebug instrumentation found in the backtrace."
(backtrace-mode)
(add-hook 'backtrace-goto-source-functions
#'edebug--backtrace-goto-source nil t))
+ (edebug-backtrace-mode)
(setq edebug-instrumented-backtrace-frames
(backtrace-get-frames 'edebug-debugger
:constructor #'edebug--make-frame)
@@ -4255,6 +4256,14 @@ Save DEF-NAME, BEFORE-INDEX and AFTER-INDEX in FRAME."
(setf (edebug--frame-before-index frame) before-index)
(setf (edebug--frame-after-index frame) after-index))
+(defvar-keymap edebug-backtrace-mode-map
+ "s" #'backtrace-goto-source)
+
+(define-minor-mode edebug-backtrace-mode
+ "Minor mode for showing backtraces from edebug."
+ :lighter nil
+ :interactive nil)
+
(defun edebug--backtrace-goto-source ()
(let* ((index (backtrace-get-index))
(frame (nth index backtrace-frames)))
diff --git a/test/lisp/emacs-lisp/edebug-tests.el b/test/lisp/emacs-lisp/edebug-tests.el
index 008e1e467ba..dea6e9ed611 100644
--- a/test/lisp/emacs-lisp/edebug-tests.el
+++ b/test/lisp/emacs-lisp/edebug-tests.el
@@ -428,7 +428,8 @@ test and possibly others should be updated."
(verify-keybinding "-" 'negative-argument)
(verify-keybinding "=" 'edebug-temp-display-freq-count)
(should (eq (lookup-key backtrace-mode-map "n") 'backtrace-forward-frame))
- (should (eq (lookup-key backtrace-mode-map "s") 'backtrace-goto-source))))
+ (should (eq (lookup-key edebug-backtrace-mode-map "s")
+ 'backtrace-goto-source))))
(ert-deftest edebug-tests-stop-point-at-start-of-first-instrumented-function ()
"Edebug stops at the beginning of an instrumented function."