[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/rust-mode 332a23285a 2/3: Add some comments documenting th
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/rust-mode 332a23285a 2/3: Add some comments documenting the change |
Date: |
Thu, 23 Jun 2022 17:58:46 -0400 (EDT) |
branch: elpa/rust-mode
commit 332a23285a910a413cd58aea63c9ed581dcf9100
Author: Ethan Glasser-Camp <ethan@betacantrips.com>
Commit: Ethan Glasser-Camp <ethan@betacantrips.com>
Add some comments documenting the change
Thanks @brotzeit for the suggestion.
---
rust-cargo.el | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/rust-cargo.el b/rust-cargo.el
index 69ed5586d3..9f6e611a36 100644
--- a/rust-cargo.el
+++ b/rust-cargo.el
@@ -30,10 +30,17 @@
(defun rust-buffer-project ()
"Get project root if possible."
+ ;; Copy environment variables into the new buffer, since
+ ;; with-temp-buffer will re-use the variables' defaults, even if
+ ;; they have been changed in this variable using e.g. envrc-mode.
+ ;; See https://github.com/purcell/envrc/issues/12.
(let ((env process-environment)
(path exec-path))
(with-temp-buffer
+ ;; Copy the entire environment just in case there's something we
+ ;; don't know we need.
(setq-local process-environment env)
+ ;; Set PATH so we can find cargo.
(setq-local exec-path path)
(let ((ret (call-process rust-cargo-bin nil t nil "locate-project")))
(when (/= ret 0)