From mboxrd@z Thu Jan 1 00:00:00 1970 From: kuangdash Subject: Suggestion about org-babel: executing source block asynchronously Date: Wed, 7 Oct 2015 04:54:34 +0800 Message-ID: <5614351D.D1D68F.06968@m50-133.163.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="_07AFFADE-E603-4175-A3F4-D0783AB1E0D5_" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53055) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjZGF-0003f5-Uy for emacs-orgmode@gnu.org; Tue, 06 Oct 2015 16:55:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZjZGC-0004GG-GE for emacs-orgmode@gnu.org; Tue, 06 Oct 2015 16:54:59 -0400 Received: from m50-133.163.com ([123.125.50.133]:59637) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjZGB-0004FL-Sy for emacs-orgmode@gnu.org; Tue, 06 Oct 2015 16:54:56 -0400 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "Emacs-orgmode@gnu.org" --_07AFFADE-E603-4175-A3F4-D0783AB1E0D5_ Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Sometime I will run source block (such as python) which take a long time be= fore I get the final result. Then I thought about whether or not the source block can be executed asynch= ronously, and the answer is =E2=80=98YES=E2=80=99. 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 =E2=80=9Cexecuting=E2=80= =9D overlay. 2) When get the final result, get the =E2=80=9Cexecuting=E2=80=9D overlay p= osition. 3) Add the result below the =E2=80=9Cexecuting=E2=80=9D overlay position, a= nd then remove the overly. It can be done! How about it?=20 Regards --_07AFFADE-E603-4175-A3F4-D0783AB1E0D5_ Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="utf-8"

Sometime I will run source block (such as python) which take a lo= ng time before I=C2=A0 get the final result.

 

Then I thought about wh= ether or not the source block can be executed asynchronously, and the answe= r is =E2=80=98YES=E2=80=99.

 

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

 

1)      When execute source block, cover it up with the =E2=80=9Cexe= cuting=E2=80=9D overlay.

2)      When get the final result, get the =E2=80=9Cexecuting=E2=80=9D o= verlay position.

3)&nb= sp;     Add the result below the =E2=80=9Cexecuting=E2=80=9D overlay position, a= nd then remove the overly.

 

It can be done! =C2=A0How about it?

 

Regards

= --_07AFFADE-E603-4175-A3F4-D0783AB1E0D5_-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: kuangdash Subject: Suggestion about org-babel: executing source block asynchronously Date: Wed, 7 Oct 2015 22:19:29 +0800 Message-ID: <56152A01.3EC491.19053@m12-14.163.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="_6E4563F8-2D4C-4DDE-B3DF-428DBAE9C81D_" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48431) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjpZZ-0001wM-9u for emacs-orgmode@gnu.org; Wed, 07 Oct 2015 10:20:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZjpZW-0003U9-5r for emacs-orgmode@gnu.org; Wed, 07 Oct 2015 10:20:01 -0400 Received: from m12-14.163.com ([220.181.12.14]:43383) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjpZS-0003PK-DJ for emacs-orgmode@gnu.org; Wed, 07 Oct 2015 10:19:58 -0400 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "emacs-orgmode@gnu.org" --_6E4563F8-2D4C-4DDE-B3DF-428DBAE9C81D_ Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Sometime I will run source block (such as python) which take a long time be= fore I=C2=A0 get the final result. Then I thought about whether or not the source block can be executed asynch= ronously, and the answer is =E2=80=98YES=E2=80=99. But it seems to be difficult for me to hack the code, so I just talk about = the process of it: 1)=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 When execute source block, cover it up wit= h the =E2=80=9Cexecuting=E2=80=9D overlay. 2)=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 When get the final result, get the =E2=80= =9Cexecuting=E2=80=9D overlay position. 3)=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Add the result below the =E2=80=9Cexecutin= g=E2=80=9D overlay position, and then remove the overly. It can be done! =C2=A0How about it?=20 Regards --_6E4563F8-2D4C-4DDE-B3DF-428DBAE9C81D_ Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="utf-8"

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

Then I thought about whether or not the source block can be ex= ecuted asynchronously, and the answer is =E2=80=98YES=E2=80=99.<= /span>

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 =E2=80=9Cexecuting=E2=80=9D overlay.

2)      When get th= e final result, get the =E2=80=9Cexecuting=E2=80=9D overlay position.<= /o:p>

3)      Add the result below the =E2=80=9Cexecuting=E2=80=9D overlay posit= ion, and then remove the overly.

 

It can be done!  Ho= w about it?

 

Regards

 

= --_6E4563F8-2D4C-4DDE-B3DF-428DBAE9C81D_-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Suggestion about org-babel: executing source block asynchronously Date: Sun, 11 Oct 2015 10:12:52 +0200 Message-ID: <878u79kem3.fsf@nicolasgoaziou.fr> References: <56152A01.3EC491.19053@m12-14.163.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53531) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlBiq-0003jK-3D for emacs-orgmode@gnu.org; Sun, 11 Oct 2015 04:11:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZlBip-0006Ee-8i for emacs-orgmode@gnu.org; Sun, 11 Oct 2015 04:11:12 -0400 Received: from relay3-d.mail.gandi.net ([2001:4b98:c:538::195]:56640) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlBip-0006EP-2x for emacs-orgmode@gnu.org; Sun, 11 Oct 2015 04:11:11 -0400 In-Reply-To: <56152A01.3EC491.19053@m12-14.163.com> (kuangdash@163.com's message of "Wed, 7 Oct 2015 22:19:29 +0800") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: kuangdash Cc: "emacs-orgmode@gnu.org" Hello, kuangdash writes: > Sometime I will run source block (such as python) which take a long time = before I=C2=A0 get the final result. > Then I thought about whether or not the source block can be executed asyn= chronously, and the answer is =E2=80=98YES=E2=80=99. > But it seems to be difficult for me to hack the code, so I just talk abou= t the process of it: > > 1)=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 When execute source block, cover it up w= ith the =E2=80=9Cexecuting=E2=80=9D overlay. > 2)=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 When get the final result, get the =E2= =80=9Cexecuting=E2=80=9D overlay position. > 3)=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Add the result below the =E2=80=9Cexecut= ing=E2=80=9D overlay position, and then remove the overly. > > It can be done! =C2=A0How about it? It could be a start.=20 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, --=20 Nicolas Goaziou