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

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

Re: regular expression help (again)


From: Stefan Monnier
Subject: Re: regular expression help (again)
Date: Mon, 28 Jan 2013 09:33:57 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

> there is something I'm missing: I'm still writing my mode for a
> programming language and I'd like to set a font-lock for a block of
> lines that begins with /SOMETHING and ends with /* like the following:

I recommend you take a look at (info "(elisp)Multiline Font Lock").

Also in some cases, you can use syntax-propertize-function instead, to
mark the whole construct as a kind of comment or string.  Then use
font-lock-syntactic-face-function to highlight the block with
a particular face (if the default string-face or comment-face is not
good enough).  And then in font-lock-keywords, you can match "word that
is not made by underscores" and use (syntax-ppss) to decide whether it's
within a /MASK block or not to decide how to highlight it.


        Stefan




reply via email to

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