Was wondering if anyone knew of a way to go into the .emacs file and add an attribute to change the color of a specific string in all files it appears. The specific example I wish to use this for would be for any given file, if the string "TODO" exists, make the color of that text red. I want that string to stand out in my java, python, c++, etc. files so I can pick them out when easily looking around.
A quick example would be this, which adds the
font-lock-warning-face to all regex matches in all modes that derive from prog-mode:
(add-hook 'prog-mode-hook '(lambda () (font-lock-add-keywords nil '(("\\<\\(FIX\\|TODO\\|FIXME\\|HACK\\|REFACTOR\\):" 1 font-lock-warning-face t)))))
Further reading with examples in the emacs wiki: https://www.emacswiki.org/emacs/AddKeywords