emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-29 1978b603bc3: Make python-ts-mode's syntax-highlighting more sta


From: Dmitry Gutov
Subject: emacs-29 1978b603bc3: Make python-ts-mode's syntax-highlighting more standardized
Date: Thu, 23 Nov 2023 17:01:09 -0500 (EST)

branch: emacs-29
commit 1978b603bc3068140833e478a8103fea1d185aec
Author: Dmitry Gutov <dmitry@gutov.dev>
Commit: Dmitry Gutov <dmitry@gutov.dev>

    Make python-ts-mode's syntax-highlighting more standardized
    
    This was brought up in a Reddit discussion.
    
    * lisp/progmodes/python.el (python--treesit-fontify-variable):
    Use font-lock-variable-use-face (since it applies to references).
    (python-ts-mode): Move 'property' from 3rd to 4th
    treesit-font-lock-level.
---
 lisp/progmodes/python.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index e17651d9275..a7944576196 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1225,7 +1225,7 @@ For NODE, OVERRIDE, START, END, and ARGS, see
   (when (python--treesit-variable-p node)
     (treesit-fontify-with-override
      (treesit-node-start node) (treesit-node-end node)
-     'font-lock-variable-name-face override start end)))
+     'font-lock-variable-use-face override start end)))
 
 
 ;;; Indentation
@@ -6717,8 +6717,8 @@ implementations: `python-mode' and `python-ts-mode'."
                 '(( comment definition)
                   ( keyword string type)
                   ( assignment builtin constant decorator
-                    escape-sequence number property string-interpolation )
-                  ( bracket delimiter function operator variable)))
+                    escape-sequence number string-interpolation )
+                  ( bracket delimiter function operator variable property)))
     (setq-local treesit-font-lock-settings python--treesit-settings)
     (setq-local imenu-create-index-function
                 #'python-imenu-treesit-create-index)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]