From 3547a6b64d239d0f9ab91d9a8fb680545e07f0ca Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Tue, 10 Nov 2009 15:42:05 -0500 Subject: [PATCH] org-babel: further cleaning of parameter-passing to language files Also update docstrings of language execution functions to reflect changes. --- contrib/babel/lisp/langs/org-babel-R.el | 2 +- contrib/babel/lisp/langs/org-babel-css.el | 2 +- contrib/babel/lisp/langs/org-babel-gnuplot.el | 2 +- contrib/babel/lisp/langs/org-babel-perl.el | 2 +- contrib/babel/lisp/langs/org-babel-python.el | 2 +- contrib/babel/lisp/langs/org-babel-ruby.el | 2 +- contrib/babel/lisp/langs/org-babel-sh.el | 2 +- contrib/babel/lisp/langs/org-babel-sql.el | 2 +- contrib/babel/lisp/org-babel.el | 11 +++++------ 9 files changed, 13 insertions(+), 14 deletions(-) diff --git a/contrib/babel/lisp/langs/org-babel-R.el b/contrib/babel/lisp/langs/org-babel-R.el index e861e72c..f9e0d004 100644 --- a/contrib/babel/lisp/langs/org-babel-R.el +++ b/contrib/babel/lisp/langs/org-babel-R.el @@ -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)) diff --git a/contrib/babel/lisp/langs/org-babel-css.el b/contrib/babel/lisp/langs/org-babel-css.el index 93a369dc..96c9fdcb 100644 --- a/contrib/babel/lisp/langs/org-babel-css.el +++ b/contrib/babel/lisp/langs/org-babel-css.el @@ -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) diff --git a/contrib/babel/lisp/langs/org-babel-gnuplot.el b/contrib/babel/lisp/langs/org-babel-gnuplot.el index 814fb141..353f28f7 100644 --- a/contrib/babel/lisp/langs/org-babel-gnuplot.el +++ b/contrib/babel/lisp/langs/org-babel-gnuplot.el @@ -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)) diff --git a/contrib/babel/lisp/langs/org-babel-perl.el b/contrib/babel/lisp/langs/org-babel-perl.el index 1dc395f8..b6140666 100644 --- a/contrib/babel/lisp/langs/org-babel-perl.el +++ b/contrib/babel/lisp/langs/org-babel-perl.el @@ -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)) diff --git a/contrib/babel/lisp/langs/org-babel-python.el b/contrib/babel/lisp/langs/org-babel-python.el index 4cd1ed36..9234d89d 100644 --- a/contrib/babel/lisp/langs/org-babel-python.el +++ b/contrib/babel/lisp/langs/org-babel-python.el @@ -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))) diff --git a/contrib/babel/lisp/langs/org-babel-ruby.el b/contrib/babel/lisp/langs/org-babel-ruby.el index 3f2e52ac..1bea4e68 100644 --- a/contrib/babel/lisp/langs/org-babel-ruby.el +++ b/contrib/babel/lisp/langs/org-babel-ruby.el @@ -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))) diff --git a/contrib/babel/lisp/langs/org-babel-sh.el b/contrib/babel/lisp/langs/org-babel-sh.el index f5362dd1..b3479145 100644 --- a/contrib/babel/lisp/langs/org-babel-sh.el +++ b/contrib/babel/lisp/langs/org-babel-sh.el @@ -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))) diff --git a/contrib/babel/lisp/langs/org-babel-sql.el b/contrib/babel/lisp/langs/org-babel-sql.el index 8b159259..fd26c6f0 100644 --- a/contrib/babel/lisp/langs/org-babel-sql.el +++ b/contrib/babel/lisp/langs/org-babel-sql.el @@ -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))) diff --git a/contrib/babel/lisp/org-babel.el b/contrib/babel/lisp/org-babel.el index adf78d37..93a451a4 100644 --- a/contrib/babel/lisp/org-babel.el +++ b/contrib/babel/lisp/org-babel.el @@ -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)) ""))) -- 2.11.4.GIT