[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 04a6fd378f: Don't bind `s' in the normal backtrace map
From: |
Lars Ingebrigtsen |
Subject: |
master 04a6fd378f: Don't bind `s' in the normal backtrace map |
Date: |
Fri, 9 Sep 2022 13:30:21 -0400 (EDT) |
branch: master
commit 04a6fd378f0996c14c3cf9e4905f56df231aa500
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
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.
---
lisp/emacs-lisp/backtrace.el | 1 -
lisp/emacs-lisp/edebug.el | 9 +++++++++
test/lisp/emacs-lisp/edebug-tests.el | 3 ++-
3 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/lisp/emacs-lisp/backtrace.el b/lisp/emacs-lisp/backtrace.el
index 70473770d1..4ffe6f573c 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 763848c0c9..c916ec431e 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 008e1e467b..dea6e9ed61 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."
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 04a6fd378f: Don't bind `s' in the normal backtrace map,
Lars Ingebrigtsen <=