summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Ecay <aaronecay@gmail.com>2015-10-29 19:34:10 +0000
committerAaron Ecay <aaronecay@gmail.com>2015-11-05 15:03:58 +0000
commit4750e4427d93e4e450d6df8e89792cd34e534be4 (patch)
tree6bab33aac840768696837b32d2a14ffebcd26ba2
parente47c7c3ed624139d0982d1f408824be314a3c143 (diff)
downloadorg-mode-4750e4427d93e4e450d6df8e89792cd34e534be4.tar.gz
babel: small fix.
* lisp/ob-core.el (org-babel-execute-src-block): Simplify code slightly. The old code would error on evaluating the call line in: ,---- | #+name: foo | #+begin_src emacs-lisp :var bar="baz" | bar | #+end_src | | #+call: foo[:cache yes]("qux") | | #+RESULTS: | : qux `----
-rw-r--r--lisp/ob-core.el17
1 files changed, 7 insertions, 10 deletions
diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index 748df1f..9d3d3e7 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -639,15 +639,13 @@ block."
(match-beginning 0))))
(info (if info
(copy-tree info)
- (org-babel-get-src-block-info)))
- (merged-params (org-babel-merge-params (nth 2 info) params)))
- (when (org-babel-check-evaluate
- (let ((i info)) (setf (nth 2 i) merged-params) i))
- (let* ((params (if params
- (org-babel-process-params merged-params)
- (nth 2 info)))
+ (org-babel-get-src-block-info))))
+ (cl-callf org-babel-merge-params (nth 2 info) params)
+ (when (org-babel-check-evaluate info)
+ (cl-callf org-babel-process-params (nth 2 info))
+ (let* ((params (nth 2 info))
(cachep (and (not arg) (cdr (assoc :cache params))
- (string= "yes" (cdr (assoc :cache params)))))
+ (string= "yes" (cdr (assoc :cache params)))))
(new-hash (when cachep (org-babel-sha1-hash info)))
(old-hash (when cachep (org-babel-current-result-hash)))
(cache-current-p (and (not arg) new-hash
@@ -661,8 +659,7 @@ block."
(let ((result (org-babel-read-result)))
(message (replace-regexp-in-string
"%" "%%" (format "%S" result))) result)))
- ((org-babel-confirm-evaluate
- (let ((i info)) (setf (nth 2 i) merged-params) i))
+ ((org-babel-confirm-evaluate info)
(let* ((lang (nth 0 info))
(result-params (cdr (assoc :result-params params)))
(body (setf (nth 1 info)