summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Davison <davison@stats.ox.ac.uk>2010-10-21 08:35:43 +0100
committerDan Davison <davison@stats.ox.ac.uk>2010-10-21 13:06:56 +0100
commit35b0d6b1d4a0bdaa87fb61422e8c04692b3ec6cb (patch)
tree82e0c2aefe5153cdecb7b3f2f461b959a65afce2
parent91f8cfaebb7819840efcb0be5bdf16a3ff47c085 (diff)
downloadorg-mode-35b0d6b1d4a0bdaa87fb61422e8c04692b3ec6cb.tar.gz
babel: Fix bug in `org-babel-tangle-collect-blocks'
* ob-tangle.el (org-babel-tangle-collect-blocks): Fix bug (reference to unassigned variable `src-lang' and avoid calling org-babel-get-src-block-info twice
-rw-r--r--lisp/ob-tangle.el7
1 files changed, 3 insertions, 4 deletions
diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el
index e53b794..07c8aad 100644
--- a/lisp/ob-tangle.el
+++ b/lisp/ob-tangle.el
@@ -282,11 +282,11 @@ code blocks by language."
(let* ((start-line (save-restriction (widen)
(+ 1 (line-number-at-pos (point)))))
(file (buffer-file-name))
- (info (org-babel-get-src-block-info 'light)))
+ (info (org-babel-get-src-block-info 'light))
+ (src-lang (nth 0 info)))
(unless (string= (cdr (assoc :tangle (nth 2 info))) "no")
(unless (and language (not (string= language src-lang)))
- (let* ((info (org-babel-get-src-block-info 'light))
- (params (nth 2 info))
+ (let* ((params (nth 2 info))
(link (unless (string= (cdr (assoc :tangle params)) "no")
(progn (call-interactively 'org-store-link)
(org-babel-clean-text-properties
@@ -295,7 +295,6 @@ code blocks by language."
(intern (or (nth 4 info)
(format "%s:%d"
current-heading block-counter))))
- (src-lang (nth 0 info))
(expand-cmd
(intern (concat "org-babel-expand-body:" src-lang)))
(assignments-cmd