Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cargo-process.el): add var to customize flags passed to cargo #46

Merged
merged 1 commit into from
Oct 26, 2017

Conversation

clarkenciel
Copy link
Contributor

This is an attempt to deal with issue #45 by adding a cargo-process--command-flags custom variable and defaulting it with the --color never flag. This variable can, of course, be customized as needed by users.

cargo-process.el Outdated
@@ -212,7 +216,9 @@ 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)))
(flags (apply #'concatenate 'string cargo-process--command-flags))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will cause issues in the case of having multiple flags, since there is no space added between concatenation.

Maybe instead of a list, simply use a string for all flags?

cargo-process.el Outdated
@@ -64,6 +64,10 @@
"Set RUST_BACKTRACE environment variable to 1 for tasks test and run"
:group 'cargo-process)

(defcustom cargo-process--command-flags (list "--color never")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my comment below, this would just be a string. However I'm not sure why you're having this issue, maybe a specific Emacs client or Emacs configuration. So it would be best to have this as an empty string, to prevent this from breaking other people's workflow. You can then adjust the variable in your own config.

@kwrooijen kwrooijen merged commit 3ecf0b8 into kwrooijen:master Oct 26, 2017
@kwrooijen
Copy link
Owner

Good good, thanks!

@ejmg
Copy link

ejmg commented May 17, 2018

Hi, my output for commands like cargo-process-run still give garbled ansi text. What do I need to do to fix this? Sorry for the dumb question.

@kwrooijen
Copy link
Owner

@ejmg
Adding this to your Emacs configuration should do the trick:

(setq cargo-process--command-flags "--color never")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants