diff options
| author | Yuan Fu | 2022-11-02 11:26:38 -0700 |
|---|---|---|
| committer | Yuan Fu | 2022-11-02 11:26:38 -0700 |
| commit | 040991a4697b50ebcb54e498e7de54b8d0885101 (patch) | |
| tree | e0d1cc29f342653c4b140cb63b0d48d99d83cd81 /lisp/progmodes/python.el | |
| parent | 50e33639fe190f0a1c47b8e4c0fcc4735cb60909 (diff) | |
| download | emacs-040991a4697b50ebcb54e498e7de54b8d0885101.tar.gz emacs-040991a4697b50ebcb54e498e7de54b8d0885101.zip | |
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.
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 4 |
1 files changed, 2 insertions, 2 deletions
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.") | |||
| 1015 | "VMSError" "WindowsError" | 1015 | "VMSError" "WindowsError" |
| 1016 | )) | 1016 | )) |
| 1017 | 1017 | ||
| 1018 | (defun python--treesit-fontify-string (_beg _end node override &rest _) | 1018 | (defun python--treesit-fontify-string (node override &rest _) |
| 1019 | "Fontify string. | 1019 | "Fontify string. |
| 1020 | NODE is the leading quote in the string. Do not fontify the initial | 1020 | NODE is the leading quote in the string. Do not fontify the initial |
| 1021 | f for f-strings. OVERRIDE is the override flag described in | 1021 | 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 | |||
| 1035 | (cl-incf string-beg)) | 1035 | (cl-incf string-beg)) |
| 1036 | (treesit-fontify-with-override string-beg string-end face override))) | 1036 | (treesit-fontify-with-override string-beg string-end face override))) |
| 1037 | 1037 | ||
| 1038 | (defun python--treesit-fontify-string-end (_beg _end node &rest _) | 1038 | (defun python--treesit-fontify-string-end (node &rest _) |
| 1039 | "Mark the whole string as to-be-fontified. | 1039 | "Mark the whole string as to-be-fontified. |
| 1040 | NODE is the ending quote of a string." | 1040 | NODE is the ending quote of a string." |
| 1041 | (let ((string (treesit-node-parent node))) | 1041 | (let ((string (treesit-node-parent node))) |