emacs-devel
[Top][All Lists]
Advanced

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

Re: New feature: displaying ligature characters in the buffer


From: Eli Zaretskii
Subject: Re: New feature: displaying ligature characters in the buffer
Date: Thu, 27 Jan 2022 09:58:42 +0200

> From: Richard Stallman <rms@gnu.org>
> Cc: psainty@orcon.net.nz, luangruo@yahoo.com, emacs-devel@gnu.org
> Date: Wed, 26 Jan 2022 23:12:57 -0500
> 
>     > I'm guessing that the diamond glyphs you see for some ligatures
>     > is the way your terminal "supports" these characters.  Or maybe
>     > it lies to Emacs about which characters it supports, or maybe
>     > the code which queries the terminal about supported characters
>     > doesn't work in your case for some other reason.
> 
> Those sound possible.
> How can I diagnose with GDB what is in fact going on?

The code responsible for that is in terminal.c, functions
terminal_glyph_code and calculate_glyph_code_table.  The latter is
called when we first want to find out whether a certain character can
be displayed by the terminal, which probably happens during startup.
I'd begin by establishing whether the ioctl used by
calculate_glyph_code_table succeeds, and if so, whether the terminal
tells us that the ligature codepoints do have glyphs in the terminal's
font.  The relevant Unicode codepoints are U+FB00..U+FB06.

Another issue could be with the terminal encoding: terminal_glyph_code
only queries the terminal for supported glyphs if
terminal-coding-system is UTF-8 -- is that what you have?

Or maybe the HAVE_STRUCT_UNIPAIR_UNICODE preprocessor condition
doesn't work on your system, in which case these functions return
trivial results.

The Lisp interface to this is internal-char-font (which on TTY frames
calls terminal_glyph_code).  Does it return the same non-negative
number for all of the ligature codepoints in the above range?  If it
does, then it could be an indication that the terminal displays the
same diamond glyph for all of them, i.e. doesn't really support them.
If internal-char-font returns a negative number, it means the terminal
cannot support those ligatures, and our processing of that is somehow
incorrect or assumes something that doesn't happen; see
char-displayable-p.



reply via email to

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