aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes
diff options
context:
space:
mode:
authorYuan Fu2022-10-31 15:03:49 -0700
committerYuan Fu2022-10-31 15:03:49 -0700
commiteeeae5e9ee34da5539046ff8dac4f4fffa19a5b9 (patch)
treeb815a383714dc3ee9d33c61fc39e91429709f344 /lisp/progmodes
parent9fab83ed7a90209e3873039e7ae4993c667e2759 (diff)
downloademacs-eeeae5e9ee34da5539046ff8dac4f4fffa19a5b9.tar.gz
emacs-eeeae5e9ee34da5539046ff8dac4f4fffa19a5b9.zip
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.
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/js.el2
-rw-r--r--lisp/progmodes/python.el2
2 files changed, 2 insertions, 2 deletions
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index 8d1cfbd3c0e..2801a729ebd 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -3573,7 +3573,7 @@ This function is intended for use in `after-change-functions'."
3573 @font-lock-constant-face))) 3573 @font-lock-constant-face)))
3574 "Tree-sitter font-lock settings.") 3574 "Tree-sitter font-lock settings.")
3575 3575
3576(defun js--fontify-template-string (beg end node) 3576(defun js--fontify-template-string (beg end node _override &rest _)
3577 "Fontify template string but not substitution inside it. 3577 "Fontify template string but not substitution inside it.
3578BEG, END, NODE refers to the template_string node." 3578BEG, END, NODE refers to the template_string node."
3579 (ignore end) 3579 (ignore end)
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index a9aff167767..0b10058eebe 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1015,7 +1015,7 @@ It makes underscores and dots word constituent chars.")
1015 "VMSError" "WindowsError" 1015 "VMSError" "WindowsError"
1016 )) 1016 ))
1017 1017
1018(defun python--treesit-fontify-string (_beg _end node) 1018(defun python--treesit-fontify-string (_beg _end node _override &rest _)
1019 "Fontify string. 1019 "Fontify string.
1020NODE is the last quote in the string. Do not fontify the initial 1020NODE is the last quote in the string. Do not fontify the initial
1021f for f-strings." 1021f for f-strings."