diff options
author | Timo Wilken | 2023-10-13 17:23:29 +0200 |
---|---|---|
committer | Timo Wilken | 2023-10-30 17:30:41 +0100 |
commit | 1ce4deeb09d62769b9957c53ef28eafd38d3abb0 (patch) | |
tree | a6d70449838768ed101f760fa4c5b5a5d3260a48 /tw/home/files/emacs-packages | |
parent | bfd732d421c07c7c5e3633e675632dc17a27fc4e (diff) |
Initial tree-sitter support in Emacs
Diffstat (limited to 'tw/home/files/emacs-packages')
-rw-r--r-- | tw/home/files/emacs-packages/alidist-mode.el | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tw/home/files/emacs-packages/alidist-mode.el b/tw/home/files/emacs-packages/alidist-mode.el index 5fb7af7d..94f1b9e9 100644 --- a/tw/home/files/emacs-packages/alidist-mode.el +++ b/tw/home/files/emacs-packages/alidist-mode.el @@ -127,6 +127,9 @@ It is stored in `alidist-mode--mmm-refresh-timer'." (add-hook 'flymake-diagnostic-functions #'alidist-flymake nil t) (flymake-mode)) +(define-derived-mode alidist-script-ts-mode bash-ts-mode "Script" + "A mode for scripts in alidist recipes, using tree-sitter.") + (define-derived-mode alidist-script-mode sh-mode "Script" "A mode for scripts in alidist recipes with some default settings." (sh-set-shell "bash")) @@ -134,12 +137,12 @@ It is stored in `alidist-mode--mmm-refresh-timer'." (mmm-add-group 'alidist-recipe `((alidist-main-script - :submode alidist-script-mode + :submode alidist-script-ts-mode :face mmm-default-submode-face :front ,(rx line-start "---\n") :back ,(rx buffer-end)) (alidist-option-script - :submode alidist-script-mode + :submode alidist-script-ts-mode :face mmm-default-submode-face ;; Any *_recipe key with a multiline string value is probably a script. :front ,(rx line-start (* whitespace) @@ -153,9 +156,9 @@ It is stored in `alidist-mode--mmm-refresh-timer'." (seq (* whitespace) (+ (any alnum ?\_)) ":" (or line-end whitespace))))))) -;; Make `mmm-mode' remember `sh-mode' indentation variables. +;; Make `mmm-mode' remember `sh-mode'/`bash-ts-mode' indentation variables. (cl-dolist (var sh-var-list) - (cl-pushnew `(,var nil (sh-mode)) + (cl-pushnew `(,var region (sh-mode bash-ts-mode)) mmm-save-local-variables :test 'equal)) (mmm-add-mode-ext-class 'alidist-mode nil 'alidist-recipe) |