doomemacs/modules/lang/rust/autoload.el
Henrik Lissner 8e18b402ce
lang/rust: run cargo commands from Cargo.toml dir
Instead of the current directory, which breaks file links in the
compilation buffer.
2019-04-10 18:52:08 -04:00

14 lines
390 B
EmacsLisp

;;; lang/rust/autoload.el -*- lexical-binding: t; -*-
;; TODO (defun +rust/run-cargo () (interactive))
;;;###autoload
(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)))