> 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.
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 (?).
And AFAIK, there is no way to know how many glyphs/pixels the redisplay add.
Anyone who wants to have an accurate number of pixels displayed will be unable to use this function.
> 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.`
[1]
https://www.gnu.org/software/emacs/manual/html_node/elisp/Size-of-Displayed-Text.html#Size-of-Displayed-Text
Thanks,