Browse Source

removing obsoleted optional third argument from org-babel-expand-body:LANG

* lisp/ob-C.el (org-babel-expand-body:c++): removing obsoleted
  optional third argument
  (org-babel-expand-body:c++): removing obsoleted optional third
  argument
  (org-babel-C-expand): removing obsoleted optional third argument
* lisp/ob-R.el:
  (org-babel-expand-body:R): removing obsoleted optional third
  argument
  (org-babel-execute:R): removing obsoleted optional third argument
  (org-babel-R-variable-assignments): removing obsoleted optional
  third argument
* lisp/ob-asymptote.el:
  (org-babel-expand-body:asymptote): removing obsoleted optional third
  argument
  (org-babel-execute:asymptote): removing obsoleted optional third
  argument
* lisp/ob-clojure.el:
  (org-babel-expand-body:clojure): removing obsoleted optional third
  argument
  (org-babel-execute:clojure): removing obsoleted optional third
  argument
* lisp/ob-css.el:
  (org-babel-expand-body:css): removing obsoleted optional third
  argument
* lisp/ob-ditaa.el:
  (org-babel-expand-body:ditaa): removing obsoleted optional third
  argument
* lisp/ob-dot.el:
  (org-babel-expand-body:dot): removing obsoleted optional third
  argument
  (org-babel-execute:dot): removing obsoleted optional third argument
* lisp/ob-emacs-lisp.el:
  (org-babel-expand-body:emacs-lisp): removing obsoleted optional
  third argument
  (org-babel-execute:emacs-lisp): removing obsoleted optional third
  argument
* lisp/ob-gnuplot.el:
  (org-babel-expand-body:gnuplot): removing obsoleted optional third
  argument
* lisp/ob-haskell.el:
  (org-babel-expand-body:haskell): removing obsoleted optional third
  argument
  (org-babel-execute:haskell): removing obsoleted optional third
  argument
  (org-babel-load-session:haskell): removing obsoleted optional third
  (org-babel-prep-session:haskell): removing obsoleted optional third
* lisp/ob-js.el:
  (org-babel-expand-body:js): removing obsoleted optional third
  argument
  (org-babel-execute:js): removing obsoleted optional third argument
* lisp/ob-latex.el:
  (org-babel-expand-body:latex): removing obsoleted optional third
  argument
* lisp/ob-lisp.el:
  (org-babel-expand-body:lisp): removing obsoleted optional third
  argument
  (org-babel-execute:lisp): removing obsoleted optional third argument
* lisp/ob-mscgen.el:
  (org-babel-expand-body:mscgen): removing obsoleted optional third
  argument
* lisp/ob-ocaml.el:
  (org-babel-expand-body:ocaml): removing obsoleted optional third
  argument
  (org-babel-execute:ocaml): removing obsoleted optional third
  argument
* lisp/ob-octave.el:
  (org-babel-expand-body:matlab): removing obsoleted optional third
  argument
  (org-babel-expand-body:octave): removing obsoleted optional third
  argument
  (org-babel-execute:octave): removing obsoleted optional third
  argument
  (org-babel-octave-variable-assignments): removing obsoleted optional
  third
* lisp/ob-org.el:
  (org-babel-expand-body:org): removing obsoleted optional third
  argument
* lisp/ob-perl.el:
  (org-babel-expand-body:perl): removing obsoleted optional third
  argument
  (org-babel-execute:perl): removing obsoleted optional third argument
* lisp/ob-plantuml.el:
  (org-babel-expand-body:plantuml): removing obsoleted optional third
  argument
* lisp/ob-python.el:
  (org-babel-expand-body:python): removing obsoleted optional third
  argument
  (org-babel-execute:python): removing obsoleted optional third
  argument
  (org-babel-python-variable-assignments): removing obsoleted optional
  third
* lisp/ob-ruby.el:
  (org-babel-expand-body:ruby): removing obsoleted optional third
  argument
  (org-babel-execute:ruby): removing obsoleted optional third argument
* lisp/ob-sass.el:
  (org-babel-expand-body:sass): removing obsoleted optional third
  argument
* lisp/ob-scheme.el:
  (org-babel-expand-body:scheme): removing obsoleted optional third
  argument
  (org-babel-execute:scheme): removing obsoleted optional third
  argument
* lisp/ob-screen.el:
  (org-babel-expand-body:screen): removing obsoleted optional third
  argument
* lisp/ob-sh.el:
  (org-babel-expand-body:sh): removing obsoleted optional third
  argument
  (org-babel-execute:sh): removing obsoleted optional third argument
  (org-babel-sh-variable-assignments): removing obsoleted optional
  third
