From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: var expansion on tangling only once per file Date: Wed, 11 Apr 2012 10:15:55 -0400 Message-ID: <87sjgaux10.fsf@gmx.com> References: <4F7EBCDA.8010303@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:55926) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SI11h-0006Dc-Pi for emacs-orgmode@gnu.org; Wed, 11 Apr 2012 13:08:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SI11c-0007W2-T4 for emacs-orgmode@gnu.org; Wed, 11 Apr 2012 13:08:13 -0400 Received: from mailout-us.gmx.com ([74.208.5.67]:46554) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1SI11c-0007Vv-LD for emacs-orgmode@gnu.org; Wed, 11 Apr 2012 13:08:08 -0400 In-Reply-To: <4F7EBCDA.8010303@gmail.com> (Rainer M. Krug's message of "Fri, 06 Apr 2012 11:52:26 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: R.M.Krug@gmail.com Cc: emacs-orgmode 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 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/