1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-30 04:10:54 -08:00

Add an argument OVERRIDE to tree-sitter font-lock functions

* doc/lispref/modes.texi (Parser-based Font Lock): Reflect this change
in manual.
* lisp/progmodes/js.el (js--fontify-template-string): Add _OVERRIDE
argument.
* lisp/progmodes/python.el (python--treesit-fontify-string): Add
_OVERRIDE argument.
* lisp/treesit.el (treesit-font-lock-rules): Update docstring.
(treesit-fontify-with-override): New function.
(treesit-font-lock-fontify-region): Extract out into
treesit-fontify-with-override.
This commit is contained in:
Yuan Fu 2022-10-31 15:03:49 -07:00
parent 9fab83ed7a
commit eeeae5e9ee
No known key found for this signature in database
GPG key ID: 56E19BC57664A442
4 changed files with 49 additions and 31 deletions

View file

@ -1015,7 +1015,7 @@ It makes underscores and dots word constituent chars.")
"VMSError" "WindowsError"
))
(defun python--treesit-fontify-string (_beg _end node)
(defun python--treesit-fontify-string (_beg _end node _override &rest _)
"Fontify string.
NODE is the last quote in the string. Do not fontify the initial
f for f-strings."