Browse Source

Remove last `org-babel-get-header' calls

* contrib/lisp/ob-fomus.el (org-babel-expand-body:fomus):
* contrib/lisp/ob-julia.el (org-babel-variable-assignments:julia):
* contrib/lisp/ob-mathematica.el (org-babel-expand-body:mathematica):
* contrib/lisp/ob-mathomatic.el (org-babel-mathomatic-expand):
* contrib/lisp/ob-oz.el (org-babel-expand-body:oz):
* contrib/lisp/ob-stata.el (org-babel-variable-assignments:stata):
* contrib/lisp/ob-tcl.el (org-babel-variable-assignments:tcl): Use
  `org-babel--get-vars' instead of removed `org-babel-get-header'.
Nicolas Goaziou 3 years ago
parent
commit
e69e18dd71

+ 1 - 1
contrib/lisp/ob-fomus.el

@@ -48,7 +48,7 @@
 
 (defun org-babel-expand-body:fomus (body params)
   "Expand BODY according to PARAMS, return the expanded body."
-  (let ((vars (mapcar #'cdr (org-babel-get-header params :var))))
+  (let ((vars (org-babel--get-vars params)))
     (mapc
      (lambda (pair)
        (let ((name (symbol-name (car pair)))

+ 1 - 1
contrib/lisp/ob-julia.el

@@ -124,7 +124,7 @@ This function is called by `org-babel-execute-src-block'."
 
 (defun org-babel-variable-assignments:julia (params)
   "Return list of julia statements assigning the block's variables."
-  (let ((vars (mapcar #'cdr (org-babel-get-header params :var))))
+  (let ((vars (org-babel--get-vars params)))
     (mapcar
      (lambda (pair)
        (org-babel-julia-assign-elisp

+ 1 - 1
contrib/lisp/ob-mathematica.el

@@ -31,7 +31,7 @@
 
 (defun org-babel-expand-body:mathematica (body params)
   "Expand BODY according to PARAMS, return the expanded body."
-  (let ((vars (mapcar #'cdr (org-babel-get-header params :var))))
+  (let ((vars (org-babel--get-vars params)))
     (concat
      (mapconcat ;; define any variables
       (lambda (pair)

+ 31 - 31
contrib/lisp/ob-mathomatic.el

@@ -49,37 +49,37 @@
 
 (defun org-babel-mathomatic-expand (body params)
   "Expand a block of Mathomatic code according to its header arguments."
-  (let ((vars (mapcar #'cdr (org-babel-get-header params :var))))
-     (mapconcat 'identity
-		(list
-		 ;; graphic output
-		 (let ((graphic-file (org-babel-mathomatic-graphical-output-file params)))
-		   (if graphic-file
-		       (cond
-			((string-match ".\.eps$" graphic-file)
-			 (format ;; Need to add command to send to file.
-			  "set plot set terminal postscript eps\\;set output %S "
-			  graphic-file))
-			((string-match ".\.ps$" graphic-file)
-			 (format ;; Need to add command to send to file.
-			  "set plot set terminal postscript\\;set output %S "
-			  graphic-file))
-
-			((string-match ".\.pic$" graphic-file)
-			 (format ;; Need to add command to send to file.
-			  "set plot set terminal gpic\\;set output %S "
-			  graphic-file))
-			(t
-			 (format ;; Need to add command to send to file.
-			  "set plot set terminal png\\;set output %S "
-			  graphic-file)))
-		     ""))
-		 ;; variables
-		 (mapconcat 'org-babel-mathomatic-var-to-mathomatic vars "\n")
-		 ;; body
-		 body
-		 "")
-		"\n")))
+  (let ((vars (org-babel--get-vars params)))
+    (mapconcat 'identity
+	       (list
+		;; graphic output
+		(let ((graphic-file (org-babel-mathomatic-graphical-output-file params)))
+		  (if graphic-file
+		      (cond
+		       ((string-match ".\.eps$" graphic-file)
+			(format ;; Need to add command to send to file.
+			 "set plot set terminal postscript eps\\;set output %S "
+			 graphic-file))
+		       ((string-match ".\.ps$" graphic-file)
+			(format ;; Need to add command to send to file.
+			 "set plot set terminal postscript\\;set output %S "
+			 graphic-file))
+
+		       ((string-match ".\.pic$" graphic-file)
+			(format ;; Need to add command to send to file.
+			 "set plot set terminal gpic\\;set output %S "
+			 graphic-file))
+		       (t
+			(format ;; Need to add command to send to file.
+			 "set plot set terminal png\\;set output %S "
+			 graphic-file)))
+		    ""))
+		;; variables
+		(mapconcat 'org-babel-mathomatic-var-to-mathomatic vars "\n")
+		;; body
+		body
+		"")
+	       "\n")))
 
 (defun org-babel-execute:mathomatic (body params)
   "Execute a block of Mathomatic entries with org-babel.  This function is

+ 1 - 1
contrib/lisp/ob-oz.el

@@ -197,7 +197,7 @@ StartOzServer.oz is located.")
     result))
 
 (defun org-babel-expand-body:oz (body params)
-  (let ((vars (mapcar #'cdr (org-babel-get-header params :var))))
+  (let ((vars (org-babel--get-vars params)))
     (if vars
 	;; prepend code to define all arguments passed to the code block
 	(let ((var-string (mapcar (lambda (pair)

+ 1 - 1
contrib/lisp/ob-stata.el

@@ -139,7 +139,7 @@ This function is called by `org-babel-execute-src-block'."
 
 (defun org-babel-variable-assignments:stata (params)
   "Return list of stata statements assigning the block's variables."
-  (let ((vars (mapcar #'cdr (org-babel-get-header params :var))))
+  (let ((vars (org-babel--get-vars params)))
     (mapcar
      (lambda (pair)
        (org-babel-stata-assign-elisp

+ 1 - 1
contrib/lisp/ob-tcl.el

@@ -71,7 +71,7 @@ This function is called by `org-babel-execute-src-block'."
      (format "set %s %s"
 	     (car pair)
 	     (org-babel-tcl-var-to-tcl (cdr pair))))
-   (mapcar #'cdr (org-babel-get-header params :var))))
+   (org-babel--get-vars params)))
 
 ;; helper functions