all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How do I get the window height in lines, taking in account line-spacing?
@ 2014-08-04 12:11 Dmitry Gutov
  2014-08-04 14:17 ` Michael Heerdegen
  0 siblings, 1 reply; 13+ messages in thread
From: Dmitry Gutov @ 2014-08-04 12:11 UTC (permalink / raw)
  To: help-gnu-emacs

I can see two ways to obtain the number of visible lines:

1. (window-body-height) - this doesn't take line-spacing into account. 
Furthermore, (/ (window-body-height) (1+ line-spacing)) doesn't seem to 
produce the exactly correct result, even when line-spacing is a float, 
even if I round it up.

2. (count-screen-lines (window-start) (window-end)) takes line-spacing 
into account, naturally, but it also includes the partially visible line 
at the bottom, if there is one.

Is there a better way?

Related: 
https://github.com/company-mode/company-mode/issues/160#issuecomment-51022508



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

end of thread, other threads:[~2014-08-06 14:47 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-04 12:11 How do I get the window height in lines, taking in account line-spacing? Dmitry Gutov
2014-08-04 14:17 ` Michael Heerdegen
2014-08-04 18:31   ` Dmitry
     [not found]     ` <CAPhAwGyGvNy5rUf2M9jaE=kBrtZNDo_Ey+F6Oq2VqzZB+OoKEA@mail.gmail.com>
2014-08-04 19:16       ` Dmitry Gutov
     [not found]       ` <mailman.6572.1407179803.1147.help-gnu-emacs@gnu.org>
2014-08-05  0:11         ` Emanuel Berg
2014-08-05  0:45           ` Dmitry
2014-08-05  1:41     ` Dmitry
2014-08-05  1:42     ` Dmitry
2014-08-05 11:55       ` Michael Heerdegen
2014-08-05 12:11         ` Dmitry
2014-08-05 12:22           ` Michael Heerdegen
2014-08-06 13:56             ` Dmitry
2014-08-06 14:47               ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.