GNU bug report logs - #22320
Overlays with an 'invisible property break stacking of overlay faces

Previous Next

Package: emacs;

Reported by: Clément Pit--Claudel <clement.pitclaudel <at> live.com>

Date: Wed, 6 Jan 2016 18:05:02 UTC

Severity: normal

Merged with 22323

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #37 received at 22320 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: clement.pitclaudel <at> live.com
Cc: 22320 <at> debbugs.gnu.org
Subject: Re: bug#22320: Overlays with an 'invisible property break stacking of
 overlay faces
Date: Thu, 07 Jan 2016 23:02:55 +0200
> Date: Thu, 07 Jan 2016 22:12:42 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 22320 <at> debbugs.gnu.org
> 
> > The same problems exist for composition, but keeping the properties of the first character seems to work well there; maybe we could consider harmonizing both behaviors?
> 
> I'm not sure I understand what exactly are you proposing to do.  We
> cannot treat invisible text like we treat character compositions, each
> one invokes a very different machinery with distinct and very
> different features.

Here's a suggestion: ignore the face of the invisible text altogether,
and instead always use the face of the last visible character.  The
patch to do that is below; it fixes all of your test cases.  But since
you would like to see the face of the invisible text show through, I'm
not sure you will like it...

WDYT?

diff --git a/src/xdisp.c b/src/xdisp.c
index 87a92fc..7e5f7df 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -4583,14 +4583,15 @@ setup_for_ellipsis (struct it *it, int len)
   it->current.dpvec_index = 0;
   it->dpvec_face_id = -1;
 
-  /* Reset the current face ID to default if the last visible
-     character and the first invisible character have different faces.
-     IT->saved_face_id was set in handle_stop to the face of the
-     preceding character, and will be different from IT->face_id only
-     if the invisible text skipped in handle_invisible_prop has some
-     non-default face.  IT's face is restored in set_iterator_to_next.  */
-  if (it->saved_face_id < 0 || it->saved_face_id != it->face_id)
-    it->saved_face_id = it->face_id = DEFAULT_FACE_ID;
+  /* Use IT->saved_face_id for the ellipsis, so that it has the same
+     face as the preceding text.  IT->saved_face_id was set in
+     handle_stop to the face of the preceding character, and will be
+     different from IT->face_id only if the invisible text skipped in
+     handle_invisible_prop has some non-default face.  We thus ignore
+     the face of the invisible text when we display the ellipsis.
+     IT's face is restored in set_iterator_to_next.  */
+  if (it->saved_face_id >= 0)
+    it->face_id = it->saved_face_id;
 
   /* If the ellipsis represents buffer text, it means we advanced in
      the buffer, so we should no longer ignore overlay strings.  */




This bug report was last modified 9 years and 189 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.