emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Shaun Richardson <srconstruct@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Feature Request - Comments in noweb expansions
Date: Thu, 13 Nov 2014 19:52:20 +0200	[thread overview]
Message-ID: <CAPRbgX1kWwdtDMpQB5Q5UMB5aShfQq5kmj7tupj+L6SCBg6xiw@mail.gmail.com> (raw)

[-- 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 --]

                 reply	other threads:[~2014-11-13 17:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=CAPRbgX1kWwdtDMpQB5Q5UMB5aShfQq5kmj7tupj+L6SCBg6xiw@mail.gmail.com \
    --to=srconstruct@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).