Subject: Re: bug#67791: 30.0.50; `t' command on Gnus summary buffer sometimes causes an error

From: Eli Zaretskii <[email-masked]>
Date: Wed, 20 Dec 2023 14:53:02 +0200

> Date: Wed, 20 Dec 2023 09:34:00 +0900
> From: Katsumi Yamaoka <[email-masked]>
> Cc: [email-masked]
> 
> `pixel-fill-region' measures the pixel width of the first letter
> of a message header using `window-text-pixel-size' as follows:
> 
> (window-text-pixel-size nil (line-beginning-position) (point))
> 
> Where the point is just after the first letter of a header.  So,
> how do we use `buffer-text-pixel-size' so to do the same thing?

If this is a general problem with pixel-fill-region, then shouldn't
the save-window-excursion thing be in pixel-fill-region instead?

IOW, in pixel-fill-region, if the selected window doesn't display the
current buffer, use save-window-excursion to make it so (to avoid thej
costly save-window-excursion when the current buffer is already in the
selected window).

Or what am I missing?