[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: `font-lock-extend-region-functions' vs. `font-lock-extend-after-chan
Re: `font-lock-extend-region-functions' vs. `font-lock-extend-after-change-region-function'
Wed, 29 Apr 2009 09:46:51 -0400
Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux)
> But the new region that EXTEND is called with begins at 523, and not 701
> even though we processed the region between 523 and 701 already.
> This seems more inefficient than it needs to be if I'm not missing
You're not missing anything. It's an inefficiency in jit-lock, indeed.
jit-lock asks font-lock to highlight 1-523 and font-lock has no way to
tell jit-lock that the first call already highlighted 1-701, so next
time jit-lock needs highlighting it will do 523-1034 because it doesn't
know that 523-701 was done already.
It gets worse in the other direction: if jit-lock asks font-lock to
fontify 1000-1500 and font-lock decids to highlight 500-1600, the part
between 500-1000 will not be redisplayed (i.e. the display will only
take into account the highlighting applied by font-lock next time it
gets refreshed, which usually means at the next command).