Subject: bug#20146: font-lock-extend-jit-lock-region-after-change: results are discarded instead of being returned.

From: Stefan Monnier <[email-masked]>
Date: Fri, 20 Mar 2015 15:39:10 -0400

> Perhaps we could implement the convention that when a major mode has
> positively set the font-lock region's start and end points, these should
> be accepted by F/J-lock, but when not, F/J-lock should be free to alter
> them (as it typically does now).

No the core of the API is font-lock-fontify-region and it should work
with *any* bounds (i.e. if these need to be extended, it should be done
by font-lock-extend-region-function).

Jit-lock is implemented on top of that API and is hence free to use any
bounds it sees fit.

If you rely on more specific bounds being passed to
font-lock-fontify-region, that means you have a problem on your side.

> The existence of font-lock-extend-after-change-region-function makes
> this distinction possible.

The existence of font-lock-extend-after-change-region-function is an
error on my part (More specifically the result of a weakness on my part:
when you requested this feature, I added
font-lock-extend-region-function (which was the right fix) and
reluctantly accepted to also add
font-lock-extend-after-change-region-function just out of tiredness of
arguing that it was the wrong solution).

        Stefan