* lisp/ob-sql.el:
  (org-babel-expand-body:sql): removing obsoleted optional third
  argument
* lisp/ob-sqlite.el:
  (org-babel-expand-body:sqlite): removing obsoleted optional third
  argument
  (org-babel-execute:sqlite): removing obsoleted optional third
  argument
* lisp/ob.el:
  (org-babel-expand-body:generic): removing obsoleted optional third
  argument
Eric Schulte 9 years ago
parent
commit
2ddcf9e255

+ 6 - 7
lisp/ob-C.el

@@ -64,20 +64,20 @@ is currently being evaluated.")
 called by `org-babel-execute-src-block'."
   (let ((org-babel-c-variant 'cpp)) (org-babel-C-execute body params)))
 
-(defun org-babel-expand-body:c++ (body params &optional processed-params)
+(defun org-babel-expand-body:c++ (body params)
   "Expand a block of C++ code with org-babel according to it's
 header arguments (calls `org-babel-C-expand')."
-  (let ((org-babel-c-variant 'cpp)) (org-babel-C-expand body params processed-params)))
+  (let ((org-babel-c-variant 'cpp)) (org-babel-C-expand body params)))
 
 (defun org-babel-execute:C (body params)
   "Execute a block of C code with org-babel.  This function is
 called by `org-babel-execute-src-block'."
   (let ((org-babel-c-variant 'c)) (org-babel-C-execute body params)))
 
-(defun org-babel-expand-body:c (body params &optional processed-params)
+(defun org-babel-expand-body:c (body params)
   "Expand a block of C code with org-babel according to it's
 header arguments (calls `org-babel-C-expand')."
-  (let ((org-babel-c-variant 'c)) (org-babel-C-expand body params processed-params)))
+  (let ((org-babel-c-variant 'c)) (org-babel-C-expand body params)))
 
 (defun org-babel-C-execute (body params)
   "This function should only be called by `org-babel-execute:C'
@@ -119,11 +119,10 @@ or `org-babel-execute:c++'."
        (org-babel-eval
 	(concat tmp-bin-file (if cmdline (concat " " cmdline) "")) "")))))
 
-(defun org-babel-C-expand (body params &optional processed-params)
+(defun org-babel-C-expand (body params)
   "Expand a block of C or C++ code with org-babel according to
 it's header arguments."
-  (let ((vars (nth 1 (or processed-params
-                          (org-babel-process-params params))))
+  (let ((vars (mapcar #'cdr (org-babel-get-header params :var)))
         (main-p (not (string= (cdr (assoc :main params)) "no")))
         (includes (or (cdr (assoc :includes params))
                       (org-babel-read (org-entry-get nil "includes" t))))

+ 4 - 5
lisp/ob-R.el

@@ -51,7 +51,7 @@
 (defvar org-babel-R-command "R --slave --no-save"
   "Name of command to use for executing R code.")
 
-(defun org-babel-expand-body:R (body params &optional processed-params)
+(defun org-babel-expand-body:R (body params)
   "Expand BODY according to PARAMS, return the expanded body."
   (let (out-file (cdr (assoc :file params)))
     (mapconcat
@@ -76,7 +76,7 @@ This function is called by `org-babel-execute-src-block'."
 	   (colnames-p (cdr (assoc :colnames params)))
 	   (rownames-p (cdr (assoc :rownames params)))
 	   (out-file (cdr (assoc :file params)))
-	   (full-body (org-babel-expand-body:R body params processed-params))
+	   (full-body (org-babel-expand-body:R body params))
 	   (result
 	    (org-babel-R-evaluate
 	     session full-body result-type
@@ -108,10 +108,9 @@ This function is called by `org-babel-execute-src-block'."
 
 ;; helper functions
 
-(defun org-babel-R-variable-assignments (params &optional processed-params)
+(defun org-babel-R-variable-assignments (params)
   "Return list of R statements assigning the block's variables"
-  (let ((processed-params (or processed-params
-			      (org-babel-process-params params))))
+  (let ((processed-params (org-babel-process-params params)))
     (mapcar
      (lambda (pair)
        (org-babel-R-assign-elisp

+ 3 - 4
lisp/ob-asymptote.el

@@ -55,10 +55,9 @@
   '((:results . "file") (:exports . "results"))
   "Default arguments when evaluating an Asymptote source block.")
 
-(defun org-babel-expand-body:asymptote (body params &optional processed-params)
+(defun org-babel-expand-body:asymptote (body params)
   "Expand BODY according to PARAMS, return the expanded body."
-  (let ((vars (nth 1 (or processed-params
-                          (org-babel-process-params params)))))
+  (let ((vars (mapcar #'cdr (org-babel-get-header params :var))))
     (concat (mapconcat 'org-babel-asymptote-var-to-asymptote vars "\n")
 	    "\n" body "\n")))
 
@@ -84,7 +83,7 @@ This function is called by `org-babel-execute-src-block'."
 		  " " cmdline
 		  " " (org-babel-process-file-name in-file))))
     (with-temp-file in-file
-      (insert (org-babel-expand-body:asymptote body params processed-params)))
+      (insert (org-babel-expand-body:asymptote body params)))
     (message cmd) (shell-command cmd)
     out-file))
 

+ 3 - 3
lisp/ob-clojure.el

@@ -293,16 +293,16 @@ return the value of the last statement in BODY as elisp."
       (org-babel-clojure-evaluate-session buffer body result-type)
     (org-babel-clojure-evaluate-external-process buffer body result-type)))
 
-(defun org-babel-expand-body:clojure (body params &optional processed-params)
+(defun org-babel-expand-body:clojure (body params)
   "Expand BODY according to PARAMS, return the expanded body."
   (org-babel-clojure-build-full-form
-   body (nth 1 (or processed-params (org-babel-process-params params)))))
+   body (mapcar #'cdr (org-babel-get-header params :var))))
 
 (defun org-babel-execute:clojure (body params)
   "Execute a block of Clojure code."
   (require 'slime) (require 'swank-clojure)
   (let* ((processed-params (org-babel-process-params params))
-         (body (org-babel-expand-body:clojure body params processed-params))
+         (body (org-babel-expand-body:clojure body params))
          (session (org-babel-clojure-initiate-session
 		   (first processed-params))))
     (org-babel-reassemble-table

+ 1 - 1
lisp/ob-css.el

@@ -32,7 +32,7 @@
 
 (defvar org-babel-default-header-args:css '())
 
-(defun org-babel-expand-body:css (body params &optional processed-params)
+(defun org-babel-expand-body:css (body params)
   "Expand BODY according to PARAMS, return the expanded body." body)
 
 (defun org-babel-execute:css (body params)

+ 1 - 1
lisp/ob-ditaa.el

@@ -43,7 +43,7 @@
   '((:results . "file") (:exports . "results"))
   "Default arguments for evaluating a ditaa source block.")
 
-(defun org-babel-expand-body:ditaa (body params &optional processed-params)
+(defun org-babel-expand-body:ditaa (body params)
   "Expand BODY according to PARAMS, return the expanded body." body)
 
 (defvar org-ditaa-jar-path)

+ 3 - 4
lisp/ob-dot.el

@@ -46,10 +46,9 @@
   '((:results . "file") (:exports . "results"))
   "Default arguments to use when evaluating a dot source block.")
 
-(defun org-babel-expand-body:dot (body params &optional processed-params)
+(defun org-babel-expand-body:dot (body params)
   "Expand BODY according to PARAMS, return the expanded body."
-  (let ((vars (nth 1 (or processed-params
-			 (org-babel-process-params params)))))
+  (let ((vars (mapcar #'cdr (org-babel-get-header params :var))))
     (mapc
      (lambda (pair)
        (let ((name (symbol-name (car pair)))
@@ -73,7 +72,7 @@ This function is called by `org-babel-execute-src-block'."
 	 (cmd (or (cdr (assoc :cmd params)) "dot"))
 	 (in-file (org-babel-temp-file "dot-")))
     (with-temp-file in-file
-      (insert (org-babel-expand-body:dot body params processed-params)))
+      (insert (org-babel-expand-body:dot body params)))
     (org-babel-eval
      (concat cmd
 	     " " (org-babel-process-file-name in-file)

+ 3 - 5
lisp/ob-emacs-lisp.el

@@ -36,10 +36,9 @@
 
 (declare-function orgtbl-to-generic "org-table" (table params))
 
-(defun org-babel-expand-body:emacs-lisp (body params &optional processed-params)
+(defun org-babel-expand-body:emacs-lisp (body params)
   "Expand BODY according to PARAMS, return the expanded body."
-  (let* ((processed-params (or processed-params
-			       (org-babel-process-params params)))
+  (let* ((processed-params (org-babel-process-params params))
          (vars (nth 1 processed-params))
          (result-params (nth 2 processed-params))
          (print-level nil) (print-length nil)
@@ -61,8 +60,7 @@
     (let ((processed-params (org-babel-process-params params)))
       (org-babel-reassemble-table
        (eval (read (format "(progn %s)"
-			   (org-babel-expand-body:emacs-lisp
-			    body params processed-params))))
+			   (org-babel-expand-body:emacs-lisp body params))))
        (org-babel-pick-name (nth 4 processed-params)
 			    (cdr (assoc :colnames params)))
        (org-babel-pick-name (nth 5 processed-params)

+ 1 - 1
lisp/ob-gnuplot.el

@@ -72,7 +72,7 @@ code."
         (cdr pair))))
    (mapcar #'cdr (org-babel-get-header params :var))))
 
-(defun org-babel-expand-body:gnuplot (body params &optional processed-params)
+(defun org-babel-expand-body:gnuplot (body params)
   "Expand BODY according to PARAMS, return the expanded body."
   (save-window-excursion
     (let* ((vars (org-babel-gnuplot-process-vars params))

+ 11 - 12
lisp/ob-haskell.el

@@ -59,9 +59,9 @@
 
 (defvar org-babel-haskell-eoe "\"org-babel-haskell-eoe\"")
 
-(defun org-babel-expand-body:haskell (body params &optional processed-params)
+(defun org-babel-expand-body:haskell (body params)
   "Expand BODY according to PARAMS, return the expanded body."
-  (let ((vars (nth 1 (or processed-params (org-babel-process-params params)))))
+  (let ((vars (mapcar #'cdr (org-babel-get-header params :var))))
     (concat
      (mapconcat
       (lambda (pair) (format "let %s = %s"
@@ -75,7 +75,7 @@
          (session (nth 0 processed-params))
          (vars (nth 1 processed-params))
          (result-type (nth 3 processed-params))
-         (full-body (org-babel-expand-body:haskell body params processed-params))
+         (full-body (org-babel-expand-body:haskell body params))
          (session (org-babel-haskell-initiate-session session params))
          (raw (org-babel-comint-with-output
 		  (session org-babel-haskell-eoe t full-body)
@@ -93,8 +93,10 @@
        (mapconcat #'identity (reverse (cdr results)) "\n"))
       ((equal result-type 'value)
        (org-babel-haskell-table-or-string (car results))))
-     (org-babel-pick-name (nth 4 processed-params) (cdr (assoc :colnames params)))
-     (org-babel-pick-name (nth 5 processed-params) (cdr (assoc :rownames params))))))
+     (org-babel-pick-name (nth 4 processed-params)
+			  (cdr (assoc :colnames params)))
+     (org-babel-pick-name (nth 5 processed-params)
+			  (cdr (assoc :rownames params))))))
 
 (defun org-babel-haskell-read-string (string)
   "Strip \\\"s from around a haskell string."
@@ -110,23 +112,20 @@ then create one.  Return the initialized session."
   (or (get-buffer "*haskell*")
       (save-window-excursion (run-haskell) (sleep-for 0.25) (current-buffer))))
 
-(defun org-babel-load-session:haskell
-  (session body params &optional processed-params)
+(defun org-babel-load-session:haskell (session body params)
   "Load BODY into SESSION."
   (save-window-excursion
-    (let* ((buffer (org-babel-prep-session:haskell
-		    session params processed-params))
+    (let* ((buffer (org-babel-prep-session:haskell session params))
            (load-file (concat (org-babel-temp-file "haskell-load-") ".hs")))
       (with-temp-buffer
         (insert body) (write-file load-file)
         (haskell-mode) (inferior-haskell-load-file))
       buffer)))
 
-(defun org-babel-prep-session:haskell
-  (session params &optional processed-params)
+(defun org-babel-prep-session:haskell (session params)
   "Prepare SESSION according to the header arguments in PARAMS."
   (save-window-excursion
-    (let ((pp (or processed-params (org-babel-process-params params)))
+    (let ((pp (org-babel-process-params params))
 	  (buffer (org-babel-haskell-initiate-session session)))
       (org-babel-comint-in-buffer buffer
       	(mapc

+ 3 - 3
lisp/ob-js.el

@@ -64,9 +64,9 @@
   "require('sys').print(require('sys').inspect(function(){%s}()));"
   "Javascript code to print value of body.")
 
-(defun org-babel-expand-body:js (body params &optional processed-params)
+(defun org-babel-expand-body:js (body params)
   "Expand BODY according to PARAMS, return the expanded body."
-  (let ((vars (nth 1 (or processed-params (org-babel-process-params params)))))
+  (let ((vars (mapcar #'cdr (org-babel-get-header params :var))))
     (concat
      (mapconcat ;; define any variables
       (lambda (pair) (format "var %s=%s;"
@@ -79,7 +79,7 @@ This function is called by `org-babel-execute-src-block'"
   (let* ((processed-params (org-babel-process-params params))
 	 (org-babel-js-cmd (or (cdr (assoc :cmd params)) org-babel-js-cmd))
          (result-type (nth 3 processed-params))
-         (full-body (org-babel-expand-body:js body params processed-params)))
+         (full-body (org-babel-expand-body:js body params)))
     (org-babel-js-read
      (if (not (string= (nth 0 processed-params) "none"))
 	 ;; session evaluation

+ 2 - 2
lisp/ob-latex.el

@@ -53,7 +53,7 @@
   '((:results . "latex") (:exports . "results"))
   "Default arguments to use when evaluating a LaTeX source block.")
 
-(defun org-babel-expand-body:latex (body params &optional processed-params)
+(defun org-babel-expand-body:latex (body params)
   "Expand BODY according to PARAMS, return the expanded body."
   (mapc (lambda (pair) ;; replace variables
           (setq body
@@ -61,7 +61,7 @@
                  (regexp-quote (format "%S" (car pair)))
                  (if (stringp (cdr pair))
                      (cdr pair) (format "%S" (cdr pair)))
-                 body))) (nth 1 (org-babel-process-params params)))
+                 body))) (mapcar #'cdr (org-babel-get-header params :var)))
   (org-babel-trim body))
 
 (defun org-babel-execute:latex (body params)

+ 3 - 3
lisp/ob-lisp.el

@@ -49,9 +49,9 @@
 (defcustom org-babel-lisp-cmd "sbcl --script"
   "Name of command used to evaluate lisp blocks.")
 
-(defun org-babel-expand-body:lisp (body params &optional processed-params)
+(defun org-babel-expand-body:lisp (body params)
   "Expand BODY according to PARAMS, return the expanded body."
-  (let ((vars (nth 1 (or processed-params (org-babel-process-params params)))))
+  (let ((vars (mapcar #'cdr (org-babel-get-header params :var))))
     (if (> (length vars) 0)
         (concat "(let ("
                 (mapconcat
@@ -67,7 +67,7 @@ This function is called by `org-babel-execute-src-block'"
   (let* ((processed-params (org-babel-process-params params))
          (session (org-babel-lisp-initiate-session (first processed-params)))
          (result-type (fourth processed-params))
-         (full-body (org-babel-expand-body:lisp body params processed-params)))
+         (full-body (org-babel-expand-body:lisp body params)))
     (read
      (if session
          ;; session evaluation

+ 1 - 1
lisp/ob-mscgen.el

@@ -62,7 +62,7 @@
   '((:results . "file") (:exports . "results"))
   "Default arguments to use when evaluating a mscgen source block.")
 
-(defun org-babel-expand-body:mscgen (body params &optional processed-params)
+(defun org-babel-expand-body:mscgen (body params)
   "Expand BODY according to PARAMS, return the expanded body." body)
 
 (defun org-babel-execute:mscgen (body params)

+ 7 - 8
lisp/ob-ocaml.el

@@ -51,20 +51,19 @@
 (defvar org-babel-ocaml-eoe-indicator "\"org-babel-ocaml-eoe\";;")
 (defvar org-babel-ocaml-eoe-output "org-babel-ocaml-eoe")
 
-(defun org-babel-expand-body:ocaml (body params &optional processed-params)
+(defun org-babel-expand-body:ocaml (body params)
   "Expand BODY according to PARAMS, return the expanded body."
-  (let ((vars (nth 1 (or processed-params (org-babel-process-params params)))))
-    (concat
-     (mapconcat
-      (lambda (pair) (format "let %s = %s;;" (car pair)
-			(org-babel-ocaml-elisp-to-ocaml (cdr pair))))
-      vars "\n") "\n" body "\n")))
+  (let ((vars (nth 1 (org-babel-process-params params))))
+    (concat (mapconcat
+	     (lambda (pair) (format "let %s = %s;;" (car pair)
+			       (org-babel-ocaml-elisp-to-ocaml (cdr pair))))
+	     vars "\n") "\n" body "\n")))
 
 (defun org-babel-execute:ocaml (body params)
   "Execute a block of Ocaml code with Babel."
   (let* ((processed-params (org-babel-process-params params))
          (vars (nth 1 processed-params))
-         (full-body (org-babel-expand-body:ocaml body params processed-params))
+         (full-body (org-babel-expand-body:ocaml body params))
          (session (org-babel-prep-session:ocaml
 		   (cdr (assoc :session params)) params))
          (raw (org-babel-comint-with-output

+ 7 - 8
lisp/ob-octave.el

@@ -47,14 +47,14 @@
 (defvar org-babel-octave-shell-command "octave -q"
   "Shell command to run octave as an external process.")
 
-(defun org-babel-expand-body:matlab (body params &optional processed-params)
+(defun org-babel-expand-body:matlab (body params)
   "Expand BODY according to PARAMS, return the expanded body."
-  (org-babel-expand-body:octave body params processed-params))
-(defun org-babel-expand-body:octave (body params &optional processed-params)
+  (org-babel-expand-body:octave body params))
+(defun org-babel-expand-body:octave (body params)
   "Expand BODY according to PARAMS, return the expanded body."
   (mapconcat
    #'identity
-   (append (org-babel-octave-variable-assignments params processed-params)
+   (append (org-babel-octave-variable-assignments params)
 	   (list body)) "\n"))
 
 (defvar org-babel-matlab-with-emacs-link nil
@@ -94,8 +94,7 @@ end")
          (result-params (nth 2 processed-params))
          (result-type (nth 3 processed-params))
 	 (out-file (cdr (assoc :file params)))
-	 (augmented-body
-	  (org-babel-expand-body:octave body params processed-params))
+	 (augmented-body (org-babel-expand-body:octave body params))
 	 (result (org-babel-octave-evaluate
 		  session augmented-body result-type matlabp)))
     (or out-file
@@ -110,14 +109,14 @@ end")
   "Prepare SESSION according to PARAMS."
   (org-babel-prep-session:octave session params 'matlab))
 
-(defun org-babel-octave-variable-assignments (params &optional processed-params)
+(defun org-babel-octave-variable-assignments (params)
   "Return list of octave statements assigning the block's variables"
   (mapcar
    (lambda (pair)
      (format "%s=%s"
 	     (car pair)
 	     (org-babel-octave-var-to-octave (cdr pair))))
-   (nth 1 (or processed-params (org-babel-process-params params)))))
+   (mapcar #'cdr (org-babel-get-header params :var))))
 
 (defun org-babel-octave-var-to-octave (var)
   "Convert an emacs-lisp value into an octave variable.

+ 1 - 1
lisp/ob-org.el

@@ -41,7 +41,7 @@
   "#+TITLE: default empty header\n"
   "Default header inserted during export of org blocks.")
 
-(defun org-babel-expand-body:org (body params &optional processed-params)
+(defun org-babel-expand-body:org (body params)
   "Expand BODY according to PARAMS, return the expanded body." body)
 
 (defun org-babel-execute:org (body params)

+ 3 - 4
lisp/ob-perl.el

@@ -38,9 +38,9 @@
 (defvar org-babel-perl-command "perl"
   "Name of command to use for executing perl code.")
 
-(defun org-babel-expand-body:perl (body params &optional processed-params)
+(defun org-babel-expand-body:perl (body params)
   "Expand BODY according to PARAMS, return the expanded body."
-  (let ((vars (nth 1 (or processed-params (org-babel-process-params params)))))
+  (let ((vars (mapcar #'cdr (org-babel-get-header params :var))))
     (concat
      (mapconcat ;; define any variables
       (lambda (pair)
@@ -57,8 +57,7 @@ This function is called by `org-babel-execute-src-block'."
          (vars (nth 1 processed-params))
          (result-params (nth 2 processed-params))
          (result-type (nth 3 processed-params))
-         (full-body (org-babel-expand-body:perl
-                     body params processed-params))
+         (full-body (org-babel-expand-body:perl body params))
 	(session (org-babel-perl-initiate-session session)))
     (org-babel-reassemble-table
      (org-babel-perl-evaluate session full-body result-type)

+ 1 - 1
lisp/ob-plantuml.el

@@ -42,7 +42,7 @@
   '((:results . "file") (:exports . "results"))
   "Default arguments for evaluating a plantuml source block.")
 
-(defun org-babel-expand-body:plantuml (body params &optional processed-params)
+(defun org-babel-expand-body:plantuml (body params)
   "Expand BODY according to PARAMS, return the expanded body." body)
 
 (defcustom org-plantuml-jar-path nil

+ 6 - 8
lisp/ob-python.el

@@ -48,14 +48,13 @@
   "Preferred python mode for use in running python interactively.")
 
 (defvar org-src-preserve-indentation)
-(defun org-babel-expand-body:python (body params &optional processed-params)
+(defun org-babel-expand-body:python (body params)
   "Expand BODY according to PARAMS, return the expanded body."
-  (let ((var-lines
-	 (org-babel-python-variable-assignments params processed-params)))
+  (let ((var-lines (org-babel-python-variable-assignments params)))
     (mapconcat
      #'identity
      (append
-      (org-babel-python-variable-assignments params processed-params)
+      (org-babel-python-variable-assignments params)
       (list
        (org-babel-trim body (if org-src-preserve-indentation "[\f\n\r\v]"))))
      "\n")))
@@ -67,8 +66,7 @@ This function is called by `org-babel-execute-src-block'."
          (session (org-babel-python-initiate-session (first processed-params)))
          (result-params (nth 2 processed-params))
          (result-type (nth 3 processed-params))
-         (full-body (org-babel-expand-body:python
-                     body params processed-params))
+         (full-body (org-babel-expand-body:python body params))
          (result (org-babel-python-evaluate
 		  session full-body result-type result-params)))
     (or (cdr (assoc :file params))
@@ -100,14 +98,14 @@ This function is called by `org-babel-execute-src-block'."
 
 ;; helper functions
 
-(defun org-babel-python-variable-assignments (params &optional processed-params)
+(defun org-babel-python-variable-assignments (params)
   "Return list of python statements assigning the block's variables"
   (mapcar
    (lambda (pair)
      (format "%s=%s"
 	     (car pair)
 	     (org-babel-python-var-to-python (cdr pair))))
-   (nth 1 (or processed-params (org-babel-process-params params)))))
+   (mapcar #'cdr (org-babel-get-header params :var))))
 
 (defun org-babel-python-var-to-python (var)
   "Convert an elisp value to a python variable.

+ 3 - 4
lisp/ob-ruby.el

@@ -52,9 +52,9 @@
 (defvar org-babel-ruby-command "ruby"
   "Name of command to use for executing ruby code.")
 
-(defun org-babel-expand-body:ruby (body params &optional processed-params)
+(defun org-babel-expand-body:ruby (body params)
   "Expand BODY according to PARAMS, return the expanded body."
-  (let ((vars (nth 1 (or processed-params (org-babel-process-params params)))))
+  (let ((vars (mapcar #'cdr (org-babel-get-header params :var))))
     (concat
      (mapconcat ;; define any variables
       (lambda (pair)
@@ -70,8 +70,7 @@ This function is called by `org-babel-execute-src-block'."
          (session (org-babel-ruby-initiate-session (first processed-params)))
          (result-params (nth 2 processed-params))
          (result-type (nth 3 processed-params))
-         (full-body (org-babel-expand-body:ruby
-                     body params processed-params))
+         (full-body (org-babel-expand-body:ruby body params))
          (result (org-babel-ruby-evaluate
 		  session full-body result-type result-params)))
     (or (cdr (assoc :file params))

+ 1 - 1
lisp/ob-sass.el

@@ -43,7 +43,7 @@
 
 (defvar org-babel-default-header-args:sass '())
 
-(defun org-babel-expand-body:sass (body params &optional processed-params)
+(defun org-babel-expand-body:sass (body params)
   "Expand BODY according to PARAMS, return the expanded body." body)
 
 (defun org-babel-execute:sass (body params)

+ 5 - 4
lisp/ob-scheme.el

@@ -59,9 +59,9 @@
   :group 'org-babel
   :type 'string)
 
-(defun org-babel-expand-body:scheme (body params &optional processed-params)
+(defun org-babel-expand-body:scheme (body params)
   "Expand BODY according to PARAMS, return the expanded body."
-  (let ((vars (nth 1 (or processed-params (org-babel-process-params params)))))
+  (let ((vars (org-babel-get-header params :var)))
     (if (> (length vars) 0)
         (concat "(let ("
                 (mapconcat
@@ -76,8 +76,9 @@
 This function is called by `org-babel-execute-src-block'"
   (let* ((processed-params (org-babel-process-params params))
          (result-type (nth 3 processed-params))
-	 (org-babel-scheme-cmd (or (cdr (assoc :scheme params)) org-babel-scheme-cmd))
-         (full-body (org-babel-expand-body:scheme body params processed-params)))
+	 (org-babel-scheme-cmd (or (cdr (assoc :scheme params))
+				   org-babel-scheme-cmd))
+         (full-body (org-babel-expand-body:scheme body params)))
     (read
      (if (not (string= (nth 0 processed-params) "none"))
          ;; session evaluation

+ 1 - 1
lisp/ob-screen.el

@@ -45,7 +45,7 @@ In case you want to use a different screen than one selected by your $PATH")
   '((:results . "silent") (:session . "default") (:cmd . "sh") (:terminal . "xterm"))
   "Default arguments to use when running screen source blocks.")
 
-(defun org-babel-expand-body:screen (body params &optional processed-params)
+(defun org-babel-expand-body:screen (body params)
   "Expand BODY according to PARAMS, return the expanded body." body)
 
 (defun org-babel-execute:screen (body params)

+ 7 - 9
lisp/ob-sh.el

@@ -45,12 +45,11 @@
   "Command used to invoke a shell.
 This will be passed to  `shell-command-on-region'")
 
-(defun org-babel-expand-body:sh (body params &optional processed-params)
+(defun org-babel-expand-body:sh (body params)
   "Expand BODY according to PARAMS, return the expanded body."
-  (mapconcat
-   #'identity
-   (append (org-babel-sh-variable-assignments params processed-params)
-	   (list body)) "\n"))
+  (mapconcat #'identity
+	     (append (org-babel-sh-variable-assignments params) (list body))
+	     "\n"))
 
 (defun org-babel-execute:sh (body params)
   "Execute a block of Shell commands with Babel.
@@ -58,8 +57,7 @@ This function is called by `org-babel-execute-src-block'."
   (let* ((processed-params (org-babel-process-params params))
          (session (org-babel-sh-initiate-session (nth 0 processed-params)))
          (result-params (nth 2 processed-params)) 
-         (full-body (org-babel-expand-body:sh
-                     body params processed-params)))
+         (full-body (org-babel-expand-body:sh body params)))
     (org-babel-reassemble-table
      (org-babel-sh-evaluate session full-body result-params)
      (org-babel-pick-name
@@ -88,7 +86,7 @@ This function is called by `org-babel-execute-src-block'."
 
 ;; helper functions
 
-(defun org-babel-sh-variable-assignments (params &optional processed-params)
+(defun org-babel-sh-variable-assignments (params)
   "Return list of shell statements assigning the block's variables"
   (let ((sep (cdr (assoc :separator params))))
     (mapcar
@@ -96,7 +94,7 @@ This function is called by `org-babel-execute-src-block'."
        (format "%s=%s"
 	       (car pair)
 	       (org-babel-sh-var-to-sh (cdr pair) sep)))
-     (nth 1 (or processed-params (org-babel-process-params params))))))
+     (mapcar #'cdr (org-babel-get-header params :var)))))
 
 (defun org-babel-sh-var-to-sh (var &optional sep)
   "Convert an elisp value to a shell variable.

+ 1 - 1
lisp/ob-sql.el

@@ -50,7 +50,7 @@
 
 (defvar org-babel-default-header-args:sql '())
 
-(defun org-babel-expand-body:sql (body params &optional processed-params)
+(defun org-babel-expand-body:sql (body params)
   "Expand BODY according to PARAMS, return the expanded body." body)
 
 (defun org-babel-execute:sql (body params)

+ 2 - 3
lisp/ob-sqlite.el

@@ -41,7 +41,7 @@
   '(db header echo bail csv column html line list separator nullvalue)
   "Sqlite specific header args.")
 
-(defun org-babel-expand-body:sqlite (body params &optional processed-params)
+(defun org-babel-expand-body:sqlite (body params)
   "Expand BODY according to the values of PARAMS."
   (org-babel-sqlite-expand-vars
    body (mapcar #'cdr (org-babel-get-header params :var))))
@@ -71,8 +71,7 @@ This function is called by `org-babel-execute-src-block'."
 	 (list
 	  (cons "body" ((lambda (sql-file)
 			  (with-temp-file sql-file
-			    (insert (org-babel-expand-body:sqlite
-				     body nil (list nil vars))))
+			    (insert (org-babel-expand-body:sqlite body params)))
 			  sql-file)
 			(org-babel-temp-file "sqlite-sql-")))
 	  (cons "cmd" org-babel-sqlite3-command)

+ 1 - 1
lisp/ob.el

@@ -414,7 +414,7 @@ block."
 		result))
 	  (setq call-process-region 'org-babel-call-process-region-original))))))
 
-(defun org-babel-expand-body:generic (body params &optional processed-params)
+(defun org-babel-expand-body:generic (body params)
   "Expand BODY with PARAMS.
 Expand a block of code with org-babel according to it's header
 arguments.  This generic implementation of body expansion is