From a7d89a81d0197dde7249a510ad51c999fffd4e24 Mon Sep 17 00:00:00 2001 From: Aaron Ecay Date: Thu, 29 Oct 2015 19:34:10 +0000 Subject: [PATCH] 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 `---- --- lisp/ob-core.el | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lisp/ob-core.el b/lisp/ob-core.el index b403128..ff4c0de 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -641,13 +641,12 @@ block." (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))) + (setf (nth 2 info) merged-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 +660,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) -- 2.6.2