I would like for certain non-alphanumeric characters (= + / < > etc.) to be highlighted in emacs while editing any language.
Using the answer to a different question on this site, I found this solution for highlighting '%' while editing Fortran:
(font-lock-add-keywords 'f90-mode
'(("%" . font-lock-keyword-face)))
but this is only one symbol in one language. I can achieve what I want by polluting my .emacs file:
(font-lock-add-keywords 'c++-mode
'(("=" . font-lock-keyword-face)))
(font-lock-add-keywords 'java-mode
'(("=" . font-lock-keyword-face)))
(font-lock-add-keywords 'python-mode
'(("=" . font-lock-keyword-face)))
and so on, but this introduces a bug in which the last few lines of any file do not get any syntax highlighting at all.
How can I, across all language modes, enable syntax highlighting for a certain set of non-alphanumeric characters?