From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: dkcombs@panix.com (David Combs) Newsgroups: gmane.emacs.help Subject: Re: font-lock regexp for complementary keywords Date: Sun, 13 Aug 2006 18:37:20 +0000 (UTC) Organization: Public Access Networks Corp. Message-ID: References: <87k663nduk.fsf@hans.local.net> NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1155498034 12816 80.91.229.2 (13 Aug 2006 19:40:34 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 13 Aug 2006 19:40:34 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Aug 13 21:40:32 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GCLp0-0006QY-Tu for geh-help-gnu-emacs@m.gmane.org; Sun, 13 Aug 2006 21:40:31 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GCLox-00052N-Lm for geh-help-gnu-emacs@m.gmane.org; Sun, 13 Aug 2006 15:40:27 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!bloom-beacon.mit.edu!panix!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 51 Original-NNTP-Posting-Host: panix1.panix.com Original-X-Trace: reader2.panix.com 1155494240 21066 166.84.1.1 (13 Aug 2006 18:37:20 GMT) Original-X-Complaints-To: abuse@panix.com Original-NNTP-Posting-Date: Sun, 13 Aug 2006 18:37:20 +0000 (UTC) X-Newsreader: trn 4.0-test76 (Apr 2, 2001) Original-Xref: shelby.stanford.edu gnu.emacs.help:141038 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:36664 Archived-At: In article , Kevin Rodgers wrote: >Dieter Wilhelm wrote: >> Hi >> >> I'd like to fontify Ansys keywords. The solver accepts unique short >> forms of the command keywords, the rest is ignored. For example the >> uniqe part of `/filname' is `/fil' and I'd like to fontify >> >> /fil and >> /filn and >> /filna and >> /filnam and >> /filname and >> >> as well. The only idea I got so far is to do it in 5 separate >> font-lock statements: >> >> \\(/fil\\) 1 font-lock... >> /fil\\(n\\) 1 fon... >> /filn\\(a\\) 1 ... >> /filna\\(m\\) 1 ... >> /filnam\\(e\\) 1 ... > >Why are you grouping and highlighting either "/fil" or the last letter? > >> Very ugly and inefficient, isn't it? >> Originally I thought that something like this >> >> /fil\\(n\\|na\\|nam\\|name\\) >> >> would work but rexexp-bulider doesn't show any matches for the >> complementing alternatives. > >"/fil\\(n\\(a\\(me?\\)?\\)?\\)?\\>" 0 font-lock... A really-stupid question: That last line -- were it not elisp but eg postscript (or reverse polish), I'd at least understand the syntax: font-lock would (likely) take at least two args (would get stacked) and then font-lock (op) would would run. But this *is* elisp, so just what is that expression? It clearly must be some part of a bigger expression, form, whatever. Perhaps you could show an example? Thanks! David