From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Cook, Malcolm" Subject: Re: eval source blocks in a subtree when opening file Date: Fri, 7 Aug 2015 18:47:08 +0000 Message-ID: <8802d84489c54d738276f677600b4844@exchsrv2.sgc.loc> References: <8737zzl09i.fsf@tamas.ihs.ac.at> <87zj23ry50.fsf@tamas.ihs.ac.at> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45510) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNmfk-0000lm-9m for emacs-orgmode@gnu.org; Fri, 07 Aug 2015 14:47:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZNmfh-0002hD-3d for emacs-orgmode@gnu.org; Fri, 07 Aug 2015 14:47:16 -0400 Received: from smtp01.stowers.org ([40.141.174.61]:57074) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNmfg-0002gy-T5 for emacs-orgmode@gnu.org; Fri, 07 Aug 2015 14:47:13 -0400 In-Reply-To: <87zj23ry50.fsf@tamas.ihs.ac.at> Content-Language: en-US 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: 'Tamas Papp' , "Charles C. Berry" Cc: "emacs-orgmode@gnu.org" > > 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: >=20 > Thanks! I found that I can also assign an ID to the section, and then us= e >=20 > # eval: (progn (org-id-goto ...some-id...) (org-babel-execute-subtree)) >=20 > It looks like I need the progn for it to work reliably (don't know why). >=20 > I am wondering if it would be possible to break a line in Local Variable= s, but >=20 > # eval: (progn (org-id-goto ...some-id...) \ > # (org-babel-execute-subtree)) >=20 > didn't work. >=20 [Cook, Malcolm]=20 Ditch the line continuation character. This works in my hands with emacs 2= 4.4.1 to set foo to bar: # Local Variables: # eval: (setq foo # "bar") # End: > Best, >=20 > Tamas