From 6c0992939d15ba4c2b9ec53428eeb33d415b510a Mon Sep 17 00:00:00 2001 From: Eric Schulte Date: Sat, 18 Jan 2014 13:14:25 -0700 Subject: [PATCH] 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. --- lisp/ob-lob.el | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lisp/ob-lob.el b/lisp/ob-lob.el index 36dcfe91c..d08dbf2bb 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))