I want to add some common settings for the programming modes. such like: turn on watchwords, highlight parentheses, and so on.
so I add code as follow:
(add-hook 'prog-mode-hook 'turn-on-watchwords)
This works in Emacs 24, but Emacs 23 doesn’t works, I don’t know if is something else missing or Emacs 23 itself makes this doesn’t work.
If Emacs 23 doesn’t support prog-mode-hook, how can I add the common settings for programming mode?
prog-mode(and so all the hooks associated with it) was added in Emacs 24.You can simulate it (slightly) by just adding your hook to all the programming hooks you normally use (admittedly this is a little bit hacky):