emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Dan Davison <davison@stats.ox.ac.uk>
To: Torsten Wagner <torsten.wagner@gmail.com>
Cc: Org Mode Mailing List <emacs-orgmode@gnu.org>
Subject: Re: [babel] noweb does not work (as expected)
Date: Sun, 08 Nov 2009 23:41:58 -0500	[thread overview]
Message-ID: <87y6mge2cp.fsf@stats.ox.ac.uk> (raw)
In-Reply-To: <200911091247.48775.torsten.wagner@googlemail.com> (Torsten Wagner's message of "Mon, 9 Nov 2009 12:47:48 +0900")

Hi Torsten,

Torsten Wagner <torsten.wagner@gmail.com> writes:

> Hi everyone,
>
> I tried to use the noweb-syntax to tangle all the pieces of source code blocks 
> together as proposed by Tom.
>
> However, for some reasons it does not work. 
> I notice there are two different syntax for noweb. One propsed on worg and the 
> other in examples here in the mailing list. Which one will be correct ? or are 
> both correct but with different purpose ?

<<block-1>> inserts the body of block 'block-1'. <<block-1()> inserts
the *result* of evaluating block-1, and <<block-1(x=3.3)>> inserts the
result of evaluating it with the specified argument value. I've just
added documentation of this to Worg.

>
> I used the latest git-version and even tried the branch noweb-evaluate
>
> What I used was a source code block at the end of my org-file like:
> All other blocks are defined above.

Can you provide the exact contents of the file you're having trouble
with? If I have

----------------------------------------------------------------
* test tangle
#+srcname: block1
#+begin_src python 
  x = 1
#+end_src

#+srcname: makefile()
#+begin_src python :tangle simulate_ofdm :exports none
  This is makefile
  <<block1>>
#+end_src
----------------------------------------------------------------

then for me org-babel-tangle produces

----------------------------------------------------------------
#!/usr/bin/env python
# generated by org-babel-tangle
# [[file:/tmp/zz.org::*test%20tangle][makefile]]
This is makefile
x = 1
# makefile ends here
----------------------------------------------------------------

Dan

>
> #+srcname: makefile()
> #+begin_src python :tangle simulate_ofdm :exports none
>   <<block1>>
>   <<block2>>
>   <<block3>>
>   <<block4>>
>   <<block5>>
> #+end_src
> #+resname: makefile
>
> However
> the tangled file results only in 
>
> #!/usr/bin/env python
> # generated by org-babel-tangle
> # [[file:~/test_noweb.org::*Result][makefile]]
>
> # makefile ends here
>
> An execution of block shows nothing on the *Shell output* buffer
> It seems somehow I missunderstand which part of a block will replace a 
> <<noweb>>  variable. I thouht it will be replaced by the complete source block 
> content during tangle. 
>
> Any ideas ?
>
> Thanks,
>
> Torsten
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

  parent reply	other threads:[~2009-11-09  4:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-09  3:47 [babel] noweb does not work (as expected) Torsten Wagner
2009-11-09  4:33 ` Thomas S. Dye
2009-11-09  7:38   ` Torsten Wagner
2009-11-09 16:32     ` Thomas S. Dye
2009-11-10  1:40       ` Torsten Wagner
2009-11-09  4:41 ` Dan Davison [this message]
2009-11-09  7:16   ` Torsten Wagner
2009-11-09 16:04     ` Dan Davison
2009-11-10  1:51       ` Torsten Wagner
2009-11-10  5:33         ` Eric Schulte
2009-11-10  3:02 ` [babel] (solved) " Torsten Wagner

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=87y6mge2cp.fsf@stats.ox.ac.uk \
    --to=davison@stats.ox.ac.uk \
    --cc=emacs-orgmode@gnu.org \
    --cc=torsten.wagner@gmail.com \
    /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).