I want to use the noweb style references in Emacs org for literate programming.

Consider the following working code.

#include <iostream>

Blah blah

#+BEGIN_SRC c++ :tangle test.cpp :noweb yes
int main (void)
   std::cout << "Hello World" << std::endl;

I don't want to have to specify :noweb yes every time to expand noweb references since I will always be expanding them by default. How do I change my .emacs file to tell org mode this?

up vote 2 down vote accepted

There's an example for doing just what you are asking in the Org Manual:


Here it is for convenience:

This example sets :noweb header arguments to yes, which makes Org expand :noweb references by default.

 (setq org-babel-default-header-args
      (cons '(:noweb . "yes")
            (assq-delete-all :noweb org-babel-default-header-args)))

Try setq org-babel-default-header-args.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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