Przeglądaj źródła

ob-core: add binding for merged-params to avoid multiple evaluation

* lisp/ob-core.el (org-babel-execute-src-block): Add binding for
  merged-params to avoid multiple evaluation of
  `org-babel-merge-params´.
Achim Gratz 13 lat temu
rodzic
commit
302d3780ec
1 zmienionych plików z 4 dodań i 6 usunięć
  1. 4 6
      lisp/ob-core.el

+ 4 - 6
lisp/ob-core.el

@@ -521,15 +521,13 @@ Optionally supply a value for PARAMS which will be merged with
 the header arguments specified at the front of the source code
 the header arguments specified at the front of the source code
 block."
 block."
   (interactive)
   (interactive)
-  (let ((info (or info (org-babel-get-src-block-info))))
+  (let* ((info (or info (org-babel-get-src-block-info)))
+	 (merged-params (org-babel-merge-params (nth 2 info) params)))
     (when (org-babel-confirm-evaluate
     (when (org-babel-confirm-evaluate
-	   (let ((i info))
-	     (setf (nth 2 i) (org-babel-merge-params (nth 2 info) params))
-	     i))
+	   (let ((i info)) (setf (nth 2 i) merged-params) i))
       (let* ((lang (nth 0 info))
       (let* ((lang (nth 0 info))
 	     (params (if params
 	     (params (if params
-			 (org-babel-process-params
-			  (org-babel-merge-params (nth 2 info) params))
+			 (org-babel-process-params merged-params)
 		       (nth 2 info)))
 		       (nth 2 info)))
 	     (cache-p (and (not arg) (cdr (assoc :cache params))
 	     (cache-p (and (not arg) (cdr (assoc :cache params))
 			  (string= "yes" (cdr (assoc :cache params)))))
 			  (string= "yes" (cdr (assoc :cache params)))))