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

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

Re: font-lock regexp for complementary keywords


From: Kevin Rodgers
Subject: Re: font-lock regexp for complementary keywords
Date: Tue, 25 Jul 2006 10:15:48 -0600
User-agent: Thunderbird 1.5.0.4 (Windows/20060516)

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...

--
Kevin





reply via email to

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