]> git.eshelyaron.com Git - emacs.git/commitdiff
(window-body-height): Handle minibuffer window specially.
authorRichard M. Stallman <rms@gnu.org>
Mon, 21 Jan 2002 08:55:32 +0000 (08:55 +0000)
committerRichard M. Stallman <rms@gnu.org>
Mon, 21 Jan 2002 08:55:32 +0000 (08:55 +0000)
Otherwise, don't return less than 1.

lisp/window.el

index 99b71dba77cbe6a27e61219d43a6837c5e356efd..02b3fa1ffe316dcca9674e7970b030d6dc77523d 100644 (file)
   "Return number of lines in window WINDOW for actual buffer text.
 This does not include the mode line (if any) or the header line (if any)."
   (or window (setq window (selected-window)))
-  (with-current-buffer (window-buffer window)
-    (- (window-height window)
-       (if mode-line-format 1 0)
-       (if header-line-format 1 0))))
+  (if (window-minibuffer-p window)
+      (window-height window)
+    (with-current-buffer (window-buffer window)
+      (max 1 (- (window-height window)
+               (if mode-line-format 1 0)
+               (if header-line-format 1 0))))))
 
 (defun one-window-p (&optional nomini all-frames)
   "Return non-nil if the selected window is the only window (in its frame).