Skip to main content
6 votes
Accepted

Noweb references in sh blocks breaks the syntax highlighting

You can define the delimiters babel use for noweb references, by setting org-babel-noweb-wrap-start and org-babel-noweb-wrap-start. For instance, in org mode document where I dabble in bash, I insert ...
Dreammm's user avatar
  • 76
4 votes

Noweb references in sh blocks breaks the syntax highlighting

I liked @Dreammm's idea of using the « and » characters but didn't like having to declare file local variables. I also did not want to always use « and ». I just overwrote the org-babel-noweb-wrap ...
Chris's user avatar
  • 153
4 votes
Accepted

How to get babel code blocks to evaluate parameters when called from a noweb ref?

There may be other solutions, this is how I would do it: #+begin_src sh :noweb yes :var res=test-fn() echo $res #+end_src #+results: : testvar=This is a test The same can be done without ...
mutbuerger's user avatar
  • 3,504
4 votes
Accepted

noweb function call with variable arguments

Try this The reason why the error happens is because you haven't defined y in the x=y arguments. If you update code as follows noweb will work #+NAME: cubed-plus-cubed #+BEGIN_SRC python :noweb ...
Melioratus's user avatar
  • 4,688
3 votes

How to pass newline ("\n") string to noweb <<call>>

I understand your confusion. The good news is that your code is already passing new lines correctly into your noweb call. The reason you're seeing the eval: Symbol’s value as variable is void: a ...
Melioratus's user avatar
  • 4,688
3 votes

Insert noweb references with completion

I think there is already a parser for src block names in org-babel-src-block-names returning a list. The following provides programmed completion for that list: (defun org-src-block-names--completion-...
mutbuerger's user avatar
  • 3,504
2 votes

Insert noweb references with completion

This is only a partial solution, but the dabbrev-expand method can be greatly improved by modifying the syntax table so that < and > are treated as delimiters: (modify-syntax-entry ?< "(>"...
deprecated's user avatar
  • 2,845
2 votes

Report missing noweb references in org-babel

The behavior you want is controlled by the variable org-babel-noweb-error-all-langs, whose default value is nil. Set it to t (e.g. via (setq org-babel-noweb-error-all-langs t) in your init file), and ...
Aaron Miller's user avatar
2 votes
Accepted

How to avoid multiplying of a string which precedes <<noweb reference>> in code block?

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 ...
Tyler's user avatar
  • 22.4k
2 votes
Accepted

Nested noweb in org src blocks

Your example works if I set all headers with :noweb yes and then only the last block has :tangle yes. A simpler example: Add this at the top of the file: #+PROPERTY: header-args :noweb yes :tangle no ...
mankoff's user avatar
  • 4,226
2 votes
Accepted

Export an orgmode buffer without expanding noweb references?

To export a buffer without expanding noweb references, you can set the following at your src header, as per documentation: #+begin_src language :noweb no-export To define that globally, you can add ...
Daniel's user avatar
  • 3,653
1 vote
Accepted

In Elisp, how can I insert an org-babel JSON block into a variable with noweb?

The function (org-babel-expand-noweb-references info) returns the noweb-expanded string for the source block info. The structure of the source block info is described in the help of org-babel-get-src-...
Tobias's user avatar
  • 33.3k
1 vote

Issue when expanding clojure source blocks

I got what I wanted to work by changing the text expand function to (defun org-babel-expand-body:text (body params) (replace-regexp-in-string (regexp-quote "\n") "\\n" (org-trim ...
JMurp's user avatar
  • 11
1 vote

How to disable noweb prefix lines?

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 ...
logc's user avatar
  • 183

Only top scored, non community-wiki answers of a minimum length are eligible