unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: help-gnu-emacs@gnu.org
Subject: Re: highlighting keywords in comments
Date: Sun, 06 Mar 2011 16:31:31 -0500	[thread overview]
Message-ID: <jwvwrkcos0y.fsf-monnier+gnu.emacs.help@gnu.org> (raw)
In-Reply-To: mailman.3.1299438195.5045.help-gnu-emacs@gnu.org

> In java-mode (and other cc-modes), I have the following code
>                    (font-lock-add-keywords
>                     nil
>                     '(("\\(FIXME\\|TODO\\)" 1 font-lock-warning-face)))

> However, this doesn't work on FIXME or TODO words in comments, making it
> much less useful.  Is there a way for these keywords to be highlighted in
> font-lock-warning-face, even in comments?

Check the doc of `font-lock-keywords', especially the OVERRIDE part.


        Stefan


  parent reply	other threads:[~2011-03-06 21:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.3.1299438195.5045.help-gnu-emacs@gnu.org>
2011-03-06 21:22 ` highlighting keywords in comments Tim X
2011-03-06 21:31 ` Stefan Monnier [this message]
2011-03-07 16:18   ` jpkotta
2011-03-06 19:03 Nathaniel Flath
2011-03-11 17:32 ` Andreas Röhler

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=jwvwrkcos0y.fsf-monnier+gnu.emacs.help@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=help-gnu-emacs@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.
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).