From: "Cook, Malcolm" <MEC@stowers.org>
To: 'Tamas Papp' <tkpapp@gmail.com>, "Charles C. Berry" <ccberry@ucsd.edu>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: eval source blocks in a subtree when opening file
Date: Fri, 7 Aug 2015 18:47:08 +0000 [thread overview]
Message-ID: <8802d84489c54d738276f677600b4844@exchsrv2.sgc.loc> (raw)
In-Reply-To: <87zj23ry50.fsf@tamas.ihs.ac.at>
> > 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.
>
[Cook, Malcolm]
Ditch the line continuation character. This works in my hands with emacs 24.4.1 to set foo to bar:
# Local Variables:
# eval: (setq foo
# "bar")
# End:
> Best,
>
> Tamas
prev parent reply other threads:[~2015-08-07 18:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-04 12:13 eval source blocks in a subtree when opening file Tamas Papp
2015-08-04 16:29 ` Charles C. Berry
2015-08-07 14:06 ` Tamas Papp
2015-08-07 18:47 ` Cook, Malcolm [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8802d84489c54d738276f677600b4844@exchsrv2.sgc.loc \
--to=mec@stowers.org \
--cc=ccberry@ucsd.edu \
--cc=emacs-orgmode@gnu.org \
--cc=tkpapp@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).