emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master a02bb84c80: Leave the contents on the *Backtrace* buffer on `q'


From: Lars Ingebrigtsen
Subject: master a02bb84c80: Leave the contents on the *Backtrace* buffer on `q'
Date: Tue, 14 Jun 2022 08:39:31 -0400 (EDT)

branch: master
commit a02bb84c80f63a7b1199f0e68d605f7d418167fd
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Leave the contents on the *Backtrace* buffer on `q'
    
    * lisp/emacs-lisp/debug.el (debug): Don't clear the contents of
    the buffer on `q' (bug#55863).
---
 etc/NEWS                 |  7 +++++++
 lisp/emacs-lisp/debug.el | 11 +++++------
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index 73416fb30c..19ca21f666 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -997,6 +997,13 @@ inadvertently delete the "*scratch*" buffer.
 
 ** Debugging
 
+---
+*** 'q' in a *Backtrace* buffer no longer clears the buffer.
+Instead it just buries the buffer and switches the mode from
+'debugger-mode' to 'backtrace-mode', since commands like 'e' are no
+longer available after exiting the recursive edit.
+
++++
 *** New user option 'debug-allow-recursive-debug'.
 This user option controls whether the 'e' (in a "*Backtrace*"
 buffer or while edebugging) and 'C-x C-e' (while edebugging) commands
diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el
index 6c172d6c31..c4929eb2b0 100644
--- a/lisp/emacs-lisp/debug.el
+++ b/lisp/emacs-lisp/debug.el
@@ -305,16 +305,15 @@ the debugger will not be entered."
                  (set-buffer debugger-old-buffer)))
               ;; Forget debugger window, it won't be back (Bug#17882).
               (setq debugger-previous-window nil))
-            ;; Restore previous state of debugger-buffer in case we were
-            ;; in a recursive invocation of the debugger, otherwise just
-            ;; erase the buffer.
+            ;; Restore previous state of debugger-buffer in case we
+            ;; were in a recursive invocation of the debugger,
+            ;; otherwise just exit (after changing the mode, since we
+            ;; can't interact with the buffer in the same way).
            (when (buffer-live-p debugger-buffer)
              (with-current-buffer debugger-buffer
                (if debugger-previous-state
                     (debugger--restore-buffer-state debugger-previous-state)
-                  (setq backtrace-insert-header-function nil)
-                  (setq backtrace-frames nil)
-                  (backtrace-print))))
+                  (backtrace-mode))))
            (with-timeout-unsuspend debugger-with-timeout-suspend)
            (set-match-data debugger-outer-match-data)))
         (setq debug-on-next-call debugger-step-after-exit)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]