1

I want to highlight keywords when I open an email (article) in Gnus. This is what I have so far.

(add-hook 'gnus-article-mode-hook (lambda() (highlight-phrase "\\(TODO\\|job\\|Mike\\)")))

I also tried this which did not work either.

gnus-article-prepare-hook

1 Answer 1

0

Works fine for me on Emacs25. A better way to debug this is not to use the lambda:

(defun ora-gnus-article-hook ()
  (message "test"))
(add-hook 'gnus-article-mode-hook 'ora-gnus-article-hook)

Now you can instrument ora-gnus-article-hook with C-u C-M-x to see when it's getting called. You can also continuously re-define ora-gnus-article-hook without having to update gnus-article-mode-hook. In fact, once you put a lambda into a hook, the only way to remove it from that hook is basically (setq gnus-article-mode-hook nil).

1
  • Great that worked, it was the lambda causing the issue. Side note the hook that worked best was gnus-article-prepare-hook . Thanks Commented Jun 8, 2015 at 16:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.