diadochos / org-babel-eval-in-repl

Send and eval org-mode babel code blocks in various REPLs (therefore it's async)
MIT License
58 stars 8 forks source link

Support header-args such as :var in the src header #31

Closed actondev closed 4 years ago

actondev commented 4 years ago

Hey @diadochos how are you?

I have another improvement in mind, and I'm preparing the PR

Consider the following example:

  #+BEGIN_SRC sh :session *ober-test* :var test="abc"
echo "test is $test"
  #+END_SRC

Should result in test is abc

If the code is executed "normally" (as in org-babel-execute-src-block) it outputs what is expected, but not when ran with ober-eval-in-repl (well, to be accurate if first the org-babel-execute-src-block command spawns the shell session, calling ober-eval-in-repl will indeed have the $test variable defined)


One extra thing (which I didn't check yet) would be the :dir argument, to initiate the new shell in the given directory. I'm commenting this as extra cause I already did have a WIP version of the :var arguments (however in order to make it cleaner I think it will be better to edit the eval-in-repl package as well, to make future additions such as this easier)

diadochos commented 4 years ago

Hi @actonDev , I've been great! How have you been? Thank you so much for investigating this! I'll be looking forward to the PR.

I think it's all up to you to decide whether to hit the two birds (:var and :dir) all at once or just implement the :var header. (I personally prefer filing applying a PR for :var first in this kind of a situation, but it's entirely up to you)

Stay safe!

actondev commented 4 years ago

ping @diadochos a reminder, cause I submitted the PR, please tell me what you think

diadochos commented 4 years ago

I'm sorry for having you waiting. I'll comment in the PR page, but it looks good to me!