Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(rustic-babel-build-sentinel): align behaviour with other lang #9

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions rustic-babel.el
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ execution with rustfmt."
(let ((proc-buffer (process-buffer proc))
(inhibit-read-only t))
(if (zerop (process-exit-status proc))
(let* ((default-directory rustic-babel-dir))
(let* ((original-default-directory default-directory)
(default-directory rustic-babel-dir))

;; format babel block
(when (and rustic-babel-format-src-block (not rustic-babel-auto-wrap-main) (not main-p))
Expand All @@ -121,9 +122,21 @@ execution with rustfmt."
(sit-for 0.1))))

;; run project
(let* ((err-buff (get-buffer-create rustic-babel-compilation-buffer-name))
(params (list "cargo" toolchain "run" "--quiet"))
(inhibit-read-only t))
(let* ((err-buff
(get-buffer-create rustic-babel-compilation-buffer-name))
(params
(list
"cargo"
toolchain
"run"
"--manifest-path"
(format "%s/Cargo.toml" rustic-babel-dir)
"--quiet"))
(inhibit-read-only t)
;; command should run in the original default-directory
;; which is typically the original org file
;; This agrees with behaviour of C, C++, D, js, python, etc.
(default-directory original-default-directory))
(rustic-make-process
:name rustic-babel-process-name
:buffer err-buff
Expand Down
Loading