summaryrefslogtreecommitdiff
path: root/lisp/window.el
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2000-10-22 04:21:36 +0000
committerMiles Bader <miles@gnu.org>2000-10-22 04:21:36 +0000
commit3511cde8e777b31ece6e2cd689c7553e9ae57edb (patch)
tree61cb799d67eebc3b96641500b22ad668e45bdc14 /lisp/window.el
parent582b0985f51d7ed2d26852b0cc64a598d3680ef0 (diff)
downloademacs-3511cde8e777b31ece6e2cd689c7553e9ae57edb.tar.gz
(fit-window-to-buffer): Change defaulting of MAX-HEIGHT slightly.
Diffstat (limited to 'lisp/window.el')
-rw-r--r--lisp/window.el8
1 files changed, 3 insertions, 5 deletions
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