[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Orgmode][babel]: Some feedback after the first week usage
From: |
Torsten Wagner |
Subject: |
Re: [Orgmode][babel]: Some feedback after the first week usage |
Date: |
Fri, 6 Nov 2009 10:34:12 +0900 |
User-agent: |
KMail/1.12.2 (Linux/2.6.31-14-generic; KDE/4.3.2; x86_64; ; ) |
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