lang/rust: run cargo commands from Cargo.toml dir
Instead of the current directory, which breaks file links in the compilation buffer.
This commit is contained in:
parent
da34862e56
commit
8e18b402ce
2 changed files with 10 additions and 4 deletions
|
@ -6,3 +6,9 @@
|
|||
(defun +rust-cargo-project-p ()
|
||||
"Return t if this is a cargo project."
|
||||
(locate-dominating-file buffer-file-name "Cargo.toml"))
|
||||
|
||||
;;;###autoload
|
||||
(defun +rust-cargo-compile (command)
|
||||
"TODO"
|
||||
(let ((default-directory (+rust-cargo-project-p)))
|
||||
(compile command)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue