diff --git a/packages/treesit.el b/packages/treesit.el index 31e4c43..ec9034b 100644 --- a/packages/treesit.el +++ b/packages/treesit.el @@ -12,7 +12,7 @@ :requires treesit :hook (rust-ts-mode . (lambda () - (when (featurep 'rust-mode) - (add-hook before-save-hook rust-before-save-method) - (add-hook after-save-hook rust-after-save-method) + (when (require 'rust-mode nil t) + (add-hook 'before-save-hook 'rust-before-save-method nil t) + (add-hook 'after-save-hook 'rust-after-save-method nil t) (use-local-map (make-composed-keymap (list rust-ts-mode-map rust-mode-map)))))))