2

I would like to be able to replace a_e with aₑ using prettify symbols. However, if I add ("_e" . ₑ) to the prettify symbols alist, it will show the subscript e if _e is surrounded with spaces but not if a letter precedes the string as in the case of a_e.

How can I make the visual replacement even if the string is inside of a word ?

This can be done with prettify-symbols-compose-predicate but I do not understand a lot from the documentation of that symbol.

1 Answer 1

4

prettify-symbols-compose-predicate is set up by default to only prettify symbols that are surrounded by non-symbol characters, which is not your case. It gets passed the buffer positions at which the symbol starts and ends, and the value which matched (which would be an entry in prettify-symbols-alist). Since you don't care about those, you can do

(setq-local prettify-symbols-compose-predicate #'always)

which will ignore the arguments it's passed and return t.

1
  • Thank you that worked Commented Mar 14 at 3:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.