From 040991a4697b50ebcb54e498e7de54b8d0885101 Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Wed, 2 Nov 2022 11:26:38 -0700 Subject: Change signature of tree-sitter font-lock functions Change from (START END NODE OVERRIDE &rest _) to (NODE OVERRIDE &rest _) START and END aren't used frequently enough to justify. If a fontification function needs them, it can get them from NODE. * doc/lispref/modes.texi (Parser-based Font Lock): Update manual. * lisp/progmodes/js.el (js--fontify-template-string) * lisp/progmodes/python.el (python--treesit-fontify-string) (python--treesit-fontify-string-end): Change signature. * lisp/treesit.el (treesit-font-lock-rules): Update docstring. (treesit-font-lock-fontify-region): Remove START and END arguments. --- lisp/progmodes/python.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lisp/progmodes/python.el') diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index f741688363e..46559db2cd1 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -1015,7 +1015,7 @@ It makes underscores and dots word constituent chars.") "VMSError" "WindowsError" )) -(defun python--treesit-fontify-string (_beg _end node override &rest _) +(defun python--treesit-fontify-string (node override &rest _) "Fontify string. NODE is the leading quote in the string. Do not fontify the initial f for f-strings. OVERRIDE is the override flag described in @@ -1035,7 +1035,7 @@ f for f-strings. OVERRIDE is the override flag described in (cl-incf string-beg)) (treesit-fontify-with-override string-beg string-end face override))) -(defun python--treesit-fontify-string-end (_beg _end node &rest _) +(defun python--treesit-fontify-string-end (node &rest _) "Mark the whole string as to-be-fontified. NODE is the ending quote of a string." (let ((string (treesit-node-parent node))) -- cgit v1.2.1