From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mads Jensen Newsgroups: gmane.emacs.help Subject: font-lock and regexp-opt Date: 10 Sep 2005 21:20:32 +0200 Organization: TDC Totalloesninger Message-ID: <87acikbugv.fsf@madamex.madamex.dk> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1126380328 9167 80.91.229.2 (10 Sep 2005 19:25:28 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 10 Sep 2005 19:25:28 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Sep 10 21:25:22 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EEAyY-0003gi-9X for geh-help-gnu-emacs@m.gmane.org; Sat, 10 Sep 2005 21:25:22 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EEAyX-00089D-6j for geh-help-gnu-emacs@m.gmane.org; Sat, 10 Sep 2005 15:25:21 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 Original-Lines: 32 Original-NNTP-Posting-Host: 80.197.19.230 Original-X-Trace: 1126380174 dread16.news.tele.dk 166 80.197.19.230:13831 Original-X-Complaints-To: abuse@post.tele.dk Original-Xref: shelby.stanford.edu gnu.emacs.help:133822 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:29369 Archived-At: 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.