When <> expands to multiple line and I wrote like this
some-string <<noweb ref>>
then it expands like
Is there a way to avoid this?
Emacs Stack Exchange is a question and answer site for those using, extending or developing Emacs. It only takes a minute to sign up.Sign up to join this community
I think you're asking how to prefix only the first line of the noweb block. It will probably depend on the language your using, but I came up with this hack for bash:
#+NAME: example #+BEGIN_SRC text please echo this line date ## but not this one cd test ## this one ls -l ## or this one #+END_SRC Bad source code block, echo prepended to very line: #+BEGIN_SRC bash :noweb yes :results verbatim echo <<example>> #+END_SRC #+RESULTS: : please echo this line : date : cd test : ls -l : Good source code block, echo prepended to the first line only, the rest are executed: #+BEGIN_SRC bash :noweb yes :results verbatim echo \ <<example>> #+END_SRC #+RESULTS: : please echo this line : Thu Nov 9 10:22:32 EST 2017 : total 0 : -rw-r--r-- 1 tws tws 0 Nov 9 09:44 one : -rw-r--r-- 1 tws tws 0 Nov 9 09:44 three : -rw-r--r-- 1 tws tws 0 Nov 9 09:44 two