[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: noweb
From: |
Nuno Salgado |
Subject: |
Re: noweb |
Date: |
Thu, 23 Jan 2020 00:18:47 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) |
Diego,
Thank you for your help.
Yes, I want the scripts to be all in one file in order to execute them
all. But it's nice do execute then individualy (C-c C-c) to test and debug.
I think I have to have 2 blocks of code for each script: one for tangle,
with no <<DEFVARS>> and another to test, with <<DEFVARS>> and <<SCRIPTn>>;
N
Diego Zamboni <address@hidden> writes:
> Hi Nuno,
>
> ":noweb eval" means that noweb references are only expanded during
> evaluation of the code, but not during export. This is why you get
> the literal <<DEFVARS>> references in exported output. Here are the
> possible values of :noweb and what they mean: https://orgmode.org/
> manual/noweb.html
>
> Also note that if all of this is in the same file, both Script1 and
> Script2 will be tangled to the same file, you may want to specify
> different filenames as the value of :tangle (see https://orgmode.org/
> manual/tangle.html#tangle).
>
> Hope this helps,
> --Diego
>
>
> On Wed, Jan 22, 2020 at 8:41 PM Nuno Salgado <address@hidden> wrote:
>
> Hi,
>
> I'm writing an installation script in org-mode.
>
> I'm doing something like this:
>
> Vars definition:
> #+NAME:DEFVARS
> #+BEGIN_SRC shell :tangle yes
> v1=1;
> v2=2;
> #+END_SRC
>
> Script1:
> #+BEGIN_SRC shell :tangle yes :noweb eval
> <<DEFVARS>>
> echo $v1;
> #+END_SRC
>
> Script2:
> #+BEGIN_SRC shell :tangle yes :noweb eval
> <<DEFVARS>>
> echo $v2;
> echo $v1;
> #+END_SRC
>
> This works great when I do C-c C-c in each script.
>
> But when I do org-babel-tangle, the code gets two <<DEFVARS>>.
>
> Does it makes sense? Since I set noweb = eval why does it exports
> <<DEFVARS>>?
>
> Could you please help me turning around this problem without
> removing every reference <<DEFVARS>>
>
> Thank you very much.
>
>
> Regards,
> NS
>
- noweb, Nuno Salgado, 2020/01/22
- Re: noweb, Marco Wahl, 2020/01/22
- Re: noweb, Diego Zamboni, 2020/01/22
- Re: noweb,
Nuno Salgado <=