font-lock-add-keywords lets users highlight keywords. Can you also specify an alternative text? For example, in C source code, besides using a special face, we may wish to visualize
As indicated by @Drew and @Lindydancer, Prettify Symbols Mode - available with vanilla Emacs - allows for sequences of characters to be displayed by a custom character sequence, by customizing the
prettify-symbols-alist buffer-local variable. Examples:
(push '("&&" . "∧") prettify-symbols-alist) ; Single character replacement. (push '("&&" . (?a ?n ?d)) prettify-symbols-alist) ; String replacement.