]> git.eshelyaron.com Git - emacs.git/commitdiff
(resize-temp-buffer-window): Use `fit-window-to-buffer'.
authorMiles Bader <miles@gnu.org>
Sat, 21 Oct 2000 05:40:19 +0000 (05:40 +0000)
committerMiles Bader <miles@gnu.org>
Sat, 21 Oct 2000 05:40:19 +0000 (05:40 +0000)
lisp/ChangeLog
lisp/help.el

index 619bffa8db0a74819171667f1a03a6f9dbf8d79b..42eebf899ff54c7261c1839b1a9d02c254e6b8bd 100644 (file)
@@ -1,5 +1,9 @@
 2000-10-21  Miles Bader  <miles@gnu.org>
 
+       * window.el (fit-window-to-buffer): New function.
+       (shrink-window-if-larger-than-buffer): Use it.
+       * help.el (resize-temp-buffer-window): Use `fit-window-to-buffer'.
+
        * international/quail.el (quail-show-guidance-buf): Make sure
        guidance window really has enough room.
        (quail-update-guidance): If quail-guidance-win is already shown,
index adbe12e6ae92bd0fd20a21f2b305e2dac11e19ce..aa3e7c42e32538614b027db4e1b1f56f2ae0919a 100644 (file)
@@ -1463,13 +1463,11 @@ out of view."
   (unless (or (one-window-p 'nomini)
               (not (pos-visible-in-window-p (point-min)))
               (/=  (frame-width) (window-width)))
-    (let* ((max-height (if (functionp temp-buffer-max-height)
-                           (funcall temp-buffer-max-height (current-buffer))
-                         temp-buffer-max-height))
-           (min-height (1- window-min-height))
-           (text-height (count-screen-lines))
-           (new-height (max (min text-height max-height) min-height)))
-      (set-window-text-height nil new-height))))
+    (fit-window-to-buffer
+     (selected-window)
+     (if (functionp temp-buffer-max-height)
+        (funcall temp-buffer-max-height (current-buffer))
+       temp-buffer-max-height))))
 
 ;; `help-manyarg-func-alist' is defined primitively (in doc.c).
 ;; New primitives with `MANY' or `UNEVALLED' arglists should be added