aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-09-27 20:51:55 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-09-27 20:51:55 +0200
commit5e99e307b95c9f363fbc11fb57c175c80f6e7e9d (patch)
treed4683763640e1491629e9f43fb5ab05b9fb983ab
parent4b780416f252a49a224fd57e3632fa05a1286fc7 (diff)
Autoload adding gsp to ‘auto-mode-alist’
-rw-r--r--gsp-ts-mode.el13
1 files changed, 7 insertions, 6 deletions
diff --git a/gsp-ts-mode.el b/gsp-ts-mode.el
index 3bbb45f..100aedf 100644
--- a/gsp-ts-mode.el
+++ b/gsp-ts-mode.el
@@ -25,6 +25,13 @@
;;; Code:
+(unless (treesit-available-p)
+ (error "Tree-Sitter support is required for `gsp-ts-mode'"))
+(require 'treesit)
+
+;;;###autoload
+(add-to-list 'auto-mode-alist '("\\.gsp\\'" . gsp-ts-mode))
+
(defcustom gsp-ts-mode-indent-offset 2
"Number of spaces for each indentation step in `gsp-ts-mode'."
:version "1.0.0"
@@ -112,11 +119,5 @@ See the documentation for `treesit-simple-indent-rules' and
(treesit-parser-create 'gsp)
(gsp-ts--setup))
-(unless (treesit-available-p)
- (error "Tree-Sitter support is required for `gsp-ts-mode'"))
-(require 'treesit)
-(when (treesit-ready-p 'gsp)
- (add-to-list 'auto-mode-alist '("\\.gsp\\'" . gsp-ts-mode)))
-
(provide 'gsp-ts-mode)
;;; gsp-ts-mode.el ends here