Mercurial > emacs
changeset 42818:55ed8ccce828
(window-body-height): New function.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 18 Jan 2002 05:42:23 +0000 |
parents | 83e878c5c0cb |
children | 401375284bf0 |
files | lisp/window.el |
diffstat | 1 files changed, 9 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/window.el Fri Jan 18 03:50:50 2002 +0000 +++ b/lisp/window.el Fri Jan 18 05:42:23 2002 +0000 @@ -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