@@ -89,17 +89,20 @@ as for that macro."
8989 ; ; this variable is buffer local so we can use the cached value
9090 (if rustic--buffer-workspace
9191 rustic--buffer-workspace
92- (rustic--with-temp-process-buffer
93- (let ((ret (process-file (rustic-cargo-bin) nil (list (current-buffer ) nil ) nil " locate-project" " --workspace" )))
94- (cond ((and (/= ret 0 ) nodefault)
95- (error " `cargo locate-project' returned %s status: %s " ret (buffer-string )))
96- ((and (/= ret 0 ) (not nodefault))
97- (setq rustic--buffer-workspace default-directory))
98- (t
99- (goto-char 0 )
100- (let* ((output (json-read ))
101- (dir (file-name-directory (cdr (assoc-string " root" output)))))
102- (setq rustic--buffer-workspace dir))))))))
92+ ; ; Resolve the bin path while still buffer local (in cases like
93+ ; ; remote via TRAMP)
94+ (let ((cargo-bin (rustic-cargo-bin)))
95+ (rustic--with-temp-process-buffer
96+ (let ((ret (process-file cargo-bin nil (list (current-buffer ) nil ) nil " locate-project" " --workspace" )))
97+ (cond ((and (/= ret 0 ) nodefault)
98+ (error " `cargo locate-project' returned %s status: %s " ret (buffer-string )))
99+ ((and (/= ret 0 ) (not nodefault))
100+ (setq rustic--buffer-workspace default-directory))
101+ (t
102+ (goto-char 0 )
103+ (let* ((output (json-read ))
104+ (dir (file-name-directory (cdr (assoc-string " root" output)))))
105+ (setq rustic--buffer-workspace dir)))))))))
103106
104107(defun rustic-buffer-crate (&optional nodefault )
105108 " Return the crate for the current buffer.
0 commit comments