From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tamas Papp Subject: eval source blocks in a subtree when opening file Date: Tue, 04 Aug 2015 14:13:29 +0200 Message-ID: <8737zzl09i.fsf@tamas.ihs.ac.at> Mime-Version: 1.0 Content-Type: text/plain; format=flowed Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48490) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZMb67-00014J-E3 for emacs-orgmode@gnu.org; Tue, 04 Aug 2015 08:13:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZMb64-0004m0-1K for emacs-orgmode@gnu.org; Tue, 04 Aug 2015 08:13:35 -0400 Received: from mail-wi0-x22f.google.com ([2a00:1450:400c:c05::22f]:36213) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZMb63-0004lQ-QT for emacs-orgmode@gnu.org; Tue, 04 Aug 2015 08:13:31 -0400 Received: by wicgj17 with SMTP id gj17so147476902wic.1 for ; Tue, 04 Aug 2015 05:13:30 -0700 (PDT) Received: from tamas.ihs.ac.at (51B74675.catv.pool.telekom.hu. [81.183.70.117]) by smtp.gmail.com with ESMTPSA id gm20sm1551198wjc.17.2015.08.04.05.13.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Aug 2015 05:13:30 -0700 (PDT) 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, I have a file that looks like this (stylized): --8<---------------cut here---------------start------------->8--- * Setup :noexport: #+COMMENT: some code here I want to run every time I open the file in SRC blocks * Experiment 1 #+COMMENT: code I run when necessary, not every time * Experiment 2 #+COMMENT: code I run when necessary, not every time * end of file :noexport: #+COMMENT: This is just for local variables, not exported. # Local Variables: # org-confirm-babel-evaluate: nil # org-export-babel-evaluate: 'inline-only # End: --8<---------------cut here---------------end--------------->8--- 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. Best, Tamas