unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Tassilo Horn <tsdh@gnu.org>
Cc: knz@thaumogen.net, 39390@debbugs.gnu.org
Subject: 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	[thread overview]
Message-ID: <83blpxm89v.fsf@gnu.org> (raw)
In-Reply-To: <875zg5432t.fsf@gnu.org> (message from Tassilo Horn on Mon, 17 Feb 2020 16:59:38 +0100)

> From: Tassilo Horn <tsdh@gnu.org>
> Cc: Eli Zaretskii <eliz@gnu.org>,  39390@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.





  parent reply	other threads:[~2020-02-17 17:30 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-02 14:45 bug#39390: 28.0.50; prettify-symbols-mode confuses display when start/end faces are different Raphael 'kena' Poss
2020-02-02 17:18 ` Eli Zaretskii
2020-02-02 17:56   ` Raphael 'kena' Poss
2020-02-02 18:03     ` Eli Zaretskii
2020-02-02 18:28       ` Raphael 'kena' Poss
2020-02-02 19:20         ` Eli Zaretskii
2020-02-02 20:00           ` Raphael 'kena' Poss
2020-02-02 20:09             ` Eli Zaretskii
2020-02-02 20:26               ` Raphael 'kena' Poss
2020-02-03 15:50                 ` Eli Zaretskii
2020-02-04 22:07                   ` Raphael 'kena' Poss
2020-02-16 17:46                     ` Eli Zaretskii
2020-02-16 18:37                       ` Raphael 'kena' Poss
2020-02-16 19:29                         ` Eli Zaretskii
2020-02-16 19:34                           ` Eli Zaretskii
2020-02-16 19:40                             ` Raphael 'kena' Poss
2020-02-16 20:23                               ` Eli Zaretskii
2020-02-17  2:47                                 ` Raphael 'kena' Poss
2020-02-17 11:17                                   ` Tassilo Horn
2020-02-17 12:35                                     ` Raphael 'kena' Poss
2020-02-17 15:59                                       ` Tassilo Horn
2020-02-17 16:06                                         ` Raphael 'kena' Poss
2020-02-17 17:30                                         ` Eli Zaretskii [this message]
2020-02-17 18:37                                           ` Raphael 'kena' Poss
2020-02-17 19:24                                             ` Eli Zaretskii
2020-02-17 19:28                                               ` Raphael 'kena' Poss
2020-02-17 20:14                                                 ` Eli Zaretskii
2020-02-17 17:11                                     ` Eli Zaretskii
2020-02-17 17:13                                   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83blpxm89v.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=39390@debbugs.gnu.org \
    --cc=knz@thaumogen.net \
    --cc=tsdh@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).