aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiles Bader2000-10-22 04:21:36 +0000
committerMiles Bader2000-10-22 04:21:36 +0000
commit3511cde8e777b31ece6e2cd689c7553e9ae57edb (patch)
tree61cb799d67eebc3b96641500b22ad668e45bdc14
parent582b0985f51d7ed2d26852b0cc64a598d3680ef0 (diff)
downloademacs-3511cde8e777b31ece6e2cd689c7553e9ae57edb.tar.gz
emacs-3511cde8e777b31ece6e2cd689c7553e9ae57edb.zip
(fit-window-to-buffer): Change defaulting of MAX-HEIGHT slightly.
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/window.el8
2 files changed, 6 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 8eea6d16c36..b084904e14b 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
12000-10-22 Miles Bader <miles@gnu.org> 12000-10-22 Miles Bader <miles@gnu.org>
2 2
3 * window.el (fit-window-to-buffer): Change defaulting of
4 MAX-HEIGHT slightly.
5
3 * faces.el (color-values, color-defined-p): Use `member', not 6 * faces.el (color-values, color-defined-p): Use `member', not
4 `memq', because it works correctly for strings. 7 `memq', because it works correctly for strings.
5 (frame-set-background-mode): Actually, "unspecified-fg" and 8 (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."
442 442
443 (when (null window) 443 (when (null window)
444 (setq window (selected-window))) 444 (setq window (selected-window)))
445 (when (null max-height)
446 (setq max-height (frame-height (window-frame window))))
445 447
446 (let* ((window-height 448 (let* ((window-height
447 ;; The current height of WINDOW 449 ;; The current height of WINDOW
@@ -458,11 +460,7 @@ header-line."
458 (delta 460 (delta
459 ;; Calculate how much the window height has to change to show 461 ;; Calculate how much the window height has to change to show
460 ;; text-height lines, constrained by MIN-HEIGHT and MAX-HEIGHT. 462 ;; text-height lines, constrained by MIN-HEIGHT and MAX-HEIGHT.
461 (- (max (min (+ text-height extra) 463 (- (max (min (+ text-height extra) max-height)
462 (or max-height
463 (frame-height
464 (window-frame
465 (or window (selected-window))))))
466 (or min-height window-min-height)) 464 (or min-height window-min-height))
467 window-height)) 465 window-height))
468 ;; We do our own height checking, so avoid any restrictions due to 466 ;; We do our own height checking, so avoid any restrictions due to