info-gnus-english
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Highlight key words


From: Richard Riley
Subject: Re: Highlight key words
Date: Tue, 17 Feb 2009 19:58:26 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.90 (gnu/linux)


Super cool! Thanks Ted.


Ted Zlatanov <tzz@lifelogs.com> writes:

> On Tue, 17 Feb 2009 17:53:37 +0800 poppyer <poppyer@gmail.com> wrote: 
>
> p> If you are talking about put some color in some keywords within the
> p> *Article* view, you can write a simply function using article-goto-body,
> p> re-search-forward and put-text-property; and add into 
> gnus-article-prepare-hook.
>
> I do this as follows (suggested by someone else long ago, of course):
>
> (defun tzz-highlighting-install ()
>   (interactive)
>   (font-lock-mode -1)
>   (font-lock-mode 1)
>   (font-lock-add-keywords
>    nil
>    `(
>      ("\\(FIXME\\|TONOTE\\|TODO\\)" (1 'font-lock-warning-face prepend)))))
>
> (dolist  (hook '(emacs-lisp-mode-hook
>                  cperl-mode-hook
>                  shell-mode-hook
>                  text-mode-hook
>                  change-log-mode-hook
>                  makefile-mode-hook
>                  message-mode-hook
>                  texinfo-mode-hook))
>   (add-hook hook 'tzz-highlighting-install))
>
> Obviously the list of modes, the keywords, and the face can be
> customized, but the basic idea is simple.
>
> I forget why I turn font-lock-mode off and back on, it's been a while
> and I forgot to comment it.
>
> Ted

-- 
 important and urgent problems of the technology of today are no longer the 
satisfactions of the primary needs or of archetypal wishes, but the reparation 
of the evils and damages by the technology of yesterday.  ~Dennis Gabor, 
Innovations:  Scientific, Technological and Social, 1970


reply via email to

[Prev in Thread] Current Thread [Next in Thread]