emacs-devel
[Top][All Lists]
Advanced

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

Re: Excessive refontification when setting jit-lock-context-unfontify-po


From: Stefan Monnier
Subject: Re: Excessive refontification when setting jit-lock-context-unfontify-pos
Date: Wed, 25 Apr 2007 00:22:20 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.97 (gnu/linux)

> j-l-c-u-p seemed to be the only mechanism working reliably.  In my
> f-l-fontify-region-function I tried to set the f-l-multiline and
> j-l-defer-multiline properties on the region in question which had no
> effect.

In your f-l-fontify-region-function, you should do what you'd otherwise do
in f-l-extend-region: i.e. extend the region.  No messing with
font-lock-multiline or other properties.  Just computing a new (larger)
region and passing that to f-l-default-fontify-region.

This is meant to make sure that if the region to highlight is part of
a larger multiline-element, it will be refontified in the proper context.

Then in font-lock-keywords, whenever you encounter a multiline element, you
want to mark it with the font-lock-multiline property.  This might work
automatically if you set the font-lock-multiline to t.

That should make sure that when a multiline element is later modified
(possibly turning it into something completely different), it is
completely refontified.

That should be enough to make it all work, regardless of the use of
jit-lock or even lazy-lock.

If it doesn't work, please give more details, including a sample session
where it fails and an explanation of how it fails.


        Stefan




reply via email to

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