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

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

Re: keyword highlighting


From: ken
Subject: Re: keyword highlighting
Date: Fri, 10 Sep 2004 08:43:15 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040831

Dan Boitnott wrote:

I'm adding keyword highlighting to a new major mode I'm writing. I'm having trouble getting one type to work. I'd like to set any line that begins with "vms " to font-lock-constant face. I thought something like this should work:

 ("^VMS.*$" . font-lock-constant-face)

But the lines don't highlight at all.  If I do:

("^VMS" . font-lock-constant-face)

the "VMS" is colored but the rest of the line isn't.  If I do this:

("^VMS...." . font-lock-constant-face)

the "VMS" and four characters after are colored. This suggests the caret and the period are working as expected. Is the engine matching un-greedily? Any help would be appriciated.

Thanks,
Dan

Well, you're doing the right thing by playing around with it. You would do well to read up on regular expressions. (But then so would I. B) )

I'm thinking you want something like "VMS .*$"

hth,
ken




reply via email to

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