bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#57693: 29.0.50; Is there a more reliable version of `char-displayabl


From: Eli Zaretskii
Subject: bug#57693: 29.0.50; Is there a more reliable version of `char-displayable-p'?
Date: Mon, 12 Sep 2022 14:15:10 +0300

> From: Ihor Radchenko <yantar92@gmail.com>
> Cc: 57693@debbugs.gnu.org
> Date: Mon, 12 Sep 2022 13:46:50 +0800
> 
> > Do you need this to work for TTY frames as well?  If so, it could be a
> > problem, since most terminal emulators don't provide a way of
> > inquiring whether a certain character can be displayed.
> > char-displayable-p currently just checks on most terminals that the
> > terminal-coding-system can _encode_ the character, which isn't enough
> > if the terminal encoding is UTF-8.
> 
> The original code I was referring to unconditionally used a "safe"
> fallback on terminals. If there is no technical possibility to determine
> whether a character can be displayed, so be it.

If the terminal's encoding is UTF-8, and it doesn't support the method
we use to query about individual glyphs, char-displayable-p may return
non-nil when the character cannot be displayed, i.e. will show as an
empty box or something.  Otherwise, char-displayable-p does provide
the correct answer for TTY frames.

> I am thinking about something like below (to insert string, not a char),

LGTM.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]