I would like to be able to highlight a particular phrase (in my case: @dakrone
) in every emacs buffer, regardless of the mode (it's fine if it doesn't work in fundamental-mode
). I know of something like:
(defun eos/add-watchwords ()
"Highlight FIXME and TODO in code"
(font-lock-add-keywords
nil '(("\\<\\(TODO\\(?:(.*)\\)?:?\\)\\>" 1 'warning prepend)
("\\<\\(FIXME\\(?:(.*)\\)?:?\\)\\>" 1 'error prepend))))
(add-hook 'prog-mode-hook #'eos/add-watchwords)
But I haven't gotten something like that to be applied globally instead of having to manually add every mode I want to highlight in. Is there a way do do this?
font-lock
; e.g.,org-agenda-mode
uses text-properties. Font-lock and text-properties do not play well together. A third option is to use overlays.