We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1d4b327 commit 332a232Copy full SHA for 332a232
rust-cargo.el
@@ -30,10 +30,17 @@
30
31
(defun rust-buffer-project ()
32
"Get project root if possible."
33
+ ;; Copy environment variables into the new buffer, since
34
+ ;; with-temp-buffer will re-use the variables' defaults, even if
35
+ ;; they have been changed in this variable using e.g. envrc-mode.
36
+ ;; See https://github.com/purcell/envrc/issues/12.
37
(let ((env process-environment)
38
(path exec-path))
39
(with-temp-buffer
40
+ ;; Copy the entire environment just in case there's something we
41
+ ;; don't know we need.
42
(setq-local process-environment env)
43
+ ;; Set PATH so we can find cargo.
44
(setq-local exec-path path)
45
(let ((ret (call-process rust-cargo-bin nil t nil "locate-project")))
46
(when (/= ret 0)
0 commit comments