]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't bind `s' in the normal backtrace map
authorLars Ingebrigtsen <larsi@gnus.org>
Fri, 9 Sep 2022 17:29:21 +0000 (19:29 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Fri, 9 Sep 2022 17:29:21 +0000 (19:29 +0200)
* 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
lisp/emacs-lisp/edebug.el
test/lisp/emacs-lisp/edebug-tests.el

index 70473770d1621dff1962f34990951f53a5282818..4ffe6f573c678fe7199f5f750124a3576697ade2 100644 (file)
@@ -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
index 763848c0c9b8fa4909bb76394f2084ef2f014136..c916ec431e450f04689c4a95305bbfe50752b2b6 100644 (file)
@@ -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)))
index 008e1e467ba2eaeb0699c60401a544d8d85013d5..dea6e9ed611a52b797c9b0c1dcdfcee0d7538de3 100644 (file)
@@ -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."