Open nikadon opened 6 years ago
Rather than creating a separate function, I'd prefer to support this by making ob-async-org-babel-execute-src-block
respect the actual value of the :async
header-arg (if supplied) instead of merely looking for the presence of the :async
keyword in the list of header-args.
That way, you could do something like this:
#+BEGIN_SRC emacs-lisp
(defun ob-async-use-async-p ()
(if (bound-and-true-p ob-async-force-sync)
"no"
"yes"))
(defun ob-async-toggle-force-sync ()
(interactive)
(setq-local ob-async-force-sync (not (bound-and-true-p ob-async-force-sync))))
#+END_SRC
And use it like this:
#+BEGIN_SRC sh :async (ob-async-use-async-p)
sleep 2 && echo "I'm synchronous"
#+END_SRC
Hi, thank you for a brilliant package. I have a feature request for a function
ob-synchro-org-babel-execute-src-block
that will ignore the:async t
statements.Reasoning is this. When dealing with individual source code blocks async is very useful but when using functions like
org-babel-execute-to-point
all code blocks should be executed one after another (synchronously). The new function (ob-synchro-org-babel-execute-src-block
) can be incorporated in the definition of theorg-babel-execute-to-point
.My usage case is iPython with some blocks that take few minutes to execute, while waiting I can still work on the
org-file
and prepare next code blocks for testing, and this is thanks toob-async
. When done with testing I want to execute all blocks one after another (synchronously). This can take hours, but I can start new Emacs process ;)