From 6490af559f8178f0d4d4dbe22d9c7d8b2344bce1 Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Tue, 26 Sep 2023 23:13:46 -0700 Subject: [PATCH] Extract feature list of java-ts-mode to a variable * lisp/progmodes/java-ts-mode.el: (java-ts-mode--feature-list): New variable. (java-ts-mode): Extract out. --- lisp/progmodes/java-ts-mode.el | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lisp/progmodes/java-ts-mode.el b/lisp/progmodes/java-ts-mode.el index f2faa1a7e77..6ca7a473411 100644 --- a/lisp/progmodes/java-ts-mode.el +++ b/lisp/progmodes/java-ts-mode.el @@ -305,6 +305,13 @@ Return nil if there is no name or if NODE is not a defun node." (treesit-node-child-by-field-name node "name") t)))) + +(defvar java-ts-mode--feature-list + '(( comment definition ) + ( constant keyword string type) + ( annotation expression literal) + ( bracket delimiter operator))) + ;;;###autoload (define-derived-mode java-ts-mode prog-mode "Java" "Major mode for editing Java, powered by tree-sitter." @@ -384,11 +391,7 @@ Return nil if there is no name or if NODE is not a defun node." ;; Font-lock. (setq-local treesit-font-lock-settings java-ts-mode--font-lock-settings) - (setq-local treesit-font-lock-feature-list - '(( comment definition ) - ( constant keyword string type) - ( annotation expression literal) - ( bracket delimiter operator))) + (setq-local treesit-font-lock-feature-list java-ts-mode--feature-list) ;; Imenu. (setq-local treesit-simple-imenu-settings -- 2.39.2