Skip to content

Commit 7e53af3

Browse files
committed
Recommend autoload instead of require
Lazy loading with autoload will result in faster startup time for Emacs users and is generally the recommended approach for major modes.
1 parent 0c691df commit 7e53af3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/etc/emacs/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ To install manually, check out this repository and add this to your
1212

1313
```lisp
1414
(add-to-list 'load-path "/path/to/rust-mode/")
15-
(require 'rust-mode)
15+
(autoload 'rust-mode "rust-mode" nil t)
16+
(add-to-list 'auto-mode-alist '("\\.rs\\'" . rust-mode))
1617
```
1718

18-
`rust-mode` will automatically be associated with `.rs` files. To enable it
19-
explicitly, do <kbd>M-x rust-mode</kbd>.
19+
This associates `rust-mode` with `.rs` files. To enable it explicitly, do
20+
<kbd>M-x rust-mode</kbd>.
2021

2122
### `package.el` installation via Marmalade or MELPA
2223

0 commit comments

Comments
 (0)