Explorar o código

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 %!s(int64=14) %!d(string=hai) anos
pai
achega
158f5cc726
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  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 current-heading new-heading))
 	   (setq block-counter (+ 1 block-counter))))
 	   (setq block-counter (+ 1 block-counter))))
        (replace-regexp-in-string "[ \t]" "-"
        (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)
       (let* ((link (progn (call-interactively 'org-store-link)
                           (org-babel-clean-text-properties
                           (org-babel-clean-text-properties
 			   (car (pop org-stored-links)))))
 			   (car (pop org-stored-links)))))