Open untoreh opened 3 years ago
Hi @untoreh Actually I've been wanting something like this myself as well, since I use this package (well, to be frank a new re-write of this package) a lot and rarely do thing with plain org-babel. And the last time that I want to create an org-mode file with src code & the results I (sadly) had to run the command and then manually paste the results.
if I'd go into the trouble of looking into this, I'd like also to have a complete functionality, like evaluating the whole org document (and replacing the results of all code blocks). Have you given any thoughts on this?
I guess the obvious way is to implement something with the functionality of org-babel-execute-src-block
:
ober-execute-src-block
(a-la ober-eval-block-in-repl
)>
or julia>
or whatverorg-babel-execute-src-block
with ober-execute-src-block
, you could even export to html, or whatever other backend?What do you think? And is your elisp-foo strong enough to maybe help with the task? If not, describe if you can your workflows and typical usecases of how & where this would be useful.
With
emacs-libvterm
there is support for escape codes that track the prompt, command end, and command output. If the repl of a language allows to customize the prompt and insert such control codes (i.e. julia) it would be possible to just copy the output of the evaluation from the vterm buffer to the org buffer.The advantage of this is that it is language agnostic, it does not need ad-hoc IO implementations for the language like all
org-babel
implementations, it's still async, and since it would copy from the vterm buffer, it would preserve the text properties, so it keeps the formatting as printed from the terminal emulator, whereas other org babel implementations loose the formatting, and instead rely on org support for pretty printing (i.e. tables)