diff options
| author | Yuan Fu | 2022-10-30 23:59:56 -0700 |
|---|---|---|
| committer | Yuan Fu | 2022-10-31 00:23:31 -0700 |
| commit | 18947103fabf8070738b3bd9c5a8d02f90988a3d (patch) | |
| tree | baeae31e780eef59f6299fa865b15c861c717fd9 /lisp/progmodes/python.el | |
| parent | 79ee266f13fa5c657b24dc45d5f573c393a671b6 (diff) | |
| download | emacs-18947103fabf8070738b3bd9c5a8d02f90988a3d.tar.gz emacs-18947103fabf8070738b3bd9c5a8d02f90988a3d.zip | |
Use tree-sitter for font-lock's syntactic function (optionally)
Before this change, we rebind font-lock-fontify-region-function and
call font-lock's function in tree-sitter's function, and the order of
fontification is tree-sitter, font-lock syntax, font-lock regexp.
Now we make font-lock's syntax function customizable and replace it
with tree-sitter's function, and the order of fontification is
tree-sitter, font-lock regexp.
* doc/lispref/modes.texi (Parser-based Font Lock): Reflect the change
in manual.
* lisp/font-lock.el (font-lock-fontify-syntactically-function): New
varaible.
(font-lock-default-fontify-region): Call
font-lock-fontify-syntactically-function rather.
(font-lock-fontify-syntactically-region): Rename to
font-lock-default-fontify-syntactically
(font-lock-default-fontify-syntactically): Rename to this.
* lisp/treesit.el (treesit-font-lock-fontify-region): Don't call
font-lock functions.
(treesit-font-lock-enable): Remove this function. It is not used even
before this change.
(treesit-major-mode-setup): Instead of binding
font-lock-fontify-region-function, now bind to
font-lock-fontify-syntactically-function. And we can let font-lock do
it's thing.
Diffstat (limited to 'lisp/progmodes/python.el')
0 files changed, 0 insertions, 0 deletions