Closed MagicRB closed 4 years ago
It is indeed what compile.el does. Also for reference see what https://github.com/kwrooijen/cargo.el/ does.
Can you show me an example of non-working code? FWIW, here is what I do in diffr: https://github.com/mookid/diffr/blob/f44f2306fe8744d0b11b037e82f0c7c0a75464f3/src/test_cli.rs#L60 CARGO_MANIFEST_DIR is supposed to be set by cargo run
, and your code should depend on that rather than the cwd.
I'll switch to CARGO_MANIFEST_DIR if it's set then, thanks! you can close this if you want
I find it weird that the
cargo run
andcargo build
are run in the directory where the currently open file resides, I'd much prefer ifcargo run
specifically was run in the project root. My project expects it's data files to be located in the directory it's run in. I'm open to suggestions on how to remedy this issue in my code too. From what I gather this behavior comes from emacs' built-in compile command.