Subject: Re: bug#39390: 28.0.50; prettify-symbols-mode confuses display when start/end faces are different

From: Eli Zaretskii <[email-masked]>
Date: Sun, 02 Feb 2020 21:20:41 +0200

> Cc: [email-masked]
> From: Raphael 'kena' Poss <[email-masked]>
> Date: Sun, 2 Feb 2020 19:28:24 +0100
> 
> Is there a way to tweak either the configuration
> (prettify-symbols-alist) or prog-mode.el to trick it into emitting the
> same face for the substitution?

It sounds like there's a misunderstanding.  prettify-symbols-mode
doesn't emit any faces, it "composes" several characters into one or
more symbols.  The composition process needs that all of the
characters to be composed have the same face.  That face is put on the
characters by font-lock mode, not by prettify-symbols-mode.  That is
why I suggested to amend the font-lock definitions for the major
mode(s) you are using.  Without all the characters to be replaced
having the same font-lock face, you will not be able to "convince"
prettify-symbols-mode to replace them, because the underlying
mechanism that examines the characters to be composed stops when the
face property changes.

> (My opinion is that this bug exists in prog-mode.el and thus a
> workaround/fix should be provided at that level, not in a per-mode or
> per-user customization.)

It isn't a bug, it is a fundamental limitation of the method used by
prettify-symbols-mode to replace text with symbols.