aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLars Ingebrigtsen2021-11-24 14:43:37 +0100
committerLars Ingebrigtsen2021-11-24 14:48:17 +0100
commit4bfa73f9207b47d0a6a0641bbdd39963242fa2c7 (patch)
treecaca821d9fb6e25b63e68a9d7d75cde8d3b05a52 /src
parent5b2ba7da4f03100dd5b889104b5256f7b8ac7927 (diff)
downloademacs-4bfa73f9207b47d0a6a0641bbdd39963242fa2c7.tar.gz
emacs-4bfa73f9207b47d0a6a0641bbdd39963242fa2c7.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c22
1 files changed, 17 insertions, 5 deletions
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,
5214 if (!it->glyph_row) 5214 if (!it->glyph_row)
5215 return; 5215 return;
5216 5216
5217 /* Check that we're really right after the sequence of 5217 /* When called form display_string (i.e., the mode line),
5218 characters covered by this `min-width'. */ 5218 we're being called with a string as the object, and we
5219 if (bufpos > BEGV 5219 may be called with many sub-strings belonging to the same
5220 && EQ (it->min_width_property, 5220 :propertize run. */
5221 get_display_property (bufpos - 1, Qmin_width, object))) 5221 if ((bufpos == 0
5222 && !EQ (it->min_width_property,
5223 get_display_property (0, Qmin_width, object)))
5224 /* In a buffer -- check that we're really right after the
5225 sequence of characters covered by this `min-width'. */
5226 || (bufpos > BEGV
5227 && EQ (it->min_width_property,
5228 get_display_property (bufpos - 1, Qmin_width, object))))
5222 { 5229 {
5223 Lisp_Object w = Qnil; 5230 Lisp_Object w = Qnil;
5224 double width; 5231 double width;
@@ -5258,6 +5265,11 @@ display_min_width (struct it *it, ptrdiff_t bufpos,
5258 if (CONSP (width_spec)) 5265 if (CONSP (width_spec))
5259 { 5266 {
5260 if (bufpos == BEGV 5267 if (bufpos == BEGV
5268 /* Mode line (see above). */
5269 || (bufpos == 0
5270 && !EQ (it->min_width_property,
5271 get_display_property (0, Qmin_width, object)))
5272 /* Buffer. */
5261 || (bufpos > BEGV 5273 || (bufpos > BEGV
5262 && !EQ (width_spec, 5274 && !EQ (width_spec,
5263 get_display_property (bufpos - 1, Qmin_width, object)))) 5275 get_display_property (bufpos - 1, Qmin_width, object))))