Subject: bug#18195: 24.3.92; window-screen-lines is not accurate

From: Dmitry Gutov <[email-masked]>
Date: Tue, 05 Aug 2014 14:24:59 +0400

On 08/05/2014 02:16 PM, martin rudalics wrote:

> Aha... Could you try whether `window-text-pixel-size' could be used for
> that?

It won't help to determine how much space is left below the current line 
if the current line is the last in the buffer but not in the window, right?

 > `window-text-height' with PIXELWISE t should give you the overall
 > height of the window.

`count-screen-lines' already helps with "space above the current line", 
and we can find out the total height of the window in pixels. So if I'm 
going to do the arithmetics myself, the one thing missing is the 
accurate value of the height of a line in the buffer.

How do I obtain it (let's consider it mostly-constant)?

> If things like line spacing are involved you really should calculate
> pixelwise.

The docstring of `window-screen-lines' seems to claim that it's 
suitable. The implementation looks kinda right, too, but the result it 
returns is not accurate.