In other words, are the text-part-categories which can be highlighted limited in amount and hard-wired into Emacs (keywords, functions, strings, digits, numbers, etc.) or is it possible to define any number of additional own categories like for example highlighting of emoticons or special words with different fonts/faces/decorations as any other ones?
If it can be done ... What would be the steps for defining an own category and a font face for highlighting it along with a file type for which this highlighting should work?
font-lock-add-keywords
, read theFont Lock Mode
section in the Emacs manual, search this site for the tagfont-lock
, read a mode's implementation and see how they do it (I suggestlisp/shell.el
which is relatively simple).font-lock
.