From: "Sebastien Vauban" <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
To: emacs-orgmode-mXXj517/zsQ@public.gmane.org
Subject: Re: Insert variable into tangled source code
Date: Tue, 06 Aug 2013 15:57:24 +0200 [thread overview]
Message-ID: <861u66ly63.fsf@somewhere.org> (raw)
In-Reply-To: loom.20130806T153307-293@post.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
next prev parent reply other threads:[~2013-08-06 13:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-06 13:43 Insert variable into tangled source code Roland
2013-08-06 13:57 ` Sebastien Vauban [this message]
2013-08-06 14:40 ` Roland
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=861u66ly63.fsf@somewhere.org \
--to=sva-news-d0wtavr13harg/idocfnwg@public.gmane.org \
--cc=emacs-orgmode-mXXj517/zsQ@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).