Multiline Font Lock
  Home FAQ Contact Sign in
gnu.emacs.help only
 
Advanced search
POPULAR GROUPS

more...

gnu.emacs.help Profile…
 Up
Multiline Font Lock         


Author: Eric
Date: Sep 10, 2008 07:50

I'm trying to set up multiline font-locking for a major mode I've been
working on. I've spent a fair bit of time wrestling with it, but I'm
still not getting completely desired results.
Emacs correctly fontifies the multiline region, and then correctly
refontifies it when the fontify-region function gets called again.

The problem is that when I make changes in the middle of the region,
the modified line and subsequent line get defontified until Emacs
comes through and refontifies.

When I set font-lock-multiline variable to 't', the text is never
defontified and new text is always immediately fontified correctly
(and without the aid of my region function [see below]). I'm guessing
then that there's some problem with my regexp or with the way I'm
applying my font-lock-multiline property.

What should I be doing differently so that I get the same behavior
without needing to turn font-lock-multiline on? Do I just _need_ to
set the font-lock-multiline variable to get the desired behavior?
Show full article (2.74Kb)
1 Comment
Re: Multiline Font Lock         


Author: Lennart Borgman (gmail)
Date: Sep 10, 2008 13:59

Eric wrote:
> The syntax for one of these multiline groups is:
> JAVA_ON
> whatever
> text
> your
> heart desires with any
> {{punctuation}}} until
> JAVA_OFF

Perhaps an alternative is to use multiple major modes:

http://www.emacswiki.org/cgi-bin/wiki/MultipleModes
no comments