emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Vladimir Lomov <lomov.vl@gmail.com>
To: General discussions about Org-mode <emacs-orgmode@gnu.org>
Subject: Header ':comments noweb' mangles lines in tangled code
Date: Tue, 18 Mar 2014 15:29:12 +0900	[thread overview]
Message-ID: <20140318062912.GD6077@smoon> (raw)

Hello,
consider the following example Org document:

------------------------------ 8< ------------------------------ 
#+TITLE: Example
#+AUTHOR: Vladimir Lomov

* How ~comments~ interferes with ~noweb~

#+NAME: code1
#+BEGIN_SRC sh
  var1
#+END_SRC

#+NAME: code2
#+BEGIN_SRC sh
  [[ -t ${SHELL} ]]
#+END_SRC

#+BEGIN_SRC sh :noweb yes :tangle ex-sh.sh
  <<code1>> = <<code1>>

  <<code2>> && {
    echo "HELLO..."
  }
#+END_SRC

** Now ~comments~ is on

At first, ~comments~ is ~link~

#+BEGIN_SRC sh :noweb yes :tangle ex-c:link.sh :comments link
  <<code1>> = <<code1>>

  <<code2>> && {
    echo "HELLO..."
  }
#+END_SRC

Then ~comments~ is ~org~

#+BEGIN_SRC sh :noweb yes :tangle ex-c:org.sh :comments org
  <<code1>> = <<code1>>

  <<code2>> && {
    echo "HELLO..."
  }
#+END_SRC

Now ~comments~ is ~both~

#+BEGIN_SRC sh :noweb yes :tangle ex-c:both.sh :comments both
  <<code1>> = <<code1>>

  <<code2>> && {
    echo "HELLO..."
  }
#+END_SRC

And finally, ~comments~ is ~noweb~

#+BEGIN_SRC sh :noweb yes :tangle ex-c:noweb.sh :comments noweb
  <<code1>> = <<code1>>

  <<code2>> && {
    echo "HELLO..."
  }
#+END_SRC
------------------------------ 8< ------------------------------ 

All combinations except ':comments noweb' give expected results, while
the last one produces a file with mangled lines,
--------------------- 8< ex-c:noweb.sh 8< ---------------------- 
# [[file:ex.org::*Now%20~comments~%20is%20on][Now\ ~comments~\ is\ on:4]]
# [[file:~/tmp/ex.org::*How%20~comments~%20interferes%20with%20~noweb~][code1]]
var1
# code1 ends here = # [[file:~/tmp/ex.org::*How%20~comments~%20interferes%20with%20~noweb~][code1]]
<<code1>> = var1
<<code1>> = # code1 ends here

# [[file:~/tmp/ex.org::*How%20~comments~%20interferes%20with%20~noweb~][code2]]
[[ -t ${SHELL} ]]
# code2 ends here && {
  echo "HELLO..."
}
# Now\ ~comments~\ is\ on:4 ends here
------------------------------ 8< ------------------------------ 
Is it expected behaviour meaning a limitation of ':comments noweb' or a
bug?

I'm using Org mode:
Org-mode version 8.2.5h (release_8.2.5h-777-g5d8cc3 @/usr/share/emacs/site-lisp/org/)

---
WBR, Vladimir Lomov

-- 
My mother was a test tube; my father was a knife.
		-- Friday

                 reply	other threads:[~2014-03-18  6:29 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=20140318062912.GD6077@smoon \
    --to=lomov.vl@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).