cargo-mode icon indicating copy to clipboard operation
cargo-mode copied to clipboard

inherit buffer environment when running cargo commands

Open sunng87 opened this issue 2 months ago • 0 comments

I'm using this cargo mode with envrc.el. The issue is when running cargo commands, cargo-mode use a temporary buffer and doesn't pick environment variables from current buffer, this results in cargo command using wrong binaries for cargo-clippy.

The author of envrc.el made a library called inheritenv.el to address this.

I can do this to pickup local environment variables

(use-package inheritenv
  :ensure t
  :config (inheritenv-add-advice 'cargo-mode--start-cmd))

But it would be nice to have this built into cargo-mode.

sunng87 avatar Jan 08 '26 02:01 sunng87