I want to specify a default output file for all my tangle exports. I'm using Org mode 8.x. (For Org mode ≥9.0, see How to tangle all code blocks to a common file)
This works:
#+BEGIN_SRC js :tangle "../js/out_file.js"
console.log("hello from org mode");
#+END_SRC
**
#+BEGIN_SRC js :tangle "../js/out_file.js"
console.log("hello from org mode 2");
#+END_SRC
However, I don't want to keep repeating "../js/out_file.js" on each block.
I've looked at these following two links, which seem to be asking essentially the same question:
However, none of the recommendations work: If I just have a SRC block with no tangle arg, I get either "Tangled 0 code blocks from dummy.org" or "Wrote ./org/dummy.org" (which is the default file name)
Here's my final code. Currently, all the methods are uncommented, so it's possible they are interfering with each other, but I have tried each method in isolation to the same effect:
* Header
# method 1
:PROPERITES:
:tangle: "../out_file.js"
:END:
# method 2
#+TANGLE: "../js/out_file.js"
# method 3
#+BABEL: :tangle "../js/out_file.js"
# method 4
#+PROPERTY: header-args+ :tangle "../js/out_file.js"
# method 5
#+PROPERTY: header-args :session *my_js_session* :results silent :tangle "../js/out_file.js"
** some js source
#+BEGIN_SRC js
console.log("hello from org mode");
#+END_SRC
**
#+BEGIN_SRC js
console.log("hello from org mode 2");
#+END_SRC
Can anyone see what I'm doing wrong?
Do I have to somehow evaluate the properties before they take effect?
Are there any org commands I can issue to verify if the properties are properly set?
init.org
, with:header-args:emacs-lisp: :tangle ../.emacs
instead of:tangle:
.#+PROPERTY: tangle "~/.path/file.js"
. Put the cursor on it andC-c C-c
it should give you Local setup has been refreshed message in minibuffer. Tangle a file withC-c C-v t
(org-babel-tangle). It works for sure, because that is how I generate my dotfiles ;)