1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2025-01-12 16:24:10 +00:00

org-babel: further cleaning of parameter-passing to language files

Also update docstrings of language execution functions to reflect
changes.
This commit is contained in:
Dan Davison 2009-11-10 15:42:05 -05:00 committed by Eric Schulte
parent 0fa68a53ba
commit 3547a6b64d
9 changed files with 13 additions and 14 deletions

View File

@ -37,7 +37,7 @@
(defun org-babel-execute:R (body params)
"Execute a block of R code with org-babel. This function is
called by `org-babel-execute-src-block' via multiple-value-bind."
called by `org-babel-execute-src-block'."
(message "executing R source code block...")
(save-window-excursion
(let* ((processed-params (org-babel-process-params params))

View File

@ -38,7 +38,7 @@
(defun org-babel-execute:css (body params)
"Execute a block of CSS code with org-babel. This function is
called by `org-babel-execute-src-block' via multiple-value-bind."
called by `org-babel-execute-src-block'."
(message "executing CSS source code block")
body)

View File

@ -70,7 +70,7 @@ variable names and the value to be used in the gnuplot code."
(defun org-babel-execute:gnuplot (body params)
"Execute a block of Gnuplot code with org-babel. This function is
called by `org-babel-execute-src-block' via multiple-value-bind."
called by `org-babel-execute-src-block'."
(message "executing Gnuplot source code block")
(save-window-excursion
(let* ((vars (org-babel-gnuplot-process-vars params))

View File

@ -37,7 +37,7 @@
(defun org-babel-execute:perl (body params)
"Execute a block of Perl code with org-babel. This function is
called by `org-babel-execute-src-block' via multiple-value-bind."
called by `org-babel-execute-src-block'."
(message "executing Perl source code block")
(let* ((processed-params (org-babel-process-params params))
(session (first processed-params))

View File

@ -38,7 +38,7 @@
(defun org-babel-execute:python (body params)
"Execute a block of Python code with org-babel. This function is
called by `org-babel-execute-src-block' via multiple-value-bind."
called by `org-babel-execute-src-block'."
(message "executing Python source code block")
(let* ((processed-params (org-babel-process-params params))
(session (org-babel-python-initiate-session (first processed-params)))

View File

@ -48,7 +48,7 @@
(defun org-babel-execute:ruby (body params)
"Execute a block of Ruby code with org-babel. This function is
called by `org-babel-execute-src-block' via multiple-value-bind."
called by `org-babel-execute-src-block'."
(message "executing Ruby source code block")
(let* ((processed-params (org-babel-process-params params))
(session (org-babel-ruby-initiate-session (first processed-params)))

View File

@ -38,7 +38,7 @@
(defun org-babel-execute:sh (body params)
"Execute a block of Shell commands with org-babel. This
function is called by `org-babel-execute-src-block' via multiple-value-bind."
function is called by `org-babel-execute-src-block'."
(message "executing Shell source code block")
(let* ((processed-params (org-babel-process-params params))
(session (org-babel-sh-initiate-session (first processed-params)))

View File

@ -53,7 +53,7 @@
(defun org-babel-execute:sql (body params)
"Execute a block of Sql code with org-babel. This function is
called by `org-babel-execute-src-block' via multiple-value-bind."
called by `org-babel-execute-src-block'."
(message "executing Sql source code block")
(let* ((result-params (split-string (or (cdr (assoc :results params)) "")))
(cmdline (cdr (assoc :cmdline params)))

View File

@ -184,9 +184,10 @@ the header arguments specified at the source code block."
(body (setf (second info)
(if (assoc :noweb params)
(org-babel-expand-noweb-references info) (second info))))
(processed-params (org-babel-process-params params))
(result-params (third processed-params))
(result-type (fourth processed-params))
(result-params (split-string (or (cdr (assoc :results params)) "")))
(result-type (cond ((member "output" result-params) 'output)
((member "value" result-params) 'value)
(t 'value)))
(cmd (intern (concat "org-babel-execute:" lang)))
result)
;; (message "params=%S" params) ;; debugging
@ -395,9 +396,7 @@ may be specified in the properties of the current outline entry."
(defun org-babel-process-params (params)
"Parse params and resolve references.
Return a list (session vars result-params result-type). These are
made available to the org-babel-execute:LANG functions via
multiple-value-bind."
Return a list (session vars result-params result-type)."
(let* ((session (cdr (assoc :session params)))
(vars (org-babel-ref-variables params))
(result-params (split-string (or (cdr (assoc :results params)) "")))