5

I have a chapter heading in a literate program, in which all source-code is tangled into a single file called test.hs. It is irritating and error-prone to have to repeatedly type the :tangle code/src/test.hs for every new code block

Hence I would like to use the properties drawer of that chapter to once and for all tell Emacs to tangle ALL source code it sees inside this subtree to go into the file test.hs

My attempt at trying this did not work. How do I fix it?

 ** New Chapter
 :+PROPERTIES:
 :tangle: code/src/test.hs   (This does not work!)
 :END:

  #+BEGIN_SRC haskell
    import qualified Data.Map as Map  
    main = print "Hello World"
  #+END_SRC

  Here's the `add` function to add two numbers.     

  #+BEGIN_SRC haskell 
   add a b = a+b
  #+END_SRC
  • 1
    There is unnecessary +-sign in the example before PROPERTIES. – Panu Jan 10 '17 at 19:58
7

You have to use :header-args: property instead. Like this

** New Chapter
:PROPERTIES:
:header-args: :tangle code/src/test.hs
:END:

This behaviour changed with the Org-mode 9 (see changes). There is also entry on org-mode manual.

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.