diff options
Diffstat (limited to '.emacs.d/lisp/rust-cargo.el')
| -rw-r--r-- | .emacs.d/lisp/rust-cargo.el | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/.emacs.d/lisp/rust-cargo.el b/.emacs.d/lisp/rust-cargo.el index d9f1be5..d323b5d 100644 --- a/.emacs.d/lisp/rust-cargo.el +++ b/.emacs.d/lisp/rust-cargo.el | |||
| @@ -31,6 +31,11 @@ worksapce for commands like `cargo check`." | |||
| 31 | :type 'string | 31 | :type 'string |
| 32 | :group 'rust-mode) | 32 | :group 'rust-mode) |
| 33 | 33 | ||
| 34 | (defcustom rust-cargo-clippy-default-arguments '() | ||
| 35 | "Default arguments for running `cargo clippy`." | ||
| 36 | :type '(repeat string) | ||
| 37 | :group 'rust-mode) | ||
| 38 | |||
| 34 | ;;; Buffer Project | 39 | ;;; Buffer Project |
| 35 | 40 | ||
| 36 | (defvar-local rust-buffer-project nil) | 41 | (defvar-local rust-buffer-project nil) |
| @@ -134,11 +139,13 @@ output buffer will be in comint mode, i.e. interactive." | |||
| 134 | (interactive) | 139 | (interactive) |
| 135 | (when (null rust-buffer-project) | 140 | (when (null rust-buffer-project) |
| 136 | (rust-update-buffer-project)) | 141 | (rust-update-buffer-project)) |
| 137 | (let* ((args (list rust-cargo-bin "clippy" | 142 | (let* ((args (append (list rust-cargo-bin "clippy" |
| 138 | (concat "--manifest-path=" rust-buffer-project))) | 143 | (concat "--manifest-path=" rust-buffer-project)) |
| 144 | rust-cargo-clippy-default-arguments)) | ||
| 139 | ;; set `compile-command' temporarily so `compile' doesn't | 145 | ;; set `compile-command' temporarily so `compile' doesn't |
| 140 | ;; clobber the existing value | 146 | ;; clobber the existing value |
| 141 | (compile-command (mapconcat #'shell-quote-argument args " "))) | 147 | (compile-command (concat (mapconcat #'shell-quote-argument args " ") |
| 148 | " " rust-cargo-default-arguments))) | ||
| 142 | (rust--compile nil compile-command))) | 149 | (rust--compile nil compile-command))) |
| 143 | 150 | ||
| 144 | ;;; _ | 151 | ;;; _ |
