From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Leha Subject: Re: restarting an org-babel session? Date: Thu, 19 Mar 2015 20:20:40 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36342) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYgvM-0002y7-A3 for emacs-orgmode@gnu.org; Thu, 19 Mar 2015 16:20:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YYgvJ-0004jM-1H for emacs-orgmode@gnu.org; Thu, 19 Mar 2015 16:20:12 -0400 Received: from plane.gmane.org ([80.91.229.3]:46459) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYgvI-0004hZ-RI for emacs-orgmode@gnu.org; Thu, 19 Mar 2015 16:20:08 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1YYgvD-0000Cj-57 for emacs-orgmode@gnu.org; Thu, 19 Mar 2015 21:20:03 +0100 Received: from cpc33-cmbg15-2-0-cust4.5-4.cable.virginm.net ([81.102.136.5]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 19 Mar 2015 21:20:03 +0100 Received: from andreas.leha by cpc33-cmbg15-2-0-cust4.5-4.cable.virginm.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 19 Mar 2015 21:20:03 +0100 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 Hi John, tsd@tsdye.com (Thomas S. Dye) writes: > Aloha all, > > John Kitchin writes: > >> That is an interesting one I did not know of. I would not want to always >> run every block, some of them might not be part of a session, and it is >> possible to have multiple named sessions in a buffer. It might be good >> practice to not do that though ;) > > If org-babel-execute-buffer is too much, there is > org-babel-execute-subtree: > > ,--------------------------------------------------------------------- > | org-babel-execute-subtree is an interactive autoloaded compiled Lisp > | function in `ob-core.el'. > | > | It is bound to C-c C-v s, C-c C-v C-s. > | > | (org-babel-execute-subtree &optional ARG) > | > | Execute source code blocks in a subtree. > | Call `org-babel-execute-src-block' on every source block in > | the current subtree. > `--------------------------------------------------------------------- > > For finer control, this might work: > > ,---------------------------------- > | #+name: recreate-my-named-session > | #+header: :session my-named-session > | #+begin_src lang > | <> > | <> > | #+end_src > `---------------------------------- > That's what I am doing. But that is manual book-keeping. It means ultimate control but also the book-keeping to be accurate. But I agree with John, that org could be smart enough to execute the blocks of one session. > hth, > Tom > >> >> I will share my way of doing this if nothing else comes up. Please do. I would be interested in such a function, as well. Thanks, Andreas >> >> Thomas S. Dye writes: >> >>> Ken Mankoff writes: >>> >>>> On 2015-03-19 at 10:26, John Kitchin wrote: >>>>> Is it possible to restart an org-babel session from the current point? >>>>> What I mean is if you have a largish org-file with many session blocks, >>>>> and you want to go the end and continue it, you need to run each session >>>>> block before the end to recreate the "session". >>>> >>>> I am surprised there is no easy way to have an Org file run every code >>>> block in order either on command or on export. It seems like this >>>> would be a key component of reproducible research and literate >>>> documents. >>>> >>>> Maybe there is a way, but it isn't mentioned in the "Evaluating code >>>> blocks" section of the manual. >>>> >>>> -k. >>> >>> Would org-babel-execute-buffer work? >>> >>> ,-------------------------------------------------------------------- >>> | org-babel-execute-buffer is an interactive autoloaded compiled Lisp >>> | function in `ob-core.el'. >>> | >>> | (org-babel-execute-buffer &optional ARG) >>> | >>> | Execute source code blocks in a buffer. >>> | Call `org-babel-execute-src-block' on every source block in >>> | the current buffer. >>> `-------------------------------------------------------------------- >>> >>> hth, >>> Tom >> >> -- >> Professor John Kitchin >> Doherty Hall A207F >> Department of Chemical Engineering >> Carnegie Mellon University >> Pittsburgh, PA 15213 >> 412-268-7803 >> @johnkitchin >> http://kitchingroup.cheme.cmu.edu