Question

When I try to run this:

** Header name
   :PROPERTIES:
   :header-args: :noweb yes
   :END:

#+NAME: prop_test
#+begin_src sh
  echo "...and it worked!"
#+end_src

#+begin_src sh
  echo "Beginning expansion..."
  <<prop_test>>
#+end_src

I get the error sh: 2: Syntax error: end of file unexpected.

If I add :noweb yes to the code header, it executes as expected. I thought the :header-args: property was supposed to do that automatically, but apparently it isn't. I've tried removing the whitespace separating the snippets and (unsurprisingly) it doesn't make a difference. I've tried specifying that the property is for sh (:header-args:sh:) but that doesn't do it either. Why doesn't the header-arg get applied?

Was it helpful?

Solution

I'm not sure why the code in the question doesn't work, since it's what's in the org-mode manual. What does work is the following, which I got from a different org-mode manual:

* Header name
  :PROPERTIES:
  :noweb: yes
  :END:

OTHER TIPS

The syntax was changed with Org 8.0. The syntax in your answer is for <8.0. You are probably using your distro's Org which is still 7.something. You can set Orgmode.org as a source for package.el or el-get to stay with the latest org.

For the record, the code in your question yields:

1.1 Header name
───────────────

  ┌────
  │ echo "...and it worked!"
  └────

  ┌────
  │ echo "Beginning expansion..."
  │ echo "...and it worked!"
  └────
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top