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

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

font-lock and regexp-opt


From: Mads Jensen
Subject: font-lock and regexp-opt
Date: 10 Sep 2005 21:20:32 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4

Hi NG,

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")

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. I posted the entire
file here: http://mads.har-talt.dk/inducks.el (I am concentrating on
writing the font-lock part at the moment)

I am a total newbie in Emacs Lisp, but prefer trying to write something
useful instead of doing a lot of exercises. Naturally I read
documentation and tutorials, too.
--
Mads Jensen - mail sent to address ends in /dev/null
              s/spam/madsj for emailing me 
              gpg: 7E775BDA

It is impossible to make anything foolproof because fools are so
ingenious.


reply via email to

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