There seems to be a bug in org-mode 8.2.5g for tangling source blocks. If I have an org-file with just this in it: #+BEGIN_SRC python :tangle test2.py a = 1 print a*2 #+END_SRC #+RESULTS: : 2 And then I run org-babel-tangle, I get this error: byte-code: Before first headline at position 3 in buffer test.org<2> The file tangles fine with an older org7.9 version. It also tangles fine if I add a headline above the source block. The error seems to come from this line: (org-back-to-heading t) ; Sets match data L476 in ob-tangle.el John ----------------------------------- John Kitchin Associate Professor Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 http://kitchingroup.cheme.cmu.edu