From: Lars Ingebrigtsen Date: Wed, 24 Nov 2021 13:43:37 +0000 (+0100) Subject: Make display_min_width work from the mode line X-Git-Tag: emacs-29.0.90~2852^2~69 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4bfa73f9207b47d0a6a0641bbdd39963242fa2c7;p=emacs.git Make display_min_width work from the mode line * src/xdisp.c (display_min_width): Make this work from mode line constructs via display_string. --- diff --git a/src/xdisp.c b/src/xdisp.c index e8de0634a16..cda7e04522c 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -5214,11 +5214,18 @@ display_min_width (struct it *it, ptrdiff_t bufpos, if (!it->glyph_row) return; - /* Check that we're really right after the sequence of - characters covered by this `min-width'. */ - if (bufpos > BEGV - && EQ (it->min_width_property, - get_display_property (bufpos - 1, Qmin_width, object))) + /* When called form 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 + :propertize run. */ + if ((bufpos == 0 + && !EQ (it->min_width_property, + get_display_property (0, Qmin_width, object))) + /* In a buffer -- check that we're really right after the + sequence of characters covered by this `min-width'. */ + || (bufpos > BEGV + && EQ (it->min_width_property, + get_display_property (bufpos - 1, Qmin_width, object)))) { Lisp_Object w = Qnil; double width; @@ -5258,6 +5265,11 @@ display_min_width (struct it *it, ptrdiff_t bufpos, if (CONSP (width_spec)) { if (bufpos == BEGV + /* Mode line (see above). */ + || (bufpos == 0 + && !EQ (it->min_width_property, + get_display_property (0, Qmin_width, object))) + /* Buffer. */ || (bufpos > BEGV && !EQ (width_spec, get_display_property (bufpos - 1, Qmin_width, object))))