GNU bug report logs - #39390
28.0.50; prettify-symbols-mode confuses display when start/end faces are different

Previous Next

Package: emacs;

Reported by: Raphael 'kena' Poss <knz <at> thaumogen.net>

Date: Sun, 2 Feb 2020 15:44:01 UTC

Severity: normal

Found in version 28.0.50

Full log


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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Tassilo Horn <tsdh <at> gnu.org>
Cc: knz <at> thaumogen.net, 39390 <at> debbugs.gnu.org
Subject: Re: bug#39390: 28.0.50; prettify-symbols-mode confuses display when
 start/end faces are different
Date: Mon, 17 Feb 2020 19:30:04 +0200
> From: Tassilo Horn <tsdh <at> gnu.org>
> Cc: Eli Zaretskii <eliz <at> gnu.org>,  39390 <at> debbugs.gnu.org
> Date: Mon, 17 Feb 2020 16:59:38 +0100
> 
> > There is an error in the display code when compose-region composes
> > over multiple faces, and I'd like us to focus on that.  I'm pretty
> > sure that pretty-symbols-mode is just one of multiple ways one can
> > trigger this bug.
> 
> Indeed, that's the real problem.  I guess that there's an implicit
> assumption that composition always takes place in one word or symbol
> which is almost always fontified with just one face.  Your example
> invalidates that assumption.

As I explained at the very beginning of this discussion, this is not
an assumption, this is part of the basic design of the Emacs display
engine: it _never_ considers characters in different faces together,
and thus can never compose them.  We could perhaps lift this
limitation when faces differ only in colors (thus we will be able to
support character compositions when part of them are inside a
highlighted region), but a face in general specifies also the font,
its dimensions, weight, slant, etc., and we cannot possibly combine
glyphs that come from different fonts.  So this limitation is not
really arbitrary, and can only be lifted by a thorough redesign of how
the display engine traverses the text it is about to display, and what
it does when it meets a composition that crosses face boundaries.

Let me also remind you that character composition was introduced for
purposes very different from what pretty-symbols-mode does; it
definitely wasn't supposed to support arbitrary display of one text
as another: for that you have display strings and overlays.

> But then the question is how the composition should be displayed?  In
> your example where you replace "setq abc" with the LAST QUARTER MOON
> WITH FACE Unicode character, should that have font-lock-keyword-face
> (like setq) or the default face (like abc)?

Imagine that font-lock-keyword-face specifies bold-italic typeface, or
maybe even a different size of the font, for example.  There be
dragons.




This bug report was last modified 5 years and 124 days ago.

Previous Next


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