File tree 1 file changed +13
-2
lines changed
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 17
17
18
18
(eval-when-compile (require 'rx ))
19
19
20
+ (defvar rust-load-optional-libraries t
21
+ " Whether loading `rust-mode' also loads optional libraries.
22
+ This variable might soon be remove again." )
23
+
24
+ (when rust-load-optional-libraries
25
+ (require 'rust-cargo )
26
+ (require 'rust-compile )
27
+ (require 'rust-playpen )
28
+ (require 'rust-rustfmt ))
29
+
20
30
(defvar electric-pair-inhibit-predicate )
21
31
(defvar electric-pair-skip-self )
22
32
(defvar electric-indent-chars )
@@ -188,9 +198,10 @@ Use idomenu (imenu with `ido-mode') for best mileage.")
188
198
189
199
(defvar rust-mode-map
190
200
(let ((map (make-sparse-keymap )))
191
- (define-key map (kbd " C-c C-f" ) 'rust-format-buffer )
192
201
(define-key map (kbd " C-c C-d" ) 'rust-dbg-wrap-or-unwrap )
193
- (define-key map (kbd " C-c C-n" ) 'rust-goto-format-problem )
202
+ (when rust-load-optional-libraries
203
+ (define-key map (kbd " C-c C-f" ) 'rust-format-buffer )
204
+ (define-key map (kbd " C-c C-n" ) 'rust-goto-format-problem ))
194
205
map)
195
206
" Keymap for Rust major mode." )
196
207
You can’t perform that action at this time.
0 commit comments