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: Tue, 25 Jan 2022 08:31:53 +0200
User-agent: K-9 Mail for Android

On January 25, 2022 6:16:33 AM GMT+02:00, Richard Stallman <rms@gnu.org> wrote:
> 
> When the buffer contains a ligature character, it would be a good thing for
> Emacs to determine that the terminal doesn't support ligatures, and in
> that case to arrange to display those ligature characters using two letters.
> This should happen by default.
> 
> Other pre-composed characters could likewise be displayed in two columns
> using non-composed characters.
> 
> Emacs needs to know which compositions the terminal can display.  I
> expect it will handle a fairly limited set.  So a new TERMINFO field
> could specify which characters work, and Emacs could convert that into
> a binary array for quick lookup.  TERM=linux could have a TERMINFO
> field to say that ligatures don't work.
> 

This is supposed to be working already, up to a point, see terminal_glyph_code 
in terminal.c.  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.

I don't think I agree that this must work by default.  That's certainly the 
desire, but the capabilities of the linux terminal and the way they are 
reported are a mess, and the use case is quite marginal nowadays.  Ligatures 
are no different for this purpose from any other non-ASCII character that the 
console cannot display. We have the latin1-display feature that you can turn on 
if your console doesn't cope well enough with non-ASCII characters.  And if you 
want to set up display of ASCII equivalents for just a small set of characters, 
you can use the latin1-display-char function todo that in your .emacs, in a way 
that suits the capabilities of your particular type and version of the linux 
console.



reply via email to

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