aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2019-12-12 13:16:46 +0200
committerEli Zaretskii2019-12-12 13:16:46 +0200
commit6ee3675dad6f2404d4177aa1ec8eada7286994f4 (patch)
treeea28647748de59de4b5eb79a5b9d5a84b6b684b8 /src
parentd57bb0c323c326518d9cc974dc794f9e23a51917 (diff)
downloademacs-6ee3675dad6f2404d4177aa1ec8eada7286994f4.tar.gz
emacs-6ee3675dad6f2404d4177aa1ec8eada7286994f4.zip
Fix face extension of overlay strings on buffer text with faces
* src/xdisp.c (face_at_pos): Reject the face returned by 'underlying_face_id' when we are filtering by face attribute, and that attribute's value fails the filter test. (Bug#38563)
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 08c6927052c..bfc48e36a99 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -4243,11 +4243,25 @@ face_at_pos (const struct it *it, enum lface_attribute_index attr_filter)
4243 the display string do. This sounds like a design bug, 4243 the display string do. This sounds like a design bug,
4244 but Emacs always did that since v21.1, so changing that 4244 but Emacs always did that since v21.1, so changing that
4245 might be a big deal. */ 4245 might be a big deal. */
4246 base_face_id = it->string_from_prefix_prop_p 4246 bool use_default = (it->string_from_prefix_prop_p != 0);
4247 ? (!NILP (Vface_remapping_alist) 4247 if (!use_default)
4248 ? lookup_basic_face (it->w, it->f, DEFAULT_FACE_ID) 4248 {
4249 : DEFAULT_FACE_ID) 4249 base_face_id = underlying_face_id (it);
4250 : underlying_face_id (it); 4250 /* Reject the underlying face, if that face is different
4251 from the iterator face, and we filter by attr_filter,
4252 and that face's value of the filter attribute is nil
4253 or unspecified; use the default face instead. */
4254 struct face *bf = FACE_FROM_ID_OR_NULL (it->f, base_face_id);
4255 if (base_face_id != it->base_face_id
4256 && attr_filter > 0
4257 && (NILP (bf->lface[attr_filter])
4258 || EQ (bf->lface[attr_filter], Qunspecified)))
4259 use_default = true;
4260 }
4261 if (use_default)
4262 base_face_id = (!NILP (Vface_remapping_alist)
4263 ? lookup_basic_face (it->w, it->f, DEFAULT_FACE_ID)
4264 : DEFAULT_FACE_ID);
4251 } 4265 }
4252 4266
4253 return face_at_string_position (it->w, 4267 return face_at_string_position (it->w,