emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Feature Request - Comments in noweb expansions
@ 2014-11-13 17:52 Shaun Richardson
  0 siblings, 0 replies; only message in thread
From: Shaun Richardson @ 2014-11-13 17:52 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1626 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 2045 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-11-13 17:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-13 17:52 Feature Request - Comments in noweb expansions Shaun Richardson

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).