emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Header ':comments noweb' mangles lines in tangled code
@ 2014-03-18  6:29 Vladimir Lomov
  0 siblings, 0 replies; only message in thread
From: Vladimir Lomov @ 2014-03-18  6:29 UTC (permalink / raw)
  To: General discussions about Org-mode

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

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

only message in thread, other threads:[~2014-03-18  6:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-18  6:29 Header ':comments noweb' mangles lines in tangled code Vladimir Lomov

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