Subject: bug#22323: closed (Re: bug#22323: Font fallback causes inconsistent stacking of faces in overlays with invisible property)

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 08 Jan 2016 10:24:02 +0000

Your bug report

#22323: Font fallback causes inconsistent stacking of faces in overlays with invisible property

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
22323: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22323
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#22323: Font fallback causes inconsistent stacking of faces in overlays with invisible property
From: Eli Zaretskii <[email-masked]>
To: Clément Pit--Claudel <[email-masked]>
Cc: [email-masked]
Date: Fri, 08 Jan 2016 12:22:52 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

> Cc: [email-masked]
> From: Clément Pit--Claudel <[email-masked]>
> Date: Thu, 7 Jan 2016 20:19:25 -0500
> 
> > 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?
> 
> I like it :) I find it much more consistent that what we currently have. Plus,
> has a desirable property that you pointed out and that I agree with, that the
> properties of the invisible text do not affect the display of the ellipsis. The
> current implementation doesn't have that property (adding a face to a hidden
> character will cause the ellipsis to change to the default face), so I think
> it's a net gain.

Thanks, I pushed it, and I'm marking these 2 bugs as done.

> (In fact, I'm even a bit surprised that it handles the selection and font
> fallback cases properly. It's great that it does though; but did I apply the
> patch incorrectly?)

Yes, you applied correctly.  The default ellipsis uses ASCII
characters, so I think the fallback font doesn't affect them.

Subject: Font fallback causes inconsistent stacking of faces in overlays with invisible property
From: Clément Pit--Claudel <[email-masked]>
To: [email-masked]
Date: Thu, 7 Jan 2016 11:52:55 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi all,

Font fallback seems to break face stacking for invisible overlays:

This works fine:

(with-current-buffer (get-buffer-create "No prettification: ellispis is highlighed")
  (erase-buffer)
  (fundamental-mode)
  (add-to-invisibility-spec '(outline . t))
  (insert "abc!!def!!ghi")
  (let ((ov (make-overlay 6 9)))
    (overlay-put ov 'invisible 'outline))
  (let ((ov (make-overlay (point-min) (point-max))))
    (overlay-put ov 'face 'region))
  (pop-to-buffer (current-buffer)))

This doesn't work (assuming that ℙ is not in your usual font):

(with-current-buffer (get-buffer-create "No prettification: ellispis is highlighed")
  (erase-buffer)
  (fundamental-mode)
  (add-to-invisibility-spec '(outline . t))
  (insert "abcℙℙdefℙℙghi")
  (let ((ov (make-overlay 6 9)))
    (overlay-put ov 'invisible 'outline))
  (let ((ov (make-overlay (point-min) (point-max))))
    (overlay-put ov 'face 'region))
  (pop-to-buffer (current-buffer)))

I came across this while using prettify-symbols-mode:

(with-current-buffer (get-buffer-create "With prettification to common character: ellispis is highlighed")
  (erase-buffer)
  (fundamental-mode)
  (add-to-invisibility-spec '(outline . t))
  (insert "abc!!def!!ghi")
  (setq prettify-symbols-alist '(("!!" . ?ℙ)))
  (prettify-symbols-mode)
  (let ((ov (make-overlay 6 9)))
    (overlay-put ov 'invisible 'outline))
  (let ((ov (make-overlay (point-min) (point-max))))
    (overlay-put ov 'face 'region))
  (pop-to-buffer (current-buffer)))

Cheers,
Clément.