unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* *real* number of lines a window can display currently
@ 2003-10-07 16:07 Klaus Berndl
  2003-10-07 16:19 ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: Klaus Berndl @ 2003-10-07 16:07 UTC (permalink / raw)



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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-10-14  6:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-07 16:07 *real* number of lines a window can display currently Klaus Berndl
2003-10-07 16:19 ` Stefan Monnier
2003-10-14  1:03   ` Alan Wehmann
2003-10-14  6:22   ` Klaus Berndl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).