There are certain things like the display of trailing whitespace, display of buffer boundaries, rainbow-colored delimiters and many more I'd like to enable in most modes or rather, all programming- and text-related ones (because displaying trailing spaces in, say ediff-mode
, would clash with the major mode) instead of using a globalized minor mode with exception rules. Since most modes are derived from either prog-mode
or text-mode
, adding the function in question to both prog-mode-hook
and text-mode-hook
does work, however there are enough modes not following this specification, such as css-mode
or LaTeX-mode
.
I'd like to define a hook that encompasses all these modes for the time being to only add functions to one hook. Let's call it non-special-mode-hook
(to distinguish it from special-mode-hook
). How would I be able to create such a hook that is run for all major modes it is made for?