GNU bug report logs - #77627
31.0.50; prettify-symbols-mode fails when replacement CHARACTER is a composition rule

Previous Next

Package: emacs;

Reported by: Visuwesh <visuweshm <at> gmail.com>

Date: Tue, 8 Apr 2025 04:33:02 UTC

Severity: normal

Found in version 31.0.50

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

Bug is archived. No further changes may be made.

Full log


Message #13 received at 77627-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Visuwesh <visuweshm <at> gmail.com>
Cc: 77627-done <at> debbugs.gnu.org
Subject: Re: bug#77627: 31.0.50;
 prettify-symbols-mode fails when replacement CHARACTER is a
 composition rule
Date: Tue, 08 Apr 2025 19:06:32 +0300
> From: Visuwesh <visuweshm <at> gmail.com>
> Date: Tue, 08 Apr 2025 20:55:02 +0530
> 
> [செவ்வாய் ஏப்ரல் 08, 2025] Visuwesh wrote:
> 
> > As per the docstring of prettify-symbols-alist, the replacement for any
> > SYMBOL can be:
> >
> >     Each element looks like (SYMBOL . CHARACTER), where the symbol
> >     matching SYMBOL (a string, not a regexp) will be shown as
> >     CHARACTER instead.
> >
> > where CHARACTER being list or vector implies that it is a composition
> > rule.  However, prettify-symbols--composition-displayable-p fails
> > because it assumes CHARACTER is always a character (i.e., integer).
> >
> > To reproduce,
> >
> >     1. emacs -Q
> >     2. M-: (setq prettify-symbols-alist '(("\\left\\{" . (?⎨ (tc . Bc) ?⎧ (Bc . tc) ?⎩)))) RET
> >     3. M-x toggle-debug-on-error RET
> >     4. M-x prettify-symbols-mode RET
> >     5. Witness the backtrace.
> 
> OK, the new predicate does consider composition rule but there's a typo:
> 
> diff --git a/lisp/progmodes/prog-mode.el b/lisp/progmodes/prog-mode.el
> index 33e0d354fee..6c6b14d455a 100644
> --- a/lisp/progmodes/prog-mode.el
> +++ b/lisp/progmodes/prog-mode.el
> @@ -244,8 +244,8 @@ prettify-symbols--composition-displayable-p
>      ;; check that every even-indexed element is displayable
>      (seq-every-p
>       (lambda (idx-elt)
> -       (if (evenp (car idx-elt))
> -           (char-displayable-on-frame-p (cdr idx-elt))
> +       (if (evenp (cdr idx-elt))
> +           (char-displayable-on-frame-p (car idx-elt))
>           t))
>       (seq-map-indexed #'cons composition)))
>     (t

Thanks, installed on master, and closing the bug.




This bug report was last modified 101 days ago.

Previous Next


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