From db7d086233d7c37105ef39944f1b075e3a3dbe21 Mon Sep 17 00:00:00 2001 From: Roi Martin Date: Mon, 11 Mar 2024 20:46:56 +0100 Subject: Fix rust-mode lazy loading This PR fixes the following error that happends when opening a .rs file: File mode specification error: (void-function rust-mode) It conditionally autoloads the proper rust-mode version depending on the user environment. Fixes #528 --- rust-mode.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rust-mode.el b/rust-mode.el index 70c2a2c..ec1ecba 100644 --- a/rust-mode.el +++ b/rust-mode.el @@ -75,6 +75,9 @@ instead of `prog-mode'. This option requires emacs29+." (require 'rust-mode-treesitter) (require 'rust-prog-mode)) +;;;###autoload +(autoload 'rust-mode "rust-mode" "Major mode for Rust code.") + ;;;###autoload (add-to-list 'auto-mode-alist '("\\.rs\\'" . rust-mode)) -- cgit v1.2.3