help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

*real* number of lines a window can display currently


From: Klaus Berndl
Subject: *real* number of lines a window can display currently
Date: 07 Oct 2003 18:07:26 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

What i search for is a function which gives me the *real* number of lines a
certain window displays currently....neither `window-height' nor
`window-text-height' nor `window-body-height' are usable for this because
none of them consider the current font-height of text in the buffer or if
images are displayed (so some lines of the buffer in the window are higher
than others etc..).

What would help is (count-screen-lines (window-start) (window-end)) but
unfortunately not in all situations: This works only correct if the end of
the buffer is not before the window-end, means there are no "empty" lines left
in the window. If there are "empty" lines then these ones are not count :-(

The `window-displayed-lines' function of XEmacs is better:

`window-displayed-height' is a built-in function
(window-displayed-height &optional WINDOW)

Documentation:
Return the number of lines currently displayed in WINDOW.
This counts the actual number of lines displayed in WINDOW
(as opposed to `window-height').  The modeline and horizontal
scrollbar do not count as lines.  If there is some blank space
between the end of the buffer and the end of the window, this
function pretends that there are lines of text in the default
font there.

This is what i search for GNU Emacs 21.X... Does something like this exist or
is there another way to reach my goal?

Thanks a lot,
Klaus


-- 
Klaus Berndl                    mailto: klaus.berndl@sdm.de
sd&m AG                         http://www.sdm.de
software design & management    
Carl-Wery-Str. 42, 81739 Muenchen, Germany
Tel +49 89 63812-392, Fax -220


reply via email to

[Prev in Thread] Current Thread [Next in Thread]