emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Async evaluation in ob-shell


From: jackkamm
Subject: Re: [PATCH] Async evaluation in ob-shell
Date: Sat, 11 Feb 2023 12:56:00 -0800

Matt <matt@excalamus.com> writes:

> It's not clear to me if that's something that a better regexp would handle or 
> if it should be cleaned up in the callback function.  I'm still figuring out 
> how it's done in ob-python and ob-R.

ob-python and ob-R call out to python.el or ESS to evaluate code.

IIRC, they will write code to tempfile and then source the tempfile
within python or R session. So then we don't need to worry about
cleaning up prompts between the lines.

org-babel-comint-async-filter is capable of taking a similar approach,
and reading/writing to tempfile. I believe this approach would be
generally more robust, but the major weakness is that it would break if
you SSH'd to a remote host in the middle of the session.

There was an interesting patch to ob-shell that was never applied, that
took the approach of wrapping the code block in a bash function before
executing; I think it might be a promising approach:

https://lists.gnu.org/archive/html/emacs-orgmode/2020-02/msg00923.html

By the way, I took a look at ob-shell for the first time in awhile, and
noticed that ob-shell now forces the prompt to be like:

org_babel_sh_prompt>

Which I think makes cleaning up the prompt markers a lot more
robust. But it is a bit ugly, and also seems to break working with shell
sessions started outside of Babel with M-x shell.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]