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

Allow rustic-compile to accept a command argument #59

Merged
merged 1 commit into from
Oct 12, 2024

Conversation

CeleritasCelery
Copy link
Contributor

Fixes #57

@CeleritasCelery
Copy link
Contributor Author

CeleritasCelery commented Oct 12, 2024

Looking at the tests from the PR, this function was not intended to be an analog to compile. The "right" way to call it from elisp would be to bind compilation-arguments to the command and compilation-read-command to nil, then call the function with no arguments. We could change it to align more with compile and take a command as an argument (which I think is a better design), but then we risk breaking code that is already using it the current way.

The code is not entirely self-consistent, with this call trying to pass a command. But that code path is never reached.

@CeleritasCelery CeleritasCelery force-pushed the rustic-compile-fix branch 3 times, most recently from 43a1e6b to a598553 Compare October 12, 2024 05:05
Previous it required binding compilation-arguments to pass an arg to it.
(while (eq (process-status proc) 'run)
(sit-for 0.1))
(should (string= compilation-directory dir))
(let ((proc (rustic-recompile)))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we doing rustic-recompile here ? From a quick look the previous code doesn't seem to have it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous code does have it

(let ((proc (rustic-recompile)))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a new test for compiling interactively rather than via lisp, so the diff looks a little weird.

(compilation-read-command (or (car compilation-arguments)
(rustic-compile-command)))
(rustic-compile-command))))
(rustic-set-compilation-arguments command)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new behavior is nice!

@CeleritasCelery CeleritasCelery merged commit 34abafb into main Oct 12, 2024
3 checks passed
@CeleritasCelery CeleritasCelery deleted the rustic-compile-fix branch October 12, 2024 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rustic-compile always prompts interactively (even when called from elisp)
2 participants