summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSami Airaksinen <samiaira@gmail.com>2015-01-29 23:10:02 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2015-02-01 00:02:21 +0100
commitc90925be29a52122cfe04c7b293432106a4981da (patch)
tree8e9efabcb219d7737424b6aba4dcc15a8ab533fe
parentb4b16c61654c2eecd1b5f019601069eb010f267e (diff)
downloadorg-mode-c90925be29a52122cfe04c7b293432106a4981da.tar.gz
org.el: org-babel-load-file loads first tangle file
(org-babel-load-file): When org-mode FILE has multiple target files for tangle blocks, `exported-file' will be set to last found target file, which might not be the `file'. Therefore fix for this bug is to select the last element of that tangled file list, which is the tangle target file of the first found tangle block, most typically the `file'. TINYCHANGE
-rwxr-xr-xlisp/org.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 9a86ee1..e59725b 100755
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -235,8 +235,10 @@ file to byte-code before it is loaded."
;; tangle if the org-mode file is newer than the elisp file
(unless (and (file-exists-p exported-file)
(> (funcall age file) (funcall age exported-file)))
+ ;; Tangle-file traversal returns reversed list of tangled files
+ ;; and we want to evaluate the first target.
(setq exported-file
- (car (org-babel-tangle-file file exported-file "emacs-lisp"))))
+ (car (last (org-babel-tangle-file file exported-file "emacs-lisp")))))
(message "%s %s"
(if compile
(progn (byte-compile-file exported-file 'load)