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


View this message in rfc822 format

From: Tassilo Horn <tsdh <at> gnu.org>
To: Raphael 'kena' Poss <knz <at> thaumogen.net>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 39390 <at> 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 12:17:19 +0100
Raphael 'kena' Poss <knz <at> thaumogen.net> writes:

> https://asciinema.org/a/3nOh1zCJYHOeQ4uXk0rQ9akv8

No doubt you get strange display effects in your example, but I don't
know if that can be considered a bug given that your configuration is
illegal anyway.  See the docs of prettify-symbols-alist:

,----[ C-h v prettify-symbols-alist RET ]
| prettify-symbols-alist is a variable defined in ‘prog-mode.el’.
| Its value is nil
| 
|   Automatically becomes buffer-local when set.
| 
| Documentation:
| Alist of symbol prettifications.
| Each element looks like (SYMBOL . CHARACTER), where the symbol
| matching SYMBOL (a string, not a regexp) will be shown as
| CHARACTER instead.
| 
| CHARACTER can be a character, or it can be a list or vector, in
| which case it will be used to compose the new symbol as per the
| third argument of ‘compose-region’.
`----

I.e., the second element of each pair in `prettify-symbols-alist' is a
simple replacement glyph only in the case were it is a character.  You
provide strings instead, so the outcome can only be determined by
checking what `compose-region' does with that input.

AFAIK, `prettify-symbols-mode's intent is to replace programming
language symbols (like "lambda" in Lisp or >>= in Haskell) with a fancy
single Unicode character each, not to replace any text with any
arbitrary other text.  (Also, using multi-word matches like "setq abc"
or unbalanced expressions like "(push" is definitely asking for
trouble.)

Bye,
Tassilo




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.