emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] var expansion on tangling only once per file


From: Eric Schulte
Subject: Re: [O] var expansion on tangling only once per file
Date: Wed, 11 Apr 2012 10:15:55 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)

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 <address@hidden> 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

[Prev in Thread] Current Thread [Next in Thread]