From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: August Karlstrom Newsgroups: gmane.emacs.help Subject: Re: font-lock and regexp-opt Date: Tue, 13 Sep 2005 02:28:57 GMT Organization: Telia Internet Message-ID: References: <87acikbugv.fsf@madamex.madamex.dk> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1126578658 5930 80.91.229.2 (13 Sep 2005 02:30:58 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 13 Sep 2005 02:30:58 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Sep 13 04:30:50 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EF0Yv-0000GM-9d for geh-help-gnu-emacs@m.gmane.org; Tue, 13 Sep 2005 04:30:21 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EF0Yu-0004vL-Q1 for geh-help-gnu-emacs@m.gmane.org; Mon, 12 Sep 2005 22:30:20 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newspeer2.se.telia.net!se.telia.net!masternews.telia.net.!newsb.telia.net.POSTED!not-for-mail User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050727) X-Accept-Language: en-us, en Original-Newsgroups: gnu.emacs.help In-Reply-To: <87acikbugv.fsf@madamex.madamex.dk> Original-Lines: 27 Original-NNTP-Posting-Host: 83.250.201.33 Original-X-Complaints-To: abuse@telia.com Original-X-Trace: newsb.telia.net 1126578537 83.250.201.33 (Tue, 13 Sep 2005 04:28:57 CEST) Original-NNTP-Posting-Date: Tue, 13 Sep 2005 04:28:57 CEST Original-Xref: shelby.stanford.edu gnu.emacs.help:133887 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:29439 Archived-At: 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