emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] Feature Request - Comments in noweb expansions


From: Shaun Richardson
Subject: [O] Feature Request - Comments in noweb expansions
Date: Thu, 13 Nov 2014 19:52:20 +0200

Hello orgmode community!

using ":comments org" as a header argument to a code block allows the header and text above the code block to be inserted into the tangled file as comments. Very awesome. 

This does not work for noweb reference expansions however.
For example, given the following org mode file:
--8<---------------cut here---------------start------------->8--- 
* 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
--8<---------------cut here---------------end--------------->8---

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

--8<---------------cut here---------------start------------->8---
# Additional info
# This is bar

hello_person()

# A function call
# This is foo

hello_world()
--8<---------------cut here---------------end--------------->8---

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

--8<---------------cut here---------------start------------->8---
# Additional info
# This is bar

hello_person()
hello_world()
--8<---------------cut here---------------end--------------->8---

Is there a native way to get this behaviour or do I advise org-babel-expand-noweb-references?
I am keen to hack a patch myself, would just appreciate a pointer in the right direction. (drowning in org-mode code)
First time poster.

--
Thanks
Gambo

reply via email to

[Prev in Thread] Current Thread [Next in Thread]