emacs-diffs
[Top][All Lists]
Advanced

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

master 93c8220937 4/7: Reorganize treesit-font-lock-feaure-list's to the


From: Yuan Fu
Subject: master 93c8220937 4/7: Reorganize treesit-font-lock-feaure-list's to the new level scheme
Date: Sat, 26 Nov 2022 21:36:30 -0500 (EST)

branch: master
commit 93c82209374581ae0d52681d56a7dc28e8279f98
Author: Yuan Fu <casouri@gmail.com>
Commit: Yuan Fu <casouri@gmail.com>

    Reorganize treesit-font-lock-feaure-list's to the new level scheme
    
    * lisp/progmodes/c-ts-mode.el (c-ts-mode--base-mode)
    * lisp/progmodes/csharp-mode.el (csharp-ts-mode)
    * lisp/progmodes/java-ts-mode.el (java-ts-mode)
    * lisp/progmodes/js.el (js-ts-mode)
    * lisp/progmodes/python.el (python-ts-mode)
    * lisp/progmodes/sh-script.el (bash-ts-mode)
    * lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode):
    Reorganized treesit-font-lock-feature-list.
---
 lisp/progmodes/c-ts-mode.el          |  8 ++++----
 lisp/progmodes/csharp-mode.el        |  7 ++++---
 lisp/progmodes/java-ts-mode.el       |  7 ++++---
 lisp/progmodes/js.el                 |  7 ++++---
 lisp/progmodes/python.el             | 10 +++++-----
 lisp/progmodes/sh-script.el          |  8 ++++----
 lisp/progmodes/typescript-ts-mode.el |  7 ++++---
 7 files changed, 29 insertions(+), 25 deletions(-)

diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el
index fc35d9aedd..086257483e 100644
--- a/lisp/progmodes/c-ts-mode.el
+++ b/lisp/progmodes/c-ts-mode.el
@@ -528,10 +528,10 @@ the subtrees."
   (setq-local which-func-functions nil)
 
   (setq-local treesit-font-lock-feature-list
-              '(( comment constant keyword literal preprocessor string)
-                ( assignment definition label property type)
-                ( delimiter error escape-sequence function
-                  operator variable bracket))))
+              '(( comment definition)
+                ( keyword preprocessor string type)
+                ( assignment constant escape-sequence label literal property )
+                ( bracket delimiter error function operator variable))))
 
 ;;;###autoload
 (define-derived-mode c-ts-mode c-ts-mode--base-mode "C"
diff --git a/lisp/progmodes/csharp-mode.el b/lisp/progmodes/csharp-mode.el
index a544a4b5cb..d794bc854f 100644
--- a/lisp/progmodes/csharp-mode.el
+++ b/lisp/progmodes/csharp-mode.el
@@ -974,9 +974,10 @@ Key bindings:
   ;; Font-lock.
   (setq-local treesit-font-lock-settings csharp-ts-mode--font-lock-settings)
   (setq-local treesit-font-lock-feature-list
-              '((comment keyword constant string)
-                (type definition expression literal attribute)
-                (bracket delimiter)))
+              '(( comment definition)
+                ( keyword string type)
+                ( attribute constant expression literal)
+                ( bracket delimiter)))
 
   ;; Imenu.
   (setq-local imenu-create-index-function #'csharp-ts-mode--imenu)
diff --git a/lisp/progmodes/java-ts-mode.el b/lisp/progmodes/java-ts-mode.el
index ee2934f53c..dd3d6d31e0 100644
--- a/lisp/progmodes/java-ts-mode.el
+++ b/lisp/progmodes/java-ts-mode.el
@@ -317,9 +317,10 @@ the subtrees."
   ;; Font-lock.
   (setq-local treesit-font-lock-settings java-ts-mode--font-lock-settings)
   (setq-local treesit-font-lock-feature-list
-              '((comment constant keyword string)
-                (annotation definition expression literal type)
-                (bracket delimiter operator)))
+              '(( comment definition )
+                ( constant keyword string type)
+                ( annotation expression literal)
+                ( bracket delimiter operator)))
 
   ;; Imenu.
   (setq-local imenu-create-index-function #'java-ts-mode--imenu)
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index da05b7b364..f2016deb5d 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -3873,9 +3873,10 @@ Currently there are `js-mode' and `js-ts-mode'."
     (setq-local treesit-font-lock-settings js--treesit-font-lock-settings)
     (setq-local treesit-font-lock-feature-list
                 '(( comment declaration)
-                  ( constant expression identifier keyword number string)
-                  ( bracket delimiter escape-sequence jsx operator
-                    pattern property)))
+                  ( keyword string)
+                  ( constant escape-sequence expression
+                    identifier jsx number pattern property)
+                  ( bracket delimiter operator)))
     ;; Imenu
     (setq-local imenu-create-index-function
                 #'js--treesit-imenu)
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 9bbcac612f..acfee21135 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -6615,11 +6615,11 @@ implementations: `python-mode' and `python-ts-mode'."
   (when (treesit-ready-p 'python)
     (treesit-parser-create 'python)
     (setq-local treesit-font-lock-feature-list
-                '(( comment string definition)
-                  ( keyword builtin constant type)
-                  ( assignment decorator escape-sequence
-                    string-interpolation number property
-                    operator bracket delimiter)))
+                '(( comment definition)
+                  ( keyword string type)
+                  ( assignment builtin constant decorator
+                    escape-sequence number property string-interpolation )
+                  ( bracket delimiter operator)))
     (setq-local treesit-font-lock-settings python--treesit-settings)
     (setq-local imenu-create-index-function
                 #'python-imenu-treesit-create-index)
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index 067aef8669..e11fb42fc8 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -1608,10 +1608,10 @@ with your script for an edit-interpret-debug cycle."
   "Major mode for editing Bash shell scripts."
   (when (treesit-ready-p 'bash)
     (setq-local treesit-font-lock-feature-list
-                '(( comment function heredoc string)
-                  ( command declaration-command keyword number variable)
-                  ( bracket builtin-variable constant delimiter
-                    misc-punctuation operator)))
+                '(( comment function)
+                  ( command declaration-command keyword string)
+                  ( builtin-variable constant heredoc number variable)
+                  ( bracket delimiter misc-punctuation operator)))
     (setq-local treesit-font-lock-settings
                 sh-mode--treesit-settings)
     (treesit-major-mode-setup)))
diff --git a/lisp/progmodes/typescript-ts-mode.el 
b/lisp/progmodes/typescript-ts-mode.el
index 763686bf66..c7b332c614 100644
--- a/lisp/progmodes/typescript-ts-mode.el
+++ b/lisp/progmodes/typescript-ts-mode.el
@@ -320,9 +320,10 @@
     ;; Font-lock.
     (setq-local treesit-font-lock-settings 
typescript-ts-mode--font-lock-settings)
     (setq-local treesit-font-lock-feature-list
-                '((comment declaration)
-                  (constant expression identifier keyword number string)
-                  (bracket delimiter jsx pattern property)))
+                '(( comment declaration)
+                  ( keyword string)
+                  ( constant expression identifier jsx number pattern property)
+                  ( bracket delimiter)))
     ;; Imenu.
     (setq-local imenu-create-index-function #'js--treesit-imenu)
 



reply via email to

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