GNU bug report logs - #18195
24.3.92; window-screen-lines is not accurate

Previous Next

Package: emacs;

Reported by: Dmitry <dgutov <at> yandex.ru>

Date: Tue, 5 Aug 2014 02:01:01 UTC

Severity: normal

Found in version 24.3.92

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #23 received at 18195 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: martin rudalics <rudalics <at> gmx.at>, 18195 <at> debbugs.gnu.org
Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate
Date: Tue, 05 Aug 2014 17:05:20 +0400
On 08/05/2014 04:20 PM, martin rudalics wrote:
>  > 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?
>
> You have to calculate the height of the text from window start till the
> end of the buffer and subtract the result from the window's text height.

Suppose I do that. When do I convert any of the resulting values to 
number of lines?

Please remember, we're using an overlay for popup rendering. Overlays 
work with lines of text.

> `count-screen-lines' doesn't return a pixel value.  How do you get that
> with lines of different heights and line spacing?

As above, we really don't need a pixel value in the end result. If the 
overlay is made to span over lines with different heights and lines 
spacing, we can either make it follow all those dimensions, or override 
them to the same values.

But while we can do that, ignoring the global value of line-spacing 
wouldn't be comfortable for users that have it set.

> It again just returns a line value.  IIRC someone has set the font size
> to 1 pixel to make this return something reasonable.  But why do all
> these acrobatics?  `window-text-pixel-size' should give you everything
> you need in a uniform way.  And if something's missing we can easily add
> it.

See above.

By the way, `window-screen-lines' not being accurate doesn't seem to be 
directly caused by pixel-perfect positioning. If I copy the necessary 
definitions (the 3 new function) to Emacs 24.3, it exhibits the same 
problem.




This bug report was last modified 10 years and 289 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.