[Emacs] Add treesit-auto-for-each

This commit is contained in:
Ivan Malison 2023-07-31 17:43:46 -06:00
parent 932370a9b3
commit ad28f370c3

View File

@ -1576,6 +1576,16 @@ out how to detect that a buffer is a man mode buffer.
(setq treesit-auto-install t) (setq treesit-auto-install t)
(global-treesit-auto-mode +1) (global-treesit-auto-mode +1)
(defun treesit-auto-for-each (fn)
(cl-loop for recipe in treesit-auto-recipe-list
do
(let ((from (treesit-auto-recipe-remap recipe))
(to (treesit-auto-recipe-ts-mode recipe)))
(funcall fn from to))))
(defun treesit-auto-get-mode-hook-symbol (mode)
(intern (concat (symbol-name mode) "-mode-hook")))
(defun treesit-auto-copy-all-lsp-languages () (defun treesit-auto-copy-all-lsp-languages ()
(cl-loop for recipe in treesit-auto-recipe-list (cl-loop for recipe in treesit-auto-recipe-list
do do
@ -1595,7 +1605,8 @@ out how to detect that a buffer is a man mode buffer.
do do
(let ((major-modes (lsp--client-major-modes client))) (let ((major-modes (lsp--client-major-modes client)))
(when (memq from major-modes) (when (memq from major-modes)
(setf (lsp--client-major-modes client) (append major-modes (list to))))))) (setf (lsp--client-major-modes client)
(append major-modes (list to)))))))
(use-package lsp-mode (use-package lsp-mode
:config :config