Reputation: 6387
What is the root mode I need to hook to highlight TODOs in Ruby, Lisp, and C-like languages. I tried the following, but it doesn't highlight TODO in Ruby or Lisp:
(defun highlight-todos (font-lock-add-keywords nil
'(("\\<\\(FIXME\\|TODO\\|BUG\\):" 1 font-lock-warning-face t))))
(add-hook 'text-mode-hook 'highlight-todos)
Upvotes: 7
Views: 2711
Reputation: 5867
I think to get it to all programming modes to work use prog-mode-hook
(add-hook 'prog-mode-hook 'highlight-todos)
Upvotes: 6