emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [babel] Problem using noweb
@ 2011-02-09 15:33 andy
  2011-02-09 19:04 ` Eric S Fraga
  0 siblings, 1 reply; 5+ messages in thread
From: andy @ 2011-02-09 15:33 UTC (permalink / raw)
  To: emacs-orgmode

I want to take advantage of babel's noweb capabilities, but I can't seem
to get it to work. I'm sure there is something trivial wrong with my
source block, but after looking at the documentation and looking at the
examples I can find on the web, I think this should work.

I define a variable in test-block, but it's not there, even though
test-block should be getting pulled in when I run the source block, bar.
What am I doing wrong? My .emacs has R defined and indeed, the session
*R* starts up without any problems and the print statement works, but
test-block just isn't there.

* Foo
** Bar
#+src_name: bar
#+begin_src R :noweb yes :session *R*
  <<test-block>>
  print("I am here")
  a
#+end_src

* test-block
#+src_name: test-block
#+begin_src R :session *R*
  a <- c(1,2,3,4,5)
#+end_src


thanks
--andy

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [babel] Problem using noweb
  2011-02-09 15:33 [babel] Problem using noweb andy
@ 2011-02-09 19:04 ` Eric S Fraga
  2011-02-09 20:27   ` Dan Davison
  0 siblings, 1 reply; 5+ messages in thread
From: Eric S Fraga @ 2011-02-09 19:04 UTC (permalink / raw)
  To: andy; +Cc: emacs-orgmode

andy <andy.choens@gmail.com> writes:

> I want to take advantage of babel's noweb capabilities, but I can't seem
> to get it to work. I'm sure there is something trivial wrong with my
> source block, but after looking at the documentation and looking at the
> examples I can find on the web, I think this should work.
>
> I define a variable in test-block, but it's not there, even though
> test-block should be getting pulled in when I run the source block, bar.
> What am I doing wrong? My .emacs has R defined and indeed, the session
> *R* starts up without any problems and the print statement works, but
> test-block just isn't there.
>
> * Foo
> ** Bar
> #+src_name: bar
> #+begin_src R :noweb yes :session *R*
>   <<test-block>>
>   print("I am here")
>   a
> #+end_src
>
> * test-block
> #+src_name: test-block
> #+begin_src R :session *R*
>   a <- c(1,2,3,4,5)
> #+end_src
>
>
> thanks
> --andy

I believe that you need to specify noweb on every source block,
including the one you wish to include.  That's what I had to do, in any
case, if I remember correctly...  haven't tried it on your code as my
train is pulling into the station and I have to run! ;)

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
: using Org-mode version 7.4 (release_7.4.330.g7473e)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [babel] Problem using noweb
  2011-02-09 19:04 ` Eric S Fraga
@ 2011-02-09 20:27   ` Dan Davison
  2011-02-09 20:57     ` andy
  2011-02-09 23:11     ` Eric S Fraga
  0 siblings, 2 replies; 5+ messages in thread
From: Dan Davison @ 2011-02-09 20:27 UTC (permalink / raw)
  To: Eric S Fraga; +Cc: emacs-orgmode, andy

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> andy <andy.choens@gmail.com> writes:
>
>> I want to take advantage of babel's noweb capabilities, but I can't seem
>> to get it to work.
[...]
>> * Foo
>> ** Bar
>> #+src_name: bar
>> #+begin_src R :noweb yes :session *R*
>>   <<test-block>>
>>   print("I am here")
>>   a
>> #+end_src
>>
>> * test-block
>> #+src_name: test-block
>> #+begin_src R :session *R*
>>   a <- c(1,2,3,4,5)
>> #+end_src
>>

Hey Andy,

I hope this didn't detain you too long, because you were basically doing
nothing wrong. Except... #+srcname has no underscore in it!

> I believe that you need to specify noweb on every source block,
> including the one you wish to include.

Nope. :) Only bar needs :noweb above.

Dan

>  That's what I had to do, in any
> case, if I remember correctly...  haven't tried it on your code as my
> train is pulling into the station and I have to run! ;)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [babel] Problem using noweb
  2011-02-09 20:27   ` Dan Davison
@ 2011-02-09 20:57     ` andy
  2011-02-09 23:11     ` Eric S Fraga
  1 sibling, 0 replies; 5+ messages in thread
From: andy @ 2011-02-09 20:57 UTC (permalink / raw)
  Cc: emacs-orgmode



On 02/09/2011 03:27 PM, Dan Davison wrote:
> Eric S Fraga <e.fraga@ucl.ac.uk> writes:
>
>> andy <andy.choens@gmail.com> writes:
>>
>>> I want to take advantage of babel's noweb capabilities, but I can't seem
>>> to get it to work.
> [...]
>>> * Foo
>>> ** Bar
>>> #+src_name: bar
>>> #+begin_src R :noweb yes :session *R*
>>>   <<test-block>>
>>>   print("I am here")
>>>   a
>>> #+end_src
>>>
>>> * test-block
>>> #+src_name: test-block
>>> #+begin_src R :session *R*
>>>   a <- c(1,2,3,4,5)
>>> #+end_src
>>>
> Hey Andy,
>
> I hope this didn't detain you too long, because you were basically doing
> nothing wrong. Except... #+srcname has no underscore in it!
>

That got it. Thanks. I am feeling a little silly right now.

>> I believe that you need to specify noweb on every source block,
>> including the one you wish to include.
> Nope. :) Only bar needs :noweb above.
>
> Dan
>
>>  That's what I had to do, in any
>> case, if I remember correctly...  haven't tried it on your code as my
>> train is pulling into the station and I have to run! ;)

-- 
I climb things up so I can ski them DOWN!

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [babel] Problem using noweb
  2011-02-09 20:27   ` Dan Davison
  2011-02-09 20:57     ` andy
@ 2011-02-09 23:11     ` Eric S Fraga
  1 sibling, 0 replies; 5+ messages in thread
From: Eric S Fraga @ 2011-02-09 23:11 UTC (permalink / raw)
  To: Dan Davison; +Cc: emacs-orgmode, andy

Dan Davison <dandavison7@gmail.com> writes:

> Eric S Fraga <e.fraga@ucl.ac.uk> writes:

[...]

>
>> I believe that you need to specify noweb on every source block,
>> including the one you wish to include.
>
> Nope. :) Only bar needs :noweb above.

Thanks for the correction!  this is one of those cases of having tried
all kinds of things, I never did know what it is that I had done to get
noweb working but convinced myself that it was adding :noweb yes to
everything that did it!


-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
: using Org-mode version 7.4 (release_7.4.330.g7473e.dirty)

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-02-09 23:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-09 15:33 [babel] Problem using noweb andy
2011-02-09 19:04 ` Eric S Fraga
2011-02-09 20:27   ` Dan Davison
2011-02-09 20:57     ` andy
2011-02-09 23:11     ` Eric S Fraga

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).