-
Notifications
You must be signed in to change notification settings - Fork 102
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
ob-rustic : run code snippets with no main() #266
base: master
Are you sure you want to change the base?
Conversation
Sorry for the late reply.
I think this regex search can slow things down. I know that some users make excessive use of org-babel and if they use hundreds of lines in babel blocks I think this can be annoying. I know this would be very convenient and as far as I remember I also considered this when I added the babel code, but I think the potential downsides are not worth it. Maybe we should rather provide an option for the babel block so you can use a template like:
|
Running a regexp without wildcard when interactively executing a block through babel is barely perceptible. |
PR updated to insert the main block as follows:
The usage of ob-rust stays limited to |
Something like your example. I haven't used
Ok, I didn't know but certainly sounds reasonable. Maybe we should also do it this way ? We can also add an option to make it the default. |
Hi there,
this wraps the code block with
main()
eg:
fn main(){<body>}
when there's none,like rust-mode does, allowing more concise snippets.
p.s: the main function detection should be made more robust: by searching for it after rust-fmt