From: Torsten Wagner <torsten.wagner@gmail.com>
To: "Thomas S. Dye" <tsd@tsdye.com>
Cc: Org Mode Mailing List <emacs-orgmode@gnu.org>
Subject: Re: [babel]: Some feedback after the first week usage
Date: Fri, 6 Nov 2009 10:34:12 +0900 [thread overview]
Message-ID: <200911061034.12151.torsten.wagner@googlemail.com> (raw)
In-Reply-To: <506D0F4E-CEBB-44E7-A23C-2E6643FBED34@tsdye.com>
Hi Tom
> Would something like run-code-blocks (below) do what you want? I put
> a source block like this at the top of my org-babel file, where I can
> find it quickly.
>
> #+srcrname: run-code-blocks
> #+begin_src python :noweb
> <<block-1>>
> <<block-2>>
> #+end_src
>
> #+srcname: block-1
> #+begin_src python
> a = 1
> a
> #+end_src
>
> #+srcname: block-2
> #+begin_src python
> b = 1
> b
> #+end_src
Actually, that is a very nice and smart idea :)
It could be something like a Makefile allowing me to switch on and off different
blocks (e.g., for debugging if there is an error somewhere), switch between
different blocks (e.g. real data from file and test data set) or even modify
temporarily variables in between
For example I could write:
#+srcrname: run-code-blocks
#+begin_src python :noweb
# <<block-1>> # choose between real data
<<block-test>> # and test data
# wondering whether it would work with negative values
a = -1
<<block-2>>
#+end_src
#+srcname: block-1
#+begin_src python
a = open("foo.txt","r")
a
#+end_src
#+srcname: block-test
#+begin_src python
a = 1
a
#+end_src
#+srcname: block-2
#+begin_src python
b = 1
b
#+end_src
Nice, will try it and many thanks for sharing
Greetings
Torsten
next prev parent reply other threads:[~2009-11-06 1:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-05 8:27 [babel]: Some feedback after the first week usage Torsten Wagner
2009-11-05 15:57 ` Thomas S. Dye
2009-11-06 1:34 ` Torsten Wagner [this message]
2009-11-05 17:27 ` Dan Davison
2009-11-05 22:48 ` Tom Short
2009-11-06 18:56 ` Thomas S. Dye
2009-11-06 0:02 ` Eric Schulte
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=200911061034.12151.torsten.wagner@googlemail.com \
--to=torsten.wagner@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=tsd@tsdye.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).