emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode][babel] noweb does not work (as expected)


From: Dan Davison
Subject: Re: [Orgmode][babel] noweb does not work (as expected)
Date: Sun, 08 Nov 2009 23:41:58 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Hi Torsten,

Torsten Wagner <address@hidden> 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.
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode




reply via email to

[Prev in Thread] Current Thread [Next in Thread]