Skip to content

Commit

Permalink
feat(cargo-process.el): add var to customize flags passed to cargo
Browse files Browse the repository at this point in the history
  • Loading branch information
clarkenciel committed Oct 21, 2017
1 parent 61f4673 commit 05074a5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cargo-process.el
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@
"Set RUST_BACKTRACE environment variable to 1 for tasks test and run"
:group 'cargo-process)

(defcustom cargo-process--command-flags ""
"Flags to be added to every cargo command when run."
:group 'cargo-process)

(defvar cargo-process-mode-map
(nconc (make-sparse-keymap) compilation-mode-map)
"Keymap for Cargo major mode.")
Expand Down Expand Up @@ -212,7 +216,8 @@ Always set to nil if cargo-process--enable-rust-backtrace is nil"
(let* ((buffer (concat "*Cargo " name "*"))
(path cargo-process--custom-path-to-bin)
(path (and path (file-name-as-directory path)))
(command (cargo-process--maybe-read-command (concat path command)))
(command (cargo-process--maybe-read-command
(concat path command " " cargo-process--command-flags)))
(project-root (cargo-process--project-root))
(default-directory (or project-root default-directory)))
(save-some-buffers (not compilation-ask-about-save)
Expand Down

0 comments on commit 05074a5

Please sign in to comment.