emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Add function window-line-width


From: Eli Zaretskii
Subject: Re: [PATCH] Add function window-line-width
Date: Thu, 14 Nov 2019 12:08:24 +0200

> From: Sébastien Chapuis <address@hidden>
> Date: Mon, 11 Nov 2019 03:02:23 +0800
> Cc: Eli Zaretskii <address@hidden>, address@hidden
> 
> > There's always the problem that we want to reserve space for a block
> > cursor at line end.
> 
> IMO that's a case that should be handled by the user of the function, not by 
> 'window-lines-pixel-dimensions'
> itself.

How can application code do anything like that?  The glyph matrices
aren't (and shouldn't be) exposed to Lisp.

> In my few tests, 'window-lines-pixel-dimensions' returns a width with 1 and 2 
> glyphs more, so it's not just 1
> space for the block cursor,
> there might be cases where there are more glyphs added (?).

Please show those test cases.  It is hard to have an effective
discussion without seeing the actual use cases being mentioned.

> And AFAIK, there is no way to know how many glyphs/pixels the redisplay add.

The display engine does know that, of course.

> Anyone who wants to have an accurate number of pixels displayed will be 
> unable to use this function.

That's a pretty string assertion; the fact that we do use the function
in our own code seems to contradict it.

> > Then we probably should rewrite 'window-text-pixel-size' as Eli
> > suggested earlier.
> 
> Agreed, but I would prefer to use 'window-lines-pixel-dimensions' since this 
> is exactly the function I need.
> As per the documentation [1]:
> `window-text-pixel-size treats the text displayed in a window as a whole and 
> does not care about
>  the size of individual lines. The following function 
> [window-lines-pixel-dimensions] does.`

What is missing in window-lines-pixel-dimensions to make it satisfy
your use cases, and why?  I think it will be a better fix for your
needs, given the problems you have with window-lines-pixel-dimensions,
and I don't think we should change the latter in radical ways.



reply via email to

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