ob-tangle: Fix bug when heading has no text

* lisp/ob-tangle.el (org-babel-tangle-collect-blocks): Use dummy
string when heading has no text.
This commit is contained in:
Michael Brand 2012-09-01 15:38:09 +02:00 committed by Bastien Guerry
parent 8d09d1aaa9
commit 9852ad9418
1 changed files with 2 additions and 1 deletions

View File

@ -360,7 +360,8 @@ code blocks by language."
(setq block-counter (+ 1 block-counter)))) (setq block-counter (+ 1 block-counter))))
(replace-regexp-in-string "[ \t]" "-" (replace-regexp-in-string "[ \t]" "-"
(condition-case nil (condition-case nil
(nth 4 (org-heading-components)) (or (nth 4 (org-heading-components))
"(dummy for heading without text)")
(error (buffer-file-name))))) (error (buffer-file-name)))))
(let* ((start-line (save-restriction (widen) (let* ((start-line (save-restriction (widen)
(+ 1 (line-number-at-pos (point))))) (+ 1 (line-number-at-pos (point)))))