GNU bug report logs -
#20146
font-lock-extend-jit-lock-region-after-change: results are discarded instead of being returned.
Previous Next
Reported by: Alan Mackenzie <acm <at> muc.de>
Date: Thu, 19 Mar 2015 23:03:02 UTC
Severity: normal
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Hello, Stefan.
On Sun, Mar 22, 2015 at 10:01:53PM -0400, Stefan Monnier wrote:
> >> >> The major mode sets font-lock-extend-region-function and this functions'
> >> >> result should be (and is) respected by the rest of font-lock.
> >> > If only, but this is simply not the case at the moment.
> >> > jit-lock-fontify-now has a hard-coded extension to whole lines,
> >> > regardless of the contents of font-lock-extend-region-functions.
> >> There's no relationship between the two. The bounds that
> >> font-lock-fontify-region [gets] are not under the major mode's control.
> > Yes they are. They can be set by
> > font-lock-extend-after-change-region-function, as described in the elisp
> > manual.
> That's where you're confused:
> font-lock-extend-after-change-region-function affects the region that's
> declared as "in need of refresh because of a change". But that doesn't
> mean that this region will then be passed to font-lock-fontify-region.
> For example, if that region is not currently visible in any window, then
> jit-lock will typically do nothing. And if only some part of that
> region is visible in a window, then maybe only that part will be then
> passed to font-lock-fontify-region so as to actually refresh it.
> And maybe that part will be combined with some other parts that were
> also in need of refresh and are now newly visible. Or maybe that part
> will actually be fontified in several steps (i.e. several calls to
> font-lock-fontify-region).
Yes, I was confused about that. I hope I've got it now. Thanks for the
help.
[ ... ]
> > Looking more critically at jit-lock-fontify-now, there is simply no need
> > for it to expand the region to whole lines.
> I agree with this statement (I actually have such a change in my local
> tree), but that won't help you.
> Looking at jit-lock as the source of your pain is a waste of time.
OK. But I have to be aware of how jit-lock works: in particular how the
actions in after-change-functions influence those of
jit-lock-fontify-now and font-lock-fontify-region.
[ ... ]
> Stefan
--
Alan Mackenzie (Nuremberg, Germany).
This bug report was last modified 5 years and 202 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.