Hi Rainer, The easiest way to do this should be,
--8<---------------cut here---------------start------------->8--- ** pulling information from tags :blue: #+begin_src R :var color=(car (org-get-tags-at (point))) :tangle example.R color #+end_src #+results: : blue --8<---------------cut here---------------end--------------->8--- this will tangle to --8<---------------cut here---------------start------------->8--- color <- "blue" color --8<---------------cut here---------------end--------------->8--- Cheers -- Eric Rainer M Krug <r.m.k...@gmail.com> writes: > Hi > > I would like to have two different versions (not in the sense of version > control) of one program in one org file, and depending on the value if a > tag is set or not, tangle either the one or the other. The tangled file > has to have the same name. > > So essentially: > > > > ** Test Code :VERSIONTAG > Version 1: > #+begin_src R :tangle result.R > version <- 1 > x <- 10 > #+end_src > > Version 2: > #+begin_src R :tangle result.R > version <- 2 > x <- 13 > #+end_src > > If VERSIONTAG is Version1, result.R should contain the code as in the > first code block, and if it is Version2, the code from the second code > block. > > > Is this possible? > > Cheers, > > Rainer _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode