From 302b5374815688bfe743c272965f9e1783b60220 Mon Sep 17 00:00:00 2001 From: Will Speak Date: Tue, 3 Oct 2017 07:35:22 +0100 Subject: Revert #216 and Add Suggestions from #226 This reverts the `setq-local` for `compile-command` and replaces it with a function which can be used to invoke compile with `"cargo build"` as the compile command. --- rust-mode.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'rust-mode.el') diff --git a/rust-mode.el b/rust-mode.el index 4151104..8b729f9 100644 --- a/rust-mode.el +++ b/rust-mode.el @@ -1491,6 +1491,11 @@ This is written mainly to be used as `end-of-defun-function' for Rust." (interactive) (setq-local rust-format-on-save nil)) +(defun rust-compile () + "Compile using `cargo build`" + (interactive) + (compile "cargo build")) + (defvar rust-mode-map (let ((map (make-sparse-keymap))) (define-key map (kbd "C-c C-f") 'rust-format-buffer) @@ -1547,8 +1552,6 @@ This is written mainly to be used as `end-of-defun-function' for Rust." (setq-local parse-sexp-lookup-properties t) (setq-local electric-pair-inhibit-predicate 'rust-electric-pair-inhibit-predicate-wrap) - (setq-local compile-command "cargo build") - (add-hook 'before-save-hook 'rust--before-save-hook nil t) (setq-local rust-buffer-project nil) -- cgit v1.2.3