GNU bug report logs -
#72771
31.0.50; shr html renderer throwing "Specified window is not displaying the current buffer"
Previous Next
Reported by: Rob Stewart <R.Stewart <at> hw.ac.uk>
Date: Fri, 23 Aug 2024 08:22:02 UTC
Severity: normal
Found in version 31.0.50
Done: Jim Porter <jporterbugs <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
On 8/24/2024 10:05 PM, Eli Zaretskii wrote:
> Again, the simplicity here is deceptive.
Since you seemed so unsure about my earlier patch, I figured I should be
extra careful to think about whether there's a better way.
Previously, you'd suggested using 'string-pixel-width' using a few
characters to compute an average width. After thinking about it, I
realized that it's actually possible to get the real
'font->average_width' value using 'string-pixel-width': just use a
display spec!
(string-pixel-width
(propertize some-length-1-string 'display '(space :width 1)))
That works out nicely since then the only function I'm using to compute
string widths in this code is 'string-pixel-width', so there's less risk
of different functions having slightly different font handling.
As an added bonus, this new implementation is even simpler than the
original code that prompted this bug. See attached.
>> Thanks for prompting me to re-read the manual on this. I'd
>> misinterpreted this passage in the documentation for 'query-font':
[snip]
> I don't see how this is different from the text we already have,
> sorry.
Here's another variation on the documentation that might be clearer?
"The average width of the font characters. Emacs uses this value when
calculating text layout on display. If this is zero, Emacs uses
the value of space-width instead."
(Maybe this could cross reference the section on pixel specifications
too, or some other documentation about text layout.)
If that doesn't seem any better, that's ok. I'll stop suggesting further
variations. :)
[0001-Improve-computation-of-indent-depth-in-SHR-and-visua.patch (text/plain, attachment)]
This bug report was last modified 268 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.