emacs-orgmode
[Top][All Lists]
Advanced

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

Re: bug? org-babel-comint-with-output return value type


From: Ihor Radchenko
Subject: Re: bug? org-babel-comint-with-output return value type
Date: Tue, 19 Mar 2024 14:20:49 +0000

Matt <matt@excalamus.com> writes:

> Why =org-babel-comint-with-output= returns a list is unclear to me.
> The docstring for =org-babel-comint-with-output= says it should
> "return all process output". AFAIK, process output is a string, always
> has been, always will be, and Babel has always gotten a substring of
> the process buffer (for that code path). Yet for some reason, it was
> decided to have =org-babel-comint-with-output= return a list. This
> goes back to the beginning, in 2009, when the final expression used
> =split-string= instead of =delete=:
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/lisp/org-babel-comint.el?id=dd0392a4f23b40fae7491c55aa44a2324248c103
>
> ...
> It seems like the return type of =org-babel-comint-with-output= is not what 
> it should be.  It looks like it should be a string.
>
> Am I missing something?

Inside `org-babel-comint-with-output', BODY may send multiple commands
to the shell; one by one. Their output will also arrive one by one,
separated by PROMPT. The return value is a list of these outputs.

If we were to concatenate this list, the information about which part of
the output belongs to which submitted command would be lost.

The docstring may indeed be improved.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>



reply via email to

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