[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: `font-lock-extend-region-functions' vs. `font-lock-extend-after-chan
From: |
Tobias C. Rittweiler |
Subject: |
Re: `font-lock-extend-region-functions' vs. `font-lock-extend-after-change-region-function' |
Date: |
Fri, 01 May 2009 18:37:23 +0200 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/23.0.60 (gnu/linux) |
Stefan Monnier <address@hidden> writes:
> The way I imagine fixing it is by changing jit-lock-functions such that
> the functions on that hook (e.g. font-lock-fontify-region) would return
> the new boundaries they used (or nil if they kept the boundaries passed
> by jit-lock).
I'd also like if the font-lock-extend-region-functions were called with
an argument counter representing the number of extend region passes so
far.
Of course that would be a backwards-incompatible API change but you
could bind a special variable representing the count.
Purpose is to guard against infinite loops.
Alternatively `font-lock-default-fontify-region' could be made smarter
in so far as it could check whether a pass actually changed
font-lock-beg and font-lock-end, and if not, would not try another pass.
(Strictly speaking the latter would also mean a slight API change, but
anyone who were bitten by this should be slapped three times by some
appropriately thick book anyway. :-))
-T.
- Re: `font-lock-extend-region-functions' vs. `font-lock-extend-after-change-region-function',
Tobias C. Rittweiler <=