|
From: | JD Smith |
Subject: | bug#71345: Feature: unleash font-lock's secret weapon; handle Qfontified = non-nil |
Date: | Tue, 4 Jun 2024 18:41:01 -0400 |
Fair point.
I don't need to estimate, I have treesitter to tell me precisely!
In general, yes. In my case having the scope be per-buffer not per window makes the most sense in terms of the functionality.
I tend to associate font-lock and after-change in my head, but that's backwards. Presumably after-change would clobber fontified and whatever additional properties jit-lock uses to track its backends. So font-lock has no special status. Perhaps I tend to think of it as special because it touches so many locations in the buffer.
Sometimes those are unavoidable, if you need to add some 'face on top of what font-lock did.
I think it will be limiting to insist that all backends must be fully orthogonal (i.e. can apply in any arbitrary order), so some sort of priority or ordering system seems important. That said, mine only has to run over font-lock because of multi-line strings/comments, and the inability to set an independent 'face property. It's actually too bad font-lock doesn't itself use font-lock-face for much, despite what the docs say [1]. Since it sets 'face directly, it overrides any other property alias for 'face. If it instead used 'font-lock-face (or left that to modes, and used some higher-ranked 'font-lock-priority-face), other backends could use their own 'alternate-face, and the order in char-property-alias-alist would set the priority. Then it would be much easier to make face-using backends more orthogonal. Regarding the priority of backends, while looking through jit-lock, I was reminded of the completion-at-point-function's API, and the ability to claim :exclusive access, halting calls to further functions on the list. That's a strong power, but if used wisely, could be effective.
But those may be small regions which are inefficient to work on. This as you say is an implementation detail so probably not important yet. JD [1] From `Search-based Fontification': But I believe all font-lock keywords actually just set the 'face property. |
[Prev in Thread] | Current Thread | [Next in Thread] |