From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sebastien Vauban" Subject: Re: Insert variable into tangled source code Date: Tue, 06 Aug 2013 15:57:24 +0200 Message-ID: <861u66ly63.fsf@somewhere.org> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: 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-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Roland wrote: > I use orgmode to write code in a IA language developped by the company I > work for. Everything was just nice when I attempted to insert in the source > code a value set up in my org buffer. > > Here is the real situation : > > #+TBLNAME: tab_x > | x | 1 | > #+begin_src own_lang :tangle ./tangle_file :var x=x[0,1] > TYPE OBJ; > > CONSTANTE > var_x DOMAIN INTEGER DEFAULT $x > #+end_src > > and I would except in tangle_file : > TYPE OBJ; > > CONSTANTE > var_x DOMAIN INTEGER DEFAULT 1 > > But unfortunately, I get > TYPE OBJ; > > CONSTANTE > var_x DOMAIN INTEGER DEFAULT $x > > Any ideas??? First, x[0,1] can't be resolved (unlike tab_x[0,1]). For the rest, I'd guess you must add the proper replacemen "method" for `own_lang'. Is this the case? I mean: depending on the Babel language, variables must or must not be prefixed by a $ sign to be replaced in the code block. For example, in Emacs Lisp, you won't prefix vars with $. Maybe have a look at `sh' or `sql' Babel languages for inspiration. Best regards, Seb -- Sebastien Vauban