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

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

Re: font-lock and regexp-opt


From: August Karlstrom
Subject: Re: font-lock and regexp-opt
Date: Tue, 13 Sep 2005 02:28:57 GMT
User-agent: Mozilla Thunderbird 1.0.6 (X11/20050727)

Mads Jensen wrote:
I am trying to write my first major mode, where I'd like to use
font-lock-mode to colorize some words. I browsed some code, and saw that
people are using regexp-opt for this, so I went with this approach,
too. Therefore, I have:

(defconst inducks-keywords (regexp-opt '(...) t) "inducks fields to colorize")

(regexp-opt '(...) 'words) is even better.

And wrote the following:

(defconst inducks-font-heroes
(list (cons (concat "\\<\\(" inducks-keywords "\\)\\>")
    'inducks-keyword)))

Is this a good way to do it ? It doesn't compile.

How does the compilation fail. Which version of Emacs are you using and on what operating system? Have you `M-x h f regexp-opt' etc.


August



reply via email to

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