GNU bug report logs - #22323
Font fallback causes inconsistent stacking of faces in overlays with invisible property

Previous Next

Package: emacs;

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

Date: Thu, 7 Jan 2016 16:54:01 UTC

Severity: normal

Merged with 22320

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#22323: closed (Font fallback causes inconsistent stacking of
 faces in overlays with invisible property)
Date: Fri, 08 Jan 2016 10:24:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Fri, 08 Jan 2016 12:22:52 +0200
with message-id <83twmopdz7.fsf <at> gnu.org>
and subject line Re: bug#22323: Font fallback causes inconsistent stacking of faces in overlays with invisible property
has caused the debbugs.gnu.org bug report #22323,
regarding Font fallback causes inconsistent stacking of faces in overlays with invisible property
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
22323: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22323
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Clément Pit--Claudel <clement.pitclaudel <at> live.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Font fallback causes inconsistent stacking of faces in overlays with
 invisible property
Date: Thu, 7 Jan 2016 11:52:55 -0500
[Message part 3 (text/plain, inline)]
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.

[signature.asc (application/pgp-signature, attachment)]
[Message part 5 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: Clément Pit--Claudel <clement.pitclaudel <at> live.com>
Cc: 22323-done <at> debbugs.gnu.org
Subject: Re: bug#22323: Font fallback causes inconsistent stacking of faces in
 overlays with invisible property
Date: Fri, 08 Jan 2016 12:22:52 +0200
> Cc: 22323 <at> debbugs.gnu.org
> From: Clément Pit--Claudel <clement.pitclaudel <at> live.com>
> 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.


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

Previous Next


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