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

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

How do I get the window height in lines, taking in account line-spacing?


From: Dmitry Gutov
Subject: How do I get the window height in lines, taking in account line-spacing?
Date: Mon, 04 Aug 2014 16:11:49 +0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0

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



reply via email to

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