]> git.eshelyaron.com Git - emacs.git/commitdiff
(fit-window-to-buffer): Change defaulting of MAX-HEIGHT slightly.
authorMiles Bader <miles@gnu.org>
Sun, 22 Oct 2000 04:21:36 +0000 (04:21 +0000)
committerMiles Bader <miles@gnu.org>
Sun, 22 Oct 2000 04:21:36 +0000 (04:21 +0000)
lisp/ChangeLog
lisp/window.el

index 8eea6d16c3654154184a4c5d2d5834f26766c35b..b084904e14b0a29247968a9c25d8003dafde292e 100644 (file)
@@ -1,5 +1,8 @@
 2000-10-22  Miles Bader  <miles@gnu.org>
 
+       * 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
index 4b0d3b5334f5b77bd044f90c1651c435af93d109..53d234a3805340755610858a86c8a1f190a752ed 100644 (file)
@@ -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