Open DamienCassou opened 7 years ago
Thanks for the link. I tried the approach of a reindent hook awhile back but found the same issues, don't think that can be made to work.
You might be right on the vocab - it would be nice if there was a general term (outside Emacs) for prettified symbols. But I think only Emacs implements them. Other editors support ligatures and people are more generally aware of ligatures so I refer to them as that. You are right though on the typography interpretation - ligatures/symbols use character composition which under the hood implements the melting you described.
I received a response from Eli here https://www.reddit.com/r/emacs/comments/74jni0/fixing_ligature_indentation_proof_of_concept/ basically saying I'm going to need to learn C and hack on emacs core for a proper implementation. I likely will go that route, but as I don't know C, who knows how far away we are from ligature support.
This might be possible after all. I've implemented a prototype at https://github.com/ekaschalk/aplig which you may find interesting. I'm sharing as I've now determined the indentation-mask approach actually does work.
Thank you for this prototype. I think it is really useful (see e.g., https://github.com/Malabarba/Nameless/issues/18).
I'm not sure about the "ligature" word. I've never seen it used in the context you use it for (e.g., transforming
lambda
intoλ
). I've only seen it in a typography context where 2 or 3 letters are still visible but attached together: just like if they were melted. I can see the relation between the two contexts but I'm not sure you can use the word in both.It seems that Emacs uses the vocabulary prettified symbols that you might want to reuse (see prog-mode.el).