From: Richard M. Stallman Date: Fri, 18 Jan 2002 05:42:23 +0000 (+0000) Subject: (window-body-height): New function. X-Git-Tag: ttn-vms-21-2-B4~17091 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e58bff5990186f3920a384ef72d0a2dc69dad8ec;p=emacs.git (window-body-height): New function. --- diff --git a/lisp/window.el b/lisp/window.el index 1b8830fb190..99b71dba77c 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -29,6 +29,15 @@ ;;; Code: +(defun window-body-height (&optional window) + "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)))) + (defun one-window-p (&optional nomini all-frames) "Return non-nil if the selected window is the only window (in its frame). Optional arg NOMINI non-nil means don't count the minibuffer