summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAchim Gratz <Stromeko@Stromeko.DE>2013-02-27 22:40:23 +0100
committerAchim Gratz <Stromeko@Stromeko.DE>2013-02-27 23:48:02 +0100
commit0fcfafe331ccc06651613a0c94f90235084f3e1d (patch)
tree20090331f0d42fa9db9aa781c3994ba8dc6c5987
parent8ac66556bbac21e19f1494fc634ecb16b87bfd62 (diff)
downloadorg-mode-0fcfafe331ccc06651613a0c94f90235084f3e1d.tar.gz
ob-core: Rename cache? to cache-p, add binding for cache-current-p
* lisp/ob-core.el (org-babel-execute-src-block): Rename cache? to cache-p, add binding for cache-current-p and use it.
-rw-r--r--lisp/ob-core.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index 3278bf9..48fb0b4 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -531,11 +531,12 @@ block."
(org-babel-process-params
(org-babel-merge-params (nth 2 info) params))
(nth 2 info)))
- (cache? (and (not arg) (cdr (assoc :cache params))
+ (cache-p (and (not arg) (cdr (assoc :cache params))
(string= "yes" (cdr (assoc :cache params)))))
(result-params (cdr (assoc :result-params params)))
- (new-hash (when cache? (org-babel-sha1-hash info)))
- (old-hash (when cache? (org-babel-current-result-hash)))
+ (new-hash (when cache-p (org-babel-sha1-hash info)))
+ (old-hash (when cache-p (org-babel-current-result-hash)))
+ (cache-current-p (and (not arg) new-hash (equal new-hash old-hash)))
(body (setf (nth 1 info)
(if (org-babel-noweb-p params :eval)
(org-babel-expand-noweb-references info)
@@ -562,7 +563,7 @@ block."
(funcall lang-check (symbol-name
(cdr (assoc lang org-src-lang-modes))))
(error "No org-babel-execute function for %s!" lang))))
- (if (and (not arg) new-hash (equal new-hash old-hash))
+ (if cache-current-p
(save-excursion ;; return cached result
(goto-char (org-babel-where-is-src-block-result nil info))
(end-of-line 1) (forward-char 1)