> And it is still very hard to find those bugs sometimes. One suggestion
> that have been given here to test fontification code is to run it by
> calling for example font-lock-fontify-region.
>
> That does not always work because that function fontifies from top to
> bottom, but the bug may perhaps only show up in other situations.
You could try writing a small testbed which turns off regular font-lock
and allows to _manually_ trigger refontification (and contextual
refontification) according to what jit-lock and font-lock would do in
case of a buffer change. Then you could step through these routines
with edebug without being hit by intercepting timers.