From: Martin Rudalics Date: Wed, 12 Sep 2012 15:49:17 +0000 (+0200) Subject: Try to keep height of debugger window consistent. (Bug#8789) X-Git-Tag: emacs-24.2.90~309 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4dece104ac5d50f934a13b7a817e27750f328278;p=emacs.git Try to keep height of debugger window consistent. (Bug#8789) * emacs-lisp/debug.el (debugger-previous-window-height): New variable. (debug): When debugger-jumping-flag is non-nil try to restore height of debugger window. (Bug#8789) --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f24ccb3aaa6..0345c922a15 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2012-09-12 Martin Rudalics + + * emacs-lisp/debug.el (debugger-previous-window-height): New + variable. + (debug): When debugger-jumping-flag is non-nil try to restore + height of debugger window. (Bug#8789) + 2012-09-12 Stefan Monnier * emacs-lisp/edebug.el (edebug-enter): Don't mess with diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el index bdb35e424d0..8b89e65c5d9 100644 --- a/lisp/emacs-lisp/debug.el +++ b/lisp/emacs-lisp/debug.el @@ -96,6 +96,9 @@ The value used here is passed to `quit-restore-window'." (defvar debugger-previous-window nil "This is the window last showing the debugger buffer.") +(defvar debugger-previous-window-height nil + "The last recorded height of `debugger-previous-window'.") + (defvar debugger-previous-backtrace nil "The contents of the previous backtrace (including text properties). This is to optimize `debugger-make-xrefs'.") @@ -234,7 +237,17 @@ first will be printed into the backtrace buffer." . (,(when debugger-previous-window `(previous-window . ,debugger-previous-window))))) (setq debugger-window (selected-window)) - (setq debugger-previous-window debugger-window) + (if (eq debugger-previous-window debugger-window) + (when debugger-jumping-flag + ;; Try to restore previous height of debugger + ;; window. + (condition-case nil + (window-resize + debugger-window + (- debugger-previous-window-height + (window-total-size debugger-window))) + (error nil))) + (setq debugger-previous-window debugger-window)) (debugger-mode) (debugger-setup-buffer debugger-args) (when noninteractive @@ -262,6 +275,9 @@ first will be printed into the backtrace buffer." (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)) ;; Unshow debugger-buffer. (quit-restore-window debugger-window debugger-bury-or-kill)) ;; Restore previous state of debugger-buffer in case we were