From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Subject: Re: [PATCH 2/2] Make font-lock honor parents mode of current major-mode
Date: Thu, 10 Feb 2011 13:16:44 -0500 [thread overview]
Message-ID: <jwvaai3vjt8.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87d3n0w8a1.fsf@keller.adm.naquadah.org> (Julien Danjou's message of "Thu, 10 Feb 2011 10:25:42 +0100")
> #+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
next prev parent reply other threads:[~2011-02-10 18:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-08 18:43 [PATCH 1/2] Add new function derived-mode-parents Julien Danjou
2011-02-08 18:43 ` [PATCH 2/2] Make font-lock honor parents mode of current major-mode Julien Danjou
2011-02-09 16:37 ` Stefan Monnier
2011-02-09 17:15 ` Julien Danjou
2011-02-09 21:47 ` Stefan Monnier
2011-02-10 9:25 ` Julien Danjou
2011-02-10 18:16 ` Stefan Monnier [this message]
2011-02-08 21:12 ` [PATCH 1/2] Add new function derived-mode-parents Stefan Monnier
2011-02-08 21:19 ` Julien Danjou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvaai3vjt8.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).