This is not currently possible, and any conceivable implementation would
be necessarily complex requiring a good deal of cross-buffer
coordination.

Would it be possible to simply only declare the variable in a header
argument applying to the first code block?  Using a session would keep
that variables state through all subsequent code blocks.

Best,

Rainer M Krug <r.m.k...@gmail.com> writes:

> Hi
>
> I have a file wide variable defined and tangle several source blockd into one 
> file.
>
> BNo the variable is expanded in each block.
>
> Would it be possible to have the expansion at the beginning of the file and 
> nod be repeated, as
> this can cause problems?
>
> The following org code
>
> #+PROPERTY: tangle test.R
> #+PROPERTY: var TheVar=99
>
> * Part one
> #+begin_src R :tabgle:
>   x <- 1
> #+end_src
> * Problem
> #+begin_src R
>   y <- list(
>       x = 1,
> #+end_src
> * Problem continued
> #+begin_src R
>       x <- 3
> )
> #+end_src
>
> results in an error in R due to the repeated "TheVar <- 99" in the list 
> definition.
>
> Org-mode version 7.8.08 (release_7.8.07.213.ge6fdf) from git this morning
>
> If I remember correctly, this sneeked in quite recently.
>
> Thanks,
>
> Rainer

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/

Reply via email to