Subject: bug#68374: min-width is not correctly treated by buffer-text-pixel-size

From: Eli Zaretskii <[email-masked]>
Date: Thu, 11 Jan 2024 12:24:04 +0200

> From: JD Smith <[email-masked]>
> Date: Wed, 10 Jan 2024 17:22:53 -0500
> 
> 
> When the ‘display min-width property is used on characters in a buffer, window/buffer-text-pixel-size does not include this min-width padding in its calculation of the text's pixel width.  

For some reason I cannot understand, we were ignoring min-width when
simulating display (as opposed to actually displaying stuff in a
window).  I can only assume it's some kind of left-over from when Lars
was developing this feature, where calls from functions that simulate
display caused him trouble, so he disabled that and forgot to
re-enable later.  At least I cannot find any discussion of this, and
the code which disables min-width in these situations was in the
initial version that landed on master.

So please try running with the patch below for a couple of weeks, and
if it doesn't cause you any trouble, I will install it on master.
Please configure your builds with --enable-checking='yes,glyphs' for
the duration of this test period, to activate some run-time tests and
assertions that will hopefully flag any problems this change might
have.

TIA

diff --git a/src/xdisp.c b/src/xdisp.c
index 14cf030..29ac4a4 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -5487,9 +5487,6 @@ display_min_width (struct it *it, ptrdiff_t bufpos,
   if (!NILP (it->min_width_property)
       && !EQ (width_spec, it->min_width_property))
     {
-      if (!it->glyph_row)
-	return;
-
       /* When called from display_string (i.e., the mode line),
 	 we're being called with a string as the object, and we
 	 may be called with many sub-strings belonging to the same