diff options
| author | Ethan Glasser-Camp <ethan@betacantrips.com> | 2022-06-23 10:51:32 -0400 |
|---|---|---|
| committer | Ethan Glasser-Camp <ethan@betacantrips.com> | 2022-06-23 10:51:32 -0400 |
| commit | 332a23285a910a413cd58aea63c9ed581dcf9100 (patch) | |
| tree | b51f38975619d40fe7c9bf9fc97f09743ecc0b2d | |
| parent | 1d4b327b39b395dc95921f4aec975b3cebcbf563 (diff) | |
| download | rust-mode-332a23285a910a413cd58aea63c9ed581dcf9100.tar.gz | |
Add some comments documenting the change
Thanks @brotzeit for the suggestion.
| -rw-r--r-- | rust-cargo.el | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/rust-cargo.el b/rust-cargo.el index 69ed558..9f6e611 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) |
