summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Schulte <schulte.eric@gmail.com>2014-01-18 13:14:25 -0700
committerEric Schulte <schulte.eric@gmail.com>2014-01-18 13:40:57 -0700
commit6c0992939d15ba4c2b9ec53428eeb33d415b510a (patch)
tree3ed77b66349a9a967515dd5f9117385dd46ea4b9
parent80754a8591058d8fc8f18e73e1f11ec799919234 (diff)
downloadorg-mode-6c0992939d15ba4c2b9ec53428eeb33d415b510a.tar.gz
do not eval vars in call lines before hashing
* lisp/ob-lob.el (org-babel-lob-execute): Do not eval vars in call lines before hashing, because for a call lines variable expansion *is* evaluation.
-rw-r--r--lisp/ob-lob.el13
1 files changed, 12 insertions, 1 deletions
diff --git a/lisp/ob-lob.el b/lisp/ob-lob.el
index 36dcfe9..d08dbf2 100644
--- a/lisp/ob-lob.el
+++ b/lisp/ob-lob.el
@@ -142,7 +142,18 @@ if so then run the appropriate source block from the Library."
(pre-info (funcall mkinfo pre-params))
(cache-p (and (cdr (assoc :cache pre-params))
(string= "yes" (cdr (assoc :cache pre-params)))))
- (new-hash (when cache-p (org-babel-sha1-hash pre-info)))
+ (new-hash (when cache-p
+ (org-babel-sha1-hash
+ ;; Do *not* pre-process params for call line
+ ;; hash evaluation, since for a call line :var
+ ;; extension *is* execution.
+ (let ((params (nth 2 pre-info)))
+ (append (subseq pre-info 0 2)
+ (list
+ (cons
+ (cons :c-var (cdr (assoc :var params)))
+ (assq-delete-all :var (copy-tree params))))
+ (subseq pre-info 3))))))
(old-hash (when cache-p (org-babel-current-result-hash)))
(org-babel-current-src-block-location (point-marker)))
(if (and cache-p (equal new-hash old-hash))