emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 2/2] Make font-lock honor parents mode of current major-mode


From: Stefan Monnier
Subject: Re: [PATCH 2/2] Make font-lock honor parents mode of current major-mode
Date: Thu, 10 Feb 2011 13:16:44 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

> #+begin_src: emacs-lisp
> (font-lock-add-keywords
>  'prog-mode   
>  '(("\\<\\(FIXME\\|HACK\\|XXX\\|TODO\\)" 1 font-lock-warning-face prepend)))
> #+end_src

> This is not something modes do, I think. But doing that have no effect,
> because font-lock does not check inheritance, therefore my patches.

The `prog-mode' argument to font-lock-add-keywords is the reason why
you'd need to explicitly check inheritance.
If you use

  (add-hook 'prog-mode-hook
            (lambda ()
              (font-lock-add-keywords
               nil
               '(("\\<\\(FIXME\\|HACK\\|XXX\\|TODO\\)"
                  1 font-lock-warning-face prepend)))))

then things can be made to work without ever having to look at the
inheritance data.  But of course, the above won't work either with the
current font-lock.el.  That's what we need to fix.


        Stefan



reply via email to

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