2

Given the org-mode file

* File Description
  :PROPERTIES:
  :comments: org
  :tangle:   file.sh
  :noweb: yes
  :END:

** A function call
This is foo
#+BEGIN_SRC sh :noweb-ref myfunction :tangle no
hello_world()
#+END_SRC

** Additional info
This is bar
#+BEGIN_SRC sh :noweb yes
  hello_person()
  <<myfunction>>
#+END_SRC

When I tangle the file with C-c C-v t, my expectation would be the following result.

# Additional info
# This is bar

hello_person()

# A function call
# This is foo

hello_world()

But this isn't what happens, The comment from the myfunction noweb-ref is stripped from the final result and it looks like this.

# Additional info
# This is bar

hello_person()
hello_world()

Is there a native way to get this behaviour or do I advise org-babel-expand-noweb-references?

2
  • As far as I can tell there is no option to enable this: in org-babel-expand-noweb-references <<foo>> is (unconditionally) expanded to the contents of the named source code block foo, not the section containing this source code block. Nov 12, 2014 at 16:36
  • @Constantine This is helpful, Thanks!
    – Gambo
    Nov 13, 2014 at 17:25

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.