From: Miles Bader Date: Sun, 22 Oct 2000 04:21:36 +0000 (+0000) Subject: (fit-window-to-buffer): Change defaulting of MAX-HEIGHT slightly. X-Git-Tag: emacs-pretest-21.0.90~691 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3511cde8e777b31ece6e2cd689c7553e9ae57edb;p=emacs.git (fit-window-to-buffer): Change defaulting of MAX-HEIGHT slightly. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8eea6d16c36..b084904e14b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2000-10-22 Miles Bader + * window.el (fit-window-to-buffer): Change defaulting of + MAX-HEIGHT slightly. + * faces.el (color-values, color-defined-p): Use `member', not `memq', because it works correctly for strings. (frame-set-background-mode): Actually, "unspecified-fg" and diff --git a/lisp/window.el b/lisp/window.el index 4b0d3b5334f..53d234a3805 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -442,6 +442,8 @@ header-line." (when (null window) (setq window (selected-window))) + (when (null max-height) + (setq max-height (frame-height (window-frame window)))) (let* ((window-height ;; The current height of WINDOW @@ -458,11 +460,7 @@ header-line." (delta ;; Calculate how much the window height has to change to show ;; text-height lines, constrained by MIN-HEIGHT and MAX-HEIGHT. - (- (max (min (+ text-height extra) - (or max-height - (frame-height - (window-frame - (or window (selected-window)))))) + (- (max (min (+ text-height extra) max-height) (or min-height window-min-height)) window-height)) ;; We do our own height checking, so avoid any restrictions due to