3

When using Org-mode 8.2.10, setting the header-args property does not seem to work as expected with Common Lisp code blocks. The following does not tangle the code blocks in the file:

#+PROPERTY: header-args :tangle yes

Specifying the language explicitly, however, does work:

#+PROPERTY: header-args:lisp :tangle yes

According to the manual, header-args without a language specifier should work for all code blocks, not just those for Emacs Lisp (which is presumably the default, and what I have working in my init file).

Is this expected behavior, or a subtle bug?

4

You need to refresh/activate the #+PROPERTY: line by invoking C-c C-c with point somehwhere in the line #+PROPERTY: header-args :tangle yes. After that, you should be able to call org-babel-tangle and have it work as expected!

This is not necessary if you use a property drawer, but is for the #+PROPERTY: line.

Keep in mind that this applies if you decide to change the #+PROPERTY: line too. If you change the line to #+PROPERTY: header-args :tangle no, those changes will not be registered even if you save the buffer. You will need to call C-c C-c again with point on the line for the setup to be refreshed.

I am not sure why #+PROPERTY: header-args:lisp :tangle yes worked for you when the other didn't, but I assume that things somehow got refreshed in the meantime, making it seem like one worked and one didn't.

  • Interesting. This would imply that the buffer properties are cached in some way; I'm not sure what the purpose of that would be. – Tianxiang Xiong Jan 8 '16 at 21:31
  • If you are inclined to dive deeper into how this is implemented, you can start with the documentation and source code for org-ctrl-c-ctrl-c (which you are calling withC-c C-c in the #+PROPERTY line), and follow the rabbit hole wherever it leads. – elethan Jan 8 '16 at 21:49

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.