emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Suggestion about org-babel: executing source block asynchronously
@ 2015-10-06 20:54 kuangdash
  0 siblings, 0 replies; 3+ messages in thread
From: kuangdash @ 2015-10-06 20:54 UTC (permalink / raw)
  To: Emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 609 bytes --]

Sometime I will run source block (such as python) which take a long time before I  get the final result.

Then I thought about whether or not the source block can be executed asynchronously, and the answer is ‘YES’.

But it seems to be difficult for me to hack the code, so I just talk about the process of it:

1) When execute source block, cover it up with the “executing” overlay.
2) When get the final result, get the “executing” overlay position.
3) Add the result below the “executing” overlay position, and then remove the overly.

It can be done!  How about it? 

Regards

[-- Attachment #2: Type: text/html, Size: 4445 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Suggestion about org-babel: executing source block asynchronously
@ 2015-10-07 14:19 kuangdash
  2015-10-11  8:12 ` Nicolas Goaziou
  0 siblings, 1 reply; 3+ messages in thread
From: kuangdash @ 2015-10-07 14:19 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 639 bytes --]

Sometime I will run source block (such as python) which take a long time before I  get the final result.
Then I thought about whether or not the source block can be executed asynchronously, and the answer is ‘YES’.
But it seems to be difficult for me to hack the code, so I just talk about the process of it:

1)      When execute source block, cover it up with the “executing” overlay.
2)      When get the final result, get the “executing” overlay position.
3)      Add the result below the “executing” overlay position, and then remove the overly.

It can be done!  How about it? 

Regards


[-- Attachment #2: Type: text/html, Size: 2881 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Suggestion about org-babel: executing source block asynchronously
  2015-10-07 14:19 Suggestion about org-babel: executing source block asynchronously kuangdash
@ 2015-10-11  8:12 ` Nicolas Goaziou
  0 siblings, 0 replies; 3+ messages in thread
From: Nicolas Goaziou @ 2015-10-11  8:12 UTC (permalink / raw)
  To: kuangdash; +Cc: emacs-orgmode@gnu.org

Hello,

kuangdash <kuangdash@163.com> writes:

> Sometime I will run source block (such as python) which take a long time before I  get the final result.
> Then I thought about whether or not the source block can be executed asynchronously, and the answer is ‘YES’.
> But it seems to be difficult for me to hack the code, so I just talk about the process of it:
>
> 1)      When execute source block, cover it up with the “executing” overlay.
> 2)      When get the final result, get the “executing” overlay position.
> 3)      Add the result below the “executing” overlay position, and then remove the overly.
>
> It can be done!  How about it?

It could be a start. 

However, "add the result" in not simple, because you need to maintain
a queue in order to insert results back during idle time. Also,
insertion should preserve current window visibility so as to prevent
jumping around.

You may also need to cover the results part of the code block, if any.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-10-11  8:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-07 14:19 Suggestion about org-babel: executing source block asynchronously kuangdash
2015-10-11  8:12 ` Nicolas Goaziou
  -- strict thread matches above, loose matches on Subject: below --
2015-10-06 20:54 kuangdash

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).