[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#77627: 31.0.50; prettify-symbols-mode fails when replacement CHARACT
From: |
Visuwesh |
Subject: |
bug#77627: 31.0.50; prettify-symbols-mode fails when replacement CHARACTER is a composition rule |
Date: |
Tue, 08 Apr 2025 20:55:02 +0530 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
[செவ்வாய் ஏப்ரல் 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