all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* font-lock and regexp-opt
@ 2005-09-10 19:20 Mads Jensen
  2005-09-11 21:54 ` Stefan Monnier
  2005-09-13  2:28 ` August Karlstrom
  0 siblings, 2 replies; 4+ messages in thread
From: Mads Jensen @ 2005-09-10 19:20 UTC (permalink / raw)


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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-09-15 19:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-10 19:20 font-lock and regexp-opt Mads Jensen
2005-09-11 21:54 ` Stefan Monnier
2005-09-15 19:02   ` Mads Jensen
2005-09-13  2:28 ` August Karlstrom

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.