fix bug of some versions of emacs and tree-sitter environment

This commit is contained in:
zedhugh committed 2024-11-04 06:01:14 +08:00
1 parent f0b8c2a5a8
commit a537d35961
3 files changed
+5 -2

No files matched your search

+1 -1
View File
@@ -52,6 +52,6 @@ Do this recursively for subdirectories of DIR."
;; "compat" "transient" ;; "compat" "transient"
(dolist (pkg '("compat" "transient")) (dolist (pkg '("compat" "transient"))
(unless (locate-library pkg) (unless (locate-library pkg)
(add-pkg-in-pkg-dir))) (add-pkg-in-pkg-dir pkg)))
(provide 'init-package) (provide 'init-package)
+3
View File
@@ -4,6 +4,9 @@
(and (fboundp 'treesit-available-p) (treesit-available-p)) (and (fboundp 'treesit-available-p) (treesit-available-p))
"Built-in `treesit' available.") "Built-in `treesit' available.")
(setq treesit-extra-load-path
(list (file-name-concat creature/config-dir "tree-sitter")))
(when creature/treesit-available (when creature/treesit-available
(unless (featurep 'treesit) (require 'treesit)) (unless (featurep 'treesit) (require 'treesit))
(when (treesit-ready-p 'javascript) (when (treesit-ready-p 'javascript)
+1 -1
View File
@@ -8,7 +8,7 @@
(add-to-list 'auto-mode-alist '("\\.ts\\'" . typescript-ts-mode)) (add-to-list 'auto-mode-alist '("\\.ts\\'" . typescript-ts-mode))
(add-to-list 'auto-mode-alist '("\\.tsx\\'" . tsx-ts-mode))) (add-to-list 'auto-mode-alist '("\\.tsx\\'" . tsx-ts-mode)))
(add-subdirs-to-load-path (expand-file-name "optional-pkg" creature/config-dir)) (add-dir-and-subdirs-to-load-path (expand-file-name "optional-pkg" creature/config-dir))
(require 'typescript-mode) (require 'typescript-mode)
(define-derived-mode typescript-tsx-mode typescript-mode "Tsx" (define-derived-mode typescript-tsx-mode typescript-mode "Tsx"