Subject: Re: bug#72771: 31.0.50; shr html renderer throwing "Specified window is not displaying the current buffer"

From: Eli Zaretskii <[email-masked]>
Date: Sun, 25 Aug 2024 09:22:55 +0300

> Date: Sat, 24 Aug 2024 23:11:46 -0700
> Cc: [email-masked], [email-masked], [email-masked]
> From: Jim Porter <[email-masked]>
> 
> 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.

Good idea.

> >> 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."

That's again exactly what the current text does, just broken into
sentences differently.

I'm sorry, I must understand what is it in the original text that
misled you, before I can consider any changes.

The updated patch LGTM, thanks.