From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Olaf.Hamann" Subject: Re: var expansion on tangling only once per file Date: Thu, 12 Apr 2012 13:18:04 +0200 Message-ID: <4F86B9EC.5090707@gmx.net> References: <4F7EBCDA.8010303@gmail.com> <87sjgaux10.fsf@gmx.com> <4F86871A.6040501@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:55186) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SII3D-00007S-Hf for emacs-orgmode@gnu.org; Thu, 12 Apr 2012 07:19:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SII3B-0000w8-Ta for emacs-orgmode@gnu.org; Thu, 12 Apr 2012 07:18:55 -0400 Received: from mailout-de.gmx.net ([213.165.64.23]:60472) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1SII3B-0000vn-Io for emacs-orgmode@gnu.org; Thu, 12 Apr 2012 07:18:53 -0400 In-Reply-To: <4F86871A.6040501@gmail.com> 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: emacs-orgmode@gnu.org Am 12.04.2012 09:41, schrieb Rainer M Krug: > > On 11/04/12 16:15, Eric Schulte wrote: >> 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. > > Would work - but as I said above, I would have preferred to have the variable defined at the top > of the buffer. I could use though the no-expand header argument for the source blocks. At the moment, What about : #+NAME var-as-literal-block #+BEGIN_EXAMPLE 99 #+END_EXAMPLE #+begin_src ... :var TheVar=var-as-literal-block ...using TheVar in code #+end_src ---------------------------- I would prefer using Macros in this case : #+MACRO: TheVar 99 #+begin_src ... :var TheVar={{{TheVar}}} ...using TheVar in code #+end_src But looks like that macros do not expand in src_block header arguments. Regards, Olaf