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

From: Dmitry Gutov <[email-masked]>
Date: Wed, 06 Aug 2014 01:21:56 +0400

On 08/05/2014 05:46 PM, Eli Zaretskii wrote:

> I fixed window-screen-lines.

Thanks!

> For example, AFAIU, your code currently assumes that the font used for
> popup is the same as the one used for the underlying buffer text.  But
> since you provide faces for the popup, a user could legitimately
> customize those faces to use a different font, and thus invalidate
> your calculations, because window-screen-lines uses the metrics of the
> default face's font.

Sure. This doesn't add any constraints over what we've been living with 
for years.

> IMO, instead of overloading existing display features with jobs they
> were never designed to do, and then live forever with the situation
> where development breaks the resulting applications (like the
> pixel-wise resizing of windows did with this one)

pixel-wise resizing wasn't actually the culprit: I've just never tested 
the code with non-zero line-spacing. Even with it, the bug wasn't too 
easy to notice.

 > it would be a much
> better investment of energy to come up with requirements for Lisp APIs
> that could be used by applications for laying out text.

That sounds great, but I don't even know where to start. What we're 
trying to emulate, though, is multi-layered display. That sounds 
somewhat different from a "text layout API" to me.