aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
authorYuan Fu2022-11-19 16:10:46 -0800
committerYuan Fu2022-11-19 16:10:46 -0800
commitd6362b632e3c76cb55a05248aa221e426c5adb5a (patch)
tree81bf98c38a3bcd2386f309d4ea24ba9063945bb9 /lisp/progmodes/python.el
parent00df4566af9dff0a27fd6da566ef1e53268a6d47 (diff)
downloademacs-d6362b632e3c76cb55a05248aa221e426c5adb5a.tar.gz
emacs-d6362b632e3c76cb55a05248aa221e426c5adb5a.zip
Merge function/class-name features in python-mode
To keep consistency with other tree-sitter major modes. * lisp/progmodes/python.el (python--treesit-settings) (python-ts-mode): Merge function-name and class-name features into definition.
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el11
1 files changed, 4 insertions, 7 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 01a6887bb6e..456f141960e 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1049,14 +1049,11 @@ fontified."
1049 :override t 1049 :override t
1050 '((interpolation (identifier) @font-lock-variable-name-face)) 1050 '((interpolation (identifier) @font-lock-variable-name-face))
1051 1051
1052 :feature 'function-name 1052 :feature 'definition
1053 :language 'python 1053 :language 'python
1054 '((function_definition 1054 '((function_definition
1055 name: (identifier) @font-lock-function-name-face)) 1055 name: (identifier) @font-lock-function-name-face)
1056 1056 (class_definition
1057 :feature 'class-name
1058 :language 'python
1059 '((class_definition
1060 name: (identifier) @font-lock-type-face)) 1057 name: (identifier) @font-lock-type-face))
1061 1058
1062 :feature 'keyword 1059 :feature 'keyword
@@ -6597,7 +6594,7 @@ implementations: `python-mode' and `python-ts-mode'."
6597 (when (treesit-ready-p 'python-mode 'python) 6594 (when (treesit-ready-p 'python-mode 'python)
6598 (treesit-parser-create 'python) 6595 (treesit-parser-create 'python)
6599 (setq-local treesit-font-lock-feature-list 6596 (setq-local treesit-font-lock-feature-list
6600 '(( comment string function-name class-name) 6597 '(( comment string definition)
6601 ( keyword builtin constant type) 6598 ( keyword builtin constant type)
6602 ( assignment decorator escape-sequence 6599 ( assignment decorator escape-sequence
6603 string-interpolation number property 6600 string-interpolation number property