[Top][All Lists]

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

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

From: Thomas S. Dye
Subject: Re: [Orgmode][babel] noweb does not work (as expected)
Date: Sun, 8 Nov 2009 18:33:09 -1000

On Nov 8, 2009, at 5:47 PM, Torsten Wagner wrote:

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 ?

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.

#+srcname: makefile()
#+begin_src python :tangle simulate_ofdm :exports none
#+resname: makefile

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 ?



Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.

Hi Torsten,

I've been working successfully with your makefile idea.  Here is one that works for me:


#+begin_src R :noweb :session 135cultural 
   # run queries
   # reshape query results and run PCA
   # make biplots
   # segment plot
   # make tables for LaTeX
  # <<r-135-table-pca>>


A typical source block looks like this:


#+srcname: r-load-libraries
#+begin_src R


Note that I don't :tangle this, but use the :noweb feature, instead.  Also, my "makefile" runs all its :noweb source blocks in a :session, where the environment set up by each source block can persist and be referenced by other source blocks.  This particular makefile has run successfully dozens of times, as I fix little things and add new ones.

I don't know if this is the best way to accomplish this, or if it is what you are trying to achieve at the moment.  But, it looks to me as if you might want to :noweb instead of :tangle and perhaps establish a :session in case your source blocks need to communicate with one another.


Thomas S. Dye, Ph.D.

T. S. Dye & Colleagues, Archaeologists, Inc.

Phone: (808) 529-0866 Fax: (808) 529-0884


reply via email to

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