emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Tomas Grigera <tgrigera@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Problem with noweb-ref property
Date: Thu, 29 Dec 2011 16:13:40 -0300	[thread overview]
Message-ID: <CAJMNdQJbEtooaKznrwkkZ8tsAW=5hy8Y+-ctXS5WcqUF2ASz4A@mail.gmail.com> (raw)

Hi list,

This is my first post, so just let me say first that I have been using
org-mode for 10 months or so and I love it. It's an exceptional
package, and before I ask my question I would just like to thank
Carsten, Bastien, and the community for the great work and for
sharing.

Now my question: I am trying to extract code from a .org file by
tangling with noweb-style references. As I understand from the manual,
if I write <<foo>> in a code block, the line will be expanded with the
code block named foo. This name I can set with #+NAME:  or with the
:noweb-ref header argument. Both ways work for me, except that I
cannont set the :noweb-ref argument through a property.

The following example is almost verbatim from the manual:

#+BEGIN_SRC sh :tangle yes :noweb yes :shebang #!/bin/sh
<<fullest-disk>>
#+END_SRC

* the mount point of the fullest disk

** query all mounted disks

#+HEADER: :noweb-ref fullest-disk
#+BEGIN_SRC sh
        df \
#+END_SRC


** strip the header row
  :PROPERTIES:
  :noweb-ref: fullest-disk
  :END:
#+BEGIN_SRC sh :noweb yes
        |sed '1d' \
#+END_SRC


If I understand correctly, tangling should produce a file which is a
concatenation of the two code blocks. However, when I do
org-babel-tangle, only the first block   is inserted. Am I doing
something wrong?

I'm with emacs 23.2.1 and org-mode 7.8.02

Thanks in advance,

Tomas

             reply	other threads:[~2011-12-29 19:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-29 19:13 Tomas Grigera [this message]
2011-12-29 19:51 ` Problem with noweb-ref property Eric Schulte
2011-12-29 23:16   ` Tomas Grigera
2012-01-02 12:32     ` Andreas Leha
2012-01-02 18:01       ` Eric Schulte
2012-01-03 10:07         ` Andreas Leha

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='CAJMNdQJbEtooaKznrwkkZ8tsAW=5hy8Y+-ctXS5WcqUF2ASz4A@mail.gmail.com' \
    --to=tgrigera@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).