]> git.eshelyaron.com Git - emacs.git/commitdiff
* debug.el (debug): Restore the previous content of the
authorHelmut Eller <eller.helmut@gmail.com>
Tue, 31 May 2011 15:24:33 +0000 (12:24 -0300)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 31 May 2011 15:24:33 +0000 (12:24 -0300)
*Backtrace* buffer when we exit with C-M-c.

lisp/ChangeLog
lisp/emacs-lisp/debug.el

index 07f700f6987199c0d4941e3b087eb4364afeab11..e6fdbd2372c524d108f15beadf918603210309c8 100644 (file)
@@ -1,3 +1,8 @@
+2011-05-31  Helmut Eller  <eller.helmut@gmail.com>
+
+       * debug.el (debug): Restore the previous content of the
+       *Backtrace* buffer when we exit with C-M-c.
+
 2011-05-31  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * minibuffer.el: Add metadata method to completion tables.
index 88633eaaa4648eea379aa5615eeb77b45a7b2b97..4a43f59c9e254ab2291f8d73abc198ac36f38b74 100644 (file)
@@ -120,6 +120,7 @@ first will be printed into the backtrace buffer."
          (debug-on-quit nil)
          (debugger-buffer (get-buffer-create "*Backtrace*"))
          (debugger-old-buffer (current-buffer))
+         (debugger-previous-contents nil)
          (debugger-step-after-exit nil)
           (debugger-will-be-back nil)
          ;; Don't keep reading from an executing kbd macro!
@@ -181,6 +182,7 @@ first will be printed into the backtrace buffer."
                  (when (eq 'lambda (car-safe (cadr (backtrace-frame 4))))
                    (backtrace-debug 5 t)))
                 (pop-to-buffer debugger-buffer)
+               (setq debugger-previous-contents (buffer-string))
                (debugger-mode)
                (debugger-setup-buffer debugger-args)
                (when noninteractive
@@ -215,6 +217,7 @@ first will be printed into the backtrace buffer."
              ;; erase it (and maybe hide it) but keep it alive.
              (with-current-buffer debugger-buffer
                (erase-buffer)
+               (insert debugger-previous-contents)
                (fundamental-mode)
                (with-selected-window (get-buffer-window debugger-buffer 0)
                   (when (and (window-dedicated-p (selected-window))