GNU bug report logs -
#51995
29.0.50; `string-pixel-width' depends on the current window width
Previous Next
Reported by: Brahimi Saifullah <brahimi.saifullah <at> gmail.com>
Date: Sat, 20 Nov 2021 05:05:02 UTC
Severity: normal
Found in version 29.0.50
Fixed in version 29.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> I think the best solution is to modify `window-text-pixel-size' so that
> X-LIMIT may be specified as having "no limit". Y-LIMIT already offers
> this possibility: when it is nil, the entirety of the buffer is considered
> (in reality, it seems to be simply set to INT_MAX, and that does the job).
Since 'window-text-pixel-size' has to deal with arbitrary buffers, it is
not a good idea to set X-LIMIT or Y-LIMIT to very large values. The
doc-string of 'window-text-pixel-size' explicitly warns about X-LIMIT
that
Since calculating the width of long lines can take some time, it's
always a good idea to make this argument as small as possible; in
particular, if the buffer contains long lines that shall be truncated
anyway.
and about Y-LIMIT that
Since calculating the text height of a large buffer can take some time,
it makes sense to specify this argument if the size of the buffer is
large or unknown.
So any such fix has to be made in 'string-pixel-width' itself.
> I'm experience some different problems with this function, and I'm pretty sure
> it don't stem from this same issue, but from WINDOW being buffer.
> Should I open a new bug report? Or expand upon the issue on this same thread?
'string-pixel-width' and the accompanying change of
'window-text-pixel-size' are broken in many ways, see also
https://mail.gnu.org/archive/html/emacs-devel/2021-11/msg00339.html
If you see a problem that is not mentioned there, please tell us.
I hopefully fixed most of the issues here but cannot send you a patch at
the moment to test because my local copy is completely out of synch with
master. So please bear with me.
martin
This bug report was last modified 3 years and 178 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.