Babel: Stop tangling failing in an indirect buffer

* ob-tangle.el (org-babel-tangle): Make it work in an indirect buffer.

The problem was that the message generated after tangling included the
file name of the current buffer which was nil in an indirect buffer.

TINYCHANGE
This commit is contained in:
Shaun Johnson 2011-03-09 15:32:40 +00:00 committed by Eric Schulte
parent 60864e851b
commit de63411264
1 changed files with 2 additions and 1 deletions

View File

@ -243,7 +243,8 @@ exported source code blocks by language."
(org-babel-tangle-collect-blocks lang))
(message "tangled %d code block%s from %s" block-counter
(if (= block-counter 1) "" "s")
(file-name-nondirectory (buffer-file-name (current-buffer))))
(file-name-nondirectory
(buffer-file-name (or (buffer-base-buffer) (current-buffer)))))
;; run `org-babel-post-tangle-hook' in all tangled files
(when org-babel-post-tangle-hook
(mapc