Browse Source

ob-tangle: don't throw errors when we're not under of a headline

* lisp/ob-tangle.el (org-babel-tangle-collect-blocks): don't throw
  errors when we're not under of a headline
Eric Schulte 14 years ago
parent
commit
158f5cc726
1 changed files with 3 additions and 1 deletions
  1. 3 1
      lisp/ob-tangle.el

+ 3 - 1
lisp/ob-tangle.el

@@ -234,7 +234,9 @@ code blocks by language."
 	       (setq current-heading new-heading))
 	   (setq block-counter (+ 1 block-counter))))
        (replace-regexp-in-string "[ \t]" "-"
-				 (nth 4 (org-heading-components))))
+				 (condition-case nil
+				     (nth 4 (org-heading-components))
+				   (error (buffer-file-name)))))
       (let* ((link (progn (call-interactively 'org-store-link)
                           (org-babel-clean-text-properties
 			   (car (pop org-stored-links)))))