summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoi Martin <jroi.martin@gmail.com>2024-03-11 20:46:56 +0100
committerRoi Martin <jroi.martin@gmail.com>2024-03-11 20:46:56 +0100
commitdb7d086233d7c37105ef39944f1b075e3a3dbe21 (patch)
treeda732ab3dcf845c683a4f230562366d67ed623a6
parentd8a09f218e24407acbc9f36c641be4f913f1a63c (diff)
downloadrust-mode-db7d086233d7c37105ef39944f1b075e3a3dbe21.tar.gz
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
-rw-r--r--rust-mode.el3
1 files changed, 3 insertions, 0 deletions
diff --git a/rust-mode.el b/rust-mode.el
index 70c2a2c..ec1ecba 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -76,6 +76,9 @@ instead of `prog-mode'. This option requires emacs29+."
(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))
(provide 'rust-mode)