GNU bug report logs - #77381
[PATCH] extend tex--prettify-symbols-alist

Previous Next

Package: emacs;

Reported by: "Paul D. Nelson" <ultrono <at> gmail.com>

Date: Sun, 30 Mar 2025 11:42:02 UTC

Severity: normal

Tags: patch

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

Bug is archived. No further changes may be made.

Full log


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

From: "Paul D. Nelson" <ultrono <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 77381 <at> debbugs.gnu.org
Subject: Re: bug#77381: [PATCH] extend tex--prettify-symbols-alist
Date: Sun, 30 Mar 2025 19:47:47 +0200
[Message part 1 (text/plain, inline)]
>> > Ideally, we should only add those which can be displayed.  The
>> > function char-displayable-p should be able to tell.  Would it be
>> > possible to change the code such that only the symbols that pass that
>> > test are added?
>> 
>> (...)
>
> For a GUI frame, if char-displayable-p returns a symbol, the character
> is not displayable.  Characters that can be displayed on a GUI frame
> should cause char-displayable-p to return a string, the name of the
> font suitable for the character.

Thanks.  With the attached patch, prettify-symbols-mode filters
prettify-symbols-alist to those entries that are displayable in the
following sense:

  (let ((display-capability (char-displayable-p char)))
    (if (display-graphic-p)
        (or (eq display-capability t)
            (fontp display-capability))
      display-capability))

I've tested it in tex-mode, with GUI and terminal Emacs, using the
examples from this thread.  Any feedback or other suggestions would be
welcome.

[0001-Restrict-symbol-prettification-to-displayable-ones.patch (text/x-patch, attachment)]

This bug report was last modified 48 days ago.

Previous Next


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