]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid assertion violations in 'push_prefix_prop'
authorEli Zaretskii <eliz@gnu.org>
Sun, 21 Apr 2024 13:06:34 +0000 (16:06 +0300)
committerEshel Yaron <me@eshelyaron.com>
Mon, 29 Apr 2024 15:00:59 +0000 (17:00 +0200)
* src/xdisp.c (push_prefix_prop): Set the
'string_from_prefix_prop_p' flag for any valid value of the
'line-prefix' or 'wrap-prefix' property/variable.  (Bug#70495)

(cherry picked from commit aed2b7a3d82fd16789befe3c6e4c05e20ed0ae60)

src/dispextern.h
src/xdisp.c

index c3c2d61082b20d12a4d6e3df9b2efdb497ffb412..1ead52b87b25dd52922fbe7e609708d1d058a83f 100644 (file)
@@ -2419,7 +2419,9 @@ struct it
   bool_bf string_from_display_prop_p : 1;
 
   /* True means `string' comes from a `line-prefix' or `wrap-prefix'
-     property.  */
+     property, and that these properties were already handled, even if
+     their value is not a string.  This is used to avoid processing
+     the same line/wrap prefix more than once for the same glyph row.  */
   bool_bf string_from_prefix_prop_p : 1;
 
   /* True means we are iterating an object that came from a value of a
index 7c2aba0fe34ba4a799f178582ac2a86fa7dfca97..92b1fbfc3c7e445f3006a3668e962e343760d139 100644 (file)
@@ -24415,6 +24415,7 @@ push_prefix_prop (struct it *it, Lisp_Object prop)
     {
       it->method = GET_FROM_STRETCH;
       it->object = prop;
+      it->string_from_prefix_prop_p = true;
     }
 #ifdef HAVE_WINDOW_SYSTEM
   else if (IMAGEP (prop))
@@ -24422,6 +24423,7 @@ push_prefix_prop (struct it *it, Lisp_Object prop)
       it->what = IT_IMAGE;
       it->image_id = lookup_image (it->f, prop, it->face_id);
       it->method = GET_FROM_IMAGE;
+      it->string_from_prefix_prop_p = true;
     }
 #endif /* HAVE_WINDOW_SYSTEM */
   else