From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tamas Papp Subject: Re: eval source blocks in a subtree when opening file Date: Fri, 07 Aug 2015 16:06:35 +0200 Message-ID: <87zj23ry50.fsf@tamas.ihs.ac.at> References: <8737zzl09i.fsf@tamas.ihs.ac.at> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35401) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNiIE-0004nN-DI for emacs-orgmode@gnu.org; Fri, 07 Aug 2015 10:06:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZNiIB-0002iJ-7U for emacs-orgmode@gnu.org; Fri, 07 Aug 2015 10:06:42 -0400 Received: from mail-wi0-x22a.google.com ([2a00:1450:400c:c05::22a]:35492) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNiIB-0002iD-0S for emacs-orgmode@gnu.org; Fri, 07 Aug 2015 10:06:39 -0400 Received: by wibxm9 with SMTP id xm9so63001217wib.0 for ; Fri, 07 Aug 2015 07:06:37 -0700 (PDT) In-reply-to: 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: "Charles C. Berry" Cc: emacs-orgmode@gnu.org On Tue, Aug 04 2015, Charles C. Berry wrote: > On Tue, 4 Aug 2015, Tamas Papp wrote: > >> I would like to do the following: whenever I open the file in Emacs, I would >> like to eval all the source blocks under the heading Setup. >> >> I have found org-babel-execute-subtree, but I cannot figure out how to call >> it on the subtree "Setup" from a local eval. > > Name the first block in the subtree "start setup" (say). > > Then > > # Local Variables: > # eval: (org-babel-goto-named-src-block "start setup") > # eval: (org-babel-execute-subtree) > # End: Thanks! I found that I can also assign an ID to the section, and then use # eval: (progn (org-id-goto ...some-id...) (org-babel-execute-subtree)) It looks like I need the progn for it to work reliably (don't know why). I am wondering if it would be possible to break a line in Local Variables, but # eval: (progn (org-id-goto ...some-id...) \ # (org-babel-execute-subtree)) didn't work. Best, Tamas