From: Yuan Fu Date: Sun, 20 Nov 2022 00:10:46 +0000 (-0800) Subject: Merge function/class-name features in python-mode X-Git-Tag: emacs-29.0.90~1643 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d6362b632e3c76cb55a05248aa221e426c5adb5a;p=emacs.git 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. --- 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." :override t '((interpolation (identifier) @font-lock-variable-name-face)) - :feature 'function-name + :feature 'definition :language 'python '((function_definition - name: (identifier) @font-lock-function-name-face)) - - :feature 'class-name - :language 'python - '((class_definition + name: (identifier) @font-lock-function-name-face) + (class_definition name: (identifier) @font-lock-type-face)) :feature 'keyword @@ -6597,7 +6594,7 @@ implementations: `python-mode' and `python-ts-mode'." (when (treesit-ready-p 'python-mode 'python) (treesit-parser-create 'python) (setq-local treesit-font-lock-feature-list - '(( comment string function-name class-name) + '(( comment string definition) ( keyword builtin constant type) ( assignment decorator escape-sequence string-interpolation number property