Closed averter closed 4 months ago
Thank you for the report. It helps to understand what's going on.
I assume you are using a 3rd party package, ob-async. I don't use ob-async, but the error you are seeing seems to occur when ob-async starts an Emacs sub-process.
I haven't seen the details of ob-async code, but as far as I understand, it uses async.el to launch an Emacs sub-process, then loads necessary settings to that Emacs sub-process. This process of starting the Emacs sub-process is different from the normal Emacs startup and seems to cause the error that does not occur in the normal Emacs startup.
So, I'd like to clarify that the issue you see is not a general issue that would affect all asynchronous org babel execution. The ob-python distributed with Org natively supports async execution, and the ob-python async execution works without a problem with ob-julia-vterm enabled. By the way, async execution is also natively implemented (in a different way) in ob-julia-vterm.
So far I assume the reported issue seems like a problem that ob-async should handle. But I'll keep checking it and see if there is anything I can do on the ob-julia-vterm side.
Thanks @shg, this is helpful. Indeed, if I don't load ob-async there are no errors; however, I cannot then run org-babel blocks of certain languages asynchronously, i.e., emacs hangs when I execute a source block which takes some time, e.g., this one
#+begin_src sh :async
sleep 10
echo "Async does not works!"
#+end_src
Although certain languages, such as python as you said, might still work with the native async.
@averter I found a possible workaround.
You can remove julia-vterm
from the org-babel-load-languages
variable. And if you want to use ob-julia-vterm, load it individually just by calling (require 'ob-julia-vterm)
in your init file or somewhere.
It seems that the error you reported occurs when ob-async calls org-babel-do-load-languages
function in the spawned Emacs sub-process. And loading ob-* file directly without using org-babel-load-languages
is totally fine according to the Org documentation.
It works. Brilliant. Thank you very much!
Strangely, after activating ob-julia-vterm all async source blocks stop working, e.g. when running
I get the following error:
My relevant org-mode configuration is
and commenting the
(julia-vterm . t)
line makes async work again. I am using emacs 28.1, org 9.6.24, and ob-julia-vterm 20230815.2332. Thanks in advance.