* lisp/emacs-lisp/cl-macs.el (cl-flet, cl-flet*): Fix docstring.
[bpt/emacs.git] / lisp / emacs-lisp / debug.el
index c30ccf3..6be30fc 100644 (file)
@@ -49,9 +49,9 @@ the middle is discarded, and just the beginning and end are displayed."
   :version "21.1")
 
 (defcustom debugger-bury-or-kill 'bury
-  "How to proceed with the debugger buffer when exiting `debug'.
-The value used here affects the behavior of operations on any
-window previously showing the debugger buffer.
+  "What to do with the debugger buffer when exiting `debug'.
+The value affects the behavior of operations on any window
+previously showing the debugger buffer.
 
 `nil' means that if its window is not deleted when exiting the
   debugger, invoking `switch-to-prev-buffer' will usually show
@@ -79,7 +79,7 @@ The value used here is passed to `quit-restore-window'."
          (const :tag "Bury" bury)
          (const :tag "Kill" kill))
   :group 'debugger
-  :version "24.2")
+  :version "24.3")
 
 (defvar debug-function-list nil
   "List of functions currently set for debug on entry.")
@@ -267,15 +267,17 @@ first will be printed into the backtrace buffer."
                ;; Make sure we unbind buffer-read-only in the right buffer.
                (save-excursion
                  (recursive-edit))))
+         (when (and (window-live-p debugger-window)
+                    (eq (window-buffer debugger-window) debugger-buffer))
+           ;; Record height of debugger window.
+           (setq debugger-previous-window-height
+                 (window-total-size debugger-window)))
          (if debugger-will-be-back
              ;; Restore previous window configuration (Bug#12623).
              (set-window-configuration window-configuration)
            (when (and (window-live-p debugger-window)
                       (eq (window-buffer debugger-window) debugger-buffer))
              (progn
-               ;; Record height of debugger window.
-               (setq debugger-previous-window-height
-                     (window-total-size debugger-window))
                ;; Unshow debugger-buffer.
                (quit-restore-window debugger-window debugger-bury-or-kill)
                ;; Restore current buffer (Bug#12502).