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 03:14

2 Answers2

1

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]]]]
logc
  • 183
  • 5
0
#+BEGIN_SRC bash :noweb yes :results verbatim
  echo \
  <<example>>
#+END_SRC
Dima Fomin
  • 143
  • 5