emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Schulte <eric.schulte@gmx.com>
To: Torsten Wagner <torsten.wagner@gmail.com>
Cc: Org Mode Mailing List <emacs-orgmode@gnu.org>
Subject: Re: [babel] noweb with ob-screen??
Date: Mon, 02 Jan 2012 10:47:49 -0700	[thread overview]
Message-ID: <87vcouc6qa.fsf@gmx.com> (raw)
In-Reply-To: CAPaq-gN1otb8TPoMUWqYSQmE3tp+E-=siD8jyWgOB2_Q8rtcVA@mail.gmail.com

[-- 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/

      reply	other threads:[~2012-01-02 18:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-30  1:42 [babel] noweb with ob-screen?? Torsten Wagner
2012-01-02 17:47 ` Eric Schulte [this message]

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=87vcouc6qa.fsf@gmx.com \
    --to=eric.schulte@gmx.com \
    --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).