help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: set face for added font lock keywords


From: Teemu Likonen
Subject: Re: set face for added font lock keywords
Date: Mon, 10 Jan 2011 08:43:21 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2.91 (gnu/linux)

* 2011-01-09 07:27 (-0800), extronom@googlemail.com wrote:

> I'm trying to add some new keywords by doing font-lock-add-keywords so
> that a FIXME keyword gets highlighted, which works quite well. When I
> try to change the color of the used face it doesn't work and probably
> somebody could give me a hint what the problem is here (I'm still a
> newbie regarding elisp programming).

I'm the author of wcheck-mode [1], so perhaps quite naturally I would
use it for this task too. Let's create a new language called "fixme" and
choose some face for highlighting:


    ;; Make sure the variable exists.
    (defvar wcheck-language-data nil)

    (push '("fixme"
            (program . (lambda (strings)
                         (when (member "FIXME" strings)
                           (list "FIXME"))))
            (face . highlight))
          wcheck-language-data)


This configuration uses face "highlight" but you can use any face you
want. Change languages with command wcheck-change-language and switch
the mode on and off with command wcheck-mode. See the Emacs wiki page
[1] for more information about wcheck-mode.

---------------
 1. http://www.emacswiki.org/emacs/WcheckMode



reply via email to

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