summaryrefslogtreecommitdiff
path: root/lisp/progmodes/rust-ts-mode.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes/rust-ts-mode.el')
-rw-r--r--lisp/progmodes/rust-ts-mode.el6
1 files changed, 3 insertions, 3 deletions
diff --git a/lisp/progmodes/rust-ts-mode.el b/lisp/progmodes/rust-ts-mode.el
index 7536726165e..08590ae6a86 100644
--- a/lisp/progmodes/rust-ts-mode.el
+++ b/lisp/progmodes/rust-ts-mode.el
@@ -276,9 +276,6 @@ Return nil if there is no name or if NODE is not a defun node."
(treesit-node-child-by-field-name node "name") t))))
;;;###autoload
-(add-to-list 'auto-mode-alist '("\\.rs\\'" . rust-ts-mode))
-
-;;;###autoload
(define-derived-mode rust-ts-mode prog-mode "Rust"
"Major mode for editing Rust, powered by tree-sitter."
:group 'rust
@@ -322,6 +319,9 @@ Return nil if there is no name or if NODE is not a defun node."
(treesit-major-mode-setup)))
+(if (treesit-ready-p 'rust)
+ (add-to-list 'auto-mode-alist '("\\.rs\\'" . rust-ts-mode)))
+
(provide 'rust-ts-mode)
;;; rust-ts-mode.el ends here