* lisp/ob-core.el (org-babel-execute-src-block): Simplify control flow Avoid potential duplication of org-babel-process-params call. Also makes the code simpler. --- lisp/ob-core.el | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/lisp/ob-core.el b/lisp/ob-core.el index c69b736..d8c11ee 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -557,13 +557,11 @@ Optionally supply a value for PARAMS which will be merged with the header arguments specified at the front of the source code block." (interactive) - (let* ((info (or 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))) + (let* ((info (or info (org-babel-get-src-block-info 'light)))) + (setf (nth 2 info) (org-babel-merge-params (nth 2 info) params)) + (when (org-babel-check-evaluate info) + (setf (nth 2 info) (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))))) (new-hash (when cachep (org-babel-sha1-hash info))) @@ -578,8 +576,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) -- 1.8.2