Commits

Anonymous committed 9946767

* ibuffer.el (ibuffer-shrink-to-fit): Use window-displayed-height
rather than window-height with fudge factor to avoid inadvertent
deletion. Handle owin argument.

Comments (0)

Files changed (2)

+2002-03-05  John Paul Wallington  <jpw@xemacs.org>
+
+	* ibuffer.el (ibuffer-shrink-to-fit): Use window-displayed-height
+	rather than window-height with fudge factor to avoid inadvertent
+	deletion.  Handle owin argument.
+	
 2002-03-02  Adrian Aichner  <adrian@xemacs.org>
 
 	* ibuffer.el (ibuffer-header-line-face): Convert
     (defun ibuffer-shrink-to-fit (&optional owin)
       "Make window the right size to display its contents exactly."
       (interactive)
+      (when owin (delete-other-windows))
       (when (> (length (ibuffer-window-list)) 1)
 	(let* ((window (selected-window))
 	       (buf (window-buffer window))
-	       (height (window-height (selected-window)))
+	       (height (window-displayed-height (selected-window)))
 	       (new-height (with-current-buffer buf
-			     (+ (count-lines (point-min) (point-max) 3))))
+			     (count-lines (point-min) (point-max))))
 	       (diff (- new-height height)))
 	  (unless (zerop diff)
 	    (enlarge-window diff))