emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [babel] noweb with ob-screen??
@ 2011-12-30  1:42 Torsten Wagner
  2012-01-02 17:47 ` Eric Schulte
  0 siblings, 1 reply; 2+ messages in thread
From: Torsten Wagner @ 2011-12-30  1:42 UTC (permalink / raw)
  To: Org Mode Mailing List

[-- Attachment #1: Type: text/plain, Size: 1015 bytes --]

Hi
this is a follow up on a early post.
I try to get noweb working with ob-screen.
I wrote several code blocks and named them.  I finished with a code block
which calls all other blocks using noweb notation adding to its header
:noweb yes.  I execute this block by C-c C-c but the noweb reference get
not resolved.
In my understanding they should isn't it? Or do I mix tangling and
execution? In my understanding noweb should work for both cases isn't it?

I looked in the source code of ob-screen and try to get an idea why it
doesn't work.  However compare to other babel modes I could not find that
it is missing anything related to noweb.  It seems to me that noweb is a
babel mode independent functionality and hence should work with all babel
languages.

If I'm wrong could someone please point me to an example in the source code
how to implement noweb functionality.

Thanks a lot

Torsten

Cc.  Sorry all this is written down from memory on my smartphone and hence
no code examples and maybe wrong syntax.

[-- Attachment #2: Type: text/html, Size: 1107 bytes --]

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

* Re: [babel] noweb with ob-screen??
  2011-12-30  1:42 [babel] noweb with ob-screen?? Torsten Wagner
@ 2012-01-02 17:47 ` Eric Schulte
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Schulte @ 2012-01-02 17:47 UTC (permalink / raw)
  To: Torsten Wagner; +Cc: Org Mode Mailing List

[-- Attachment #1: Type: text/plain, Size: 668 bytes --]

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

> Hi
> this is a follow up on a early post.
> I try to get noweb working with ob-screen.
> I wrote several code blocks and named them.  I finished with a code block
> which calls all other blocks using noweb notation adding to its header
> :noweb yes.  I execute this block by C-c C-c but the noweb reference get
> not resolved.
> In my understanding they should isn't it? Or do I mix tangling and
> execution? In my understanding noweb should work for both cases isn't it?
>

The expansion should occur as part of executing the code block.  For
example notice the expansion of the sh code blocks in this example...


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: noweb.org --]
[-- Type: text/x-org, Size: 214 bytes --]

#+begin_src sh :noweb yes :results output
  <<first>>
  <<second>>
#+end_src

#+results:
: first
: second

#+name: first
#+begin_src sh
  echo first
#+end_src

#+name: second
#+begin_src sh
  echo second
#+end_src

[-- Attachment #3: Type: text/plain, Size: 1240 bytes --]


>
> I looked in the source code of ob-screen and try to get an idea why it
> doesn't work.  However compare to other babel modes I could not find that
> it is missing anything related to noweb.  It seems to me that noweb is a
> babel mode independent functionality and hence should work with all babel
> languages.
>

This is certainly the case, noweb expansion occurs *before* the language
specific code is invoked.  In fact I can confirm that an expanded body
is passed to the screen execution function.  Are you sure that it is
only screen code blocks for which you are having trouble with noweb
references?  Could you ensure that the attached example above expands
for sh code blocks, and then try to translate it to screen code blocks?

>
> If I'm wrong could someone please point me to an example in the source code
> how to implement noweb functionality.
>

The above example should serve, the manual is also a good resource, and
finally there any many small examples located at

http://eschulte.github.com/org-scraps/

Best -- Eric

>
> Thanks a lot
>
> Torsten
>
> Cc.  Sorry all this is written down from memory on my smartphone and hence
> no code examples and maybe wrong syntax.

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/

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

end of thread, other threads:[~2012-01-02 18:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-30  1:42 [babel] noweb with ob-screen?? Torsten Wagner
2012-01-02 17:47 ` Eric Schulte

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