5

This says that

Noweb insertions now honor prefix characters that appear before <<reference>>.

And because of that trying to use

#+BEGIN_SRC clojure :noweb-ref dep-cljsbuild
[lein-figwheel "0.5.9"]
[lein-cljsbuild "1.1.5" :exclusions [[org.clojure/clojure]]]
#+END_SRC

with

:plugins [<<dep-cljsbuild>>]

gives me

:plugins [[lein-figwheel "0.5.9"]
:plugins [[lein-cljsbuild "1.1.5" :exclusions [[org.clojure/clojure]]]]

which is obviously not what I want. I can workaround issue by moving <<dep-cljsbuild>> to the new line, but it looks ugly.

Could you recommend any proper way to point org-mode that in particular place I don't want prefixes to be preserved? (Or at least how to disable it globally)

  • This does not appear possible to me in org. I would move the :plugins part into the noweb-ref block. The expansion is done by org-babel-expand-noweb-references. – John Kitchin Jun 11 '18 at 3:14
0
#+BEGIN_SRC bash :noweb yes :results verbatim
  echo \
  <<example>>
#+END_SRC
| improve this answer | |
  • 1
    Please consider explaining your code, to improve your answer. – Drew Nov 13 '17 at 1:51
0

There is another workaround: remove newlines from the referenced code block.

According to the Org manual

Since this change does not affect noweb replacement text without newlines in them, inline noweb references are acceptable.

Here is a minimal example:

#+TITLE: Example

#+BEGIN_SRC clojure :noweb-ref dep-cljsbuild
[lein-figwheel "0.5.9"] [lein-cljsbuild "1.1.5" :exclusions [[org.clojure/clojure]]]
#+END_SRC

#+BEGIN_SRC clojure :noweb yes
:plugins [<<dep-cljsbuild>>]
#+END_SRC

Previewing the second snippet when expanded using C-c C-v v shows:

:plugins [[lein-figwheel "0.5.9"] [lein-cljsbuild "1.1.5" :exclusions [[org.clojure/clojure]]]]
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.