emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/rust-mode c91d4ddad8 3/4: rust-buffer-project: don't use r


From: ELPA Syncer
Subject: [nongnu] elpa/rust-mode c91d4ddad8 3/4: rust-buffer-project: don't use rust-buffer-crate when file-remote-p
Date: Thu, 25 Aug 2022 09:59:15 -0400 (EDT)

branch: elpa/rust-mode
commit c91d4ddad81ced33bfaf54581f7fc2dc95e32b40
Author: brotzeit <brotzeitmacher@gmail.com>
Commit: brotzeit <brotzeitmacher@gmail.com>

    rust-buffer-project: don't use rust-buffer-crate when file-remote-p
---
 rust-cargo.el | 38 ++++++++++++++++++--------------------
 1 file changed, 18 insertions(+), 20 deletions(-)

diff --git a/rust-cargo.el b/rust-cargo.el
index 75f9c16cc7..cfbcd819a7 100644
--- a/rust-cargo.el
+++ b/rust-cargo.el
@@ -30,26 +30,24 @@
 
 (defun rust-buffer-project ()
   "Get project root if possible."
-  (if (file-remote-p default-directory)
-      (rust-buffer-crate)
-    ;; 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 (process-file rust-cargo-bin nil (list (current-buffer) 
nil) nil "locate-project" "--workspace")))
-          (when (/= ret 0)
-            (error "`cargo locate-project' returned %s status: %s" ret 
(buffer-string)))
-          (goto-char 0)
-          (let ((output (json-read)))
-            (cdr (assoc-string "root" output))))))))
+  ;; 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 (process-file rust-cargo-bin nil (list (current-buffer) nil) 
nil "locate-project" "--workspace")))
+        (when (/= ret 0)
+          (error "`cargo locate-project' returned %s status: %s" ret 
(buffer-string)))
+        (goto-char 0)
+        (let ((output (json-read)))
+          (cdr (assoc-string "root" output)))))))
 
 (defun rust-buffer-crate ()
   "Try to locate Cargo.toml using `locate-dominating-file'."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]