|Subject:||Re: [O] long running processes|
|Date:||Thu, 19 Nov 2015 09:10:23 -0800|
Your suggestions sounds possible to me. If you are up for it, I suggest
trying to implement it, and offering it as a patch.
> On Wed, Nov 18, 2015 at 2:55 PM, John Kitchin <address@hidden>
>> I am pretty sure this is not directly possible right now.
>> Some approaches that resemble it could be:
>> 1. write a src block that will be tangled to a script.
>> 2. tangle the block
>> 3. Run the script in a shell src block with an & so it runs
>> or, use an elisp block like:
>> (async-shell-command "your script" some-output-buffer)
>> I don't know a way to get continuous updated output in an org-buffer
> Thanks for the response. I didn't necessarily expect continuous output into
> the org-buffer itself to work, but I don't see why the Python subprocess
> can't display output as it occurs. After all, it uses comint, and comint
> certainly has facilities for collecting output incrementally while still
> displaying it (cf comint-output-filter-functions).
> It looks to me like the problem is that org-babel-comint-with-output uses a
> "while" loop to collect process output (ob-comint.el:92). At least, it
> could insert the output into the subprocess buffer and make redisplay
> But I'm not sure why the code is written that way anyway. Long running
> "while" loops in Emacs code don't seem like a good idea to begin with.
> Wouldn't the more natural way for this code to be written in Emacs be the
> - an output filter gets added to the subprocess that collects output
> - the code is sent to the subprocess for execution
> - the command returns
> - the output filter inserts any data it gets into the subprocess buffer,
> into its "results" data structure, perhaps even into the org-buffer
> - when the output filter gets the eoe-indicator, it removes itself from the
> output filter list and sends a notification that execution has completed
> If the user schedules a second block for execution, the simplest thing to
> do is return an error if there is already a block executing for that
> subprocess; alternatively, it could be queued somewhere.
|[Prev in Thread]||Current Thread||[Next in Thread]|