emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nuno Salgado <nuno@salgado.eu>
To: Diego Zamboni <diego@zzamboni.org>
Cc: Org-mode <Emacs-orgmode@gnu.org>
Subject: Re: noweb
Date: Thu, 23 Jan 2020 00:18:47 +0000	[thread overview]
Message-ID: <877e1jqb2w.fsf@nulle1.home> (raw)
In-Reply-To: <CAGY83Ee4XHp1ttrMLigDb6k6Dq8zemCxRFhgpSRo_J5bi3Oqog@mail.gmail.com> (Diego Zamboni's message of "Wed, 22 Jan 2020 23:14:19 +0100")

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 <diego@zzamboni.org> 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 <nuno@salgado.eu> 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
>

  reply	other threads:[~2020-01-23  0:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-22 19:41 noweb Nuno Salgado
2020-01-22 20:21 ` noweb Marco Wahl
2020-01-23  0:04   ` noweb Nuno Salgado
2020-01-23  7:58     ` noweb Marco Wahl
2020-01-22 22:14 ` noweb Diego Zamboni
2020-01-23  0:18   ` Nuno Salgado [this message]
2020-01-23  7:00     ` noweb Fraga, Eric
2020-01-23 19:17       ` noweb Nick Dokos

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=877e1jqb2w.fsf@nulle1.home \
    --to=nuno@salgado.eu \
    --cc=Emacs-orgmode@gnu.org \
    --cc=diego@zzamboni.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).