Function: org-babel-lua-evaluate-external-process
org-babel-lua-evaluate-external-process is a byte-compiled function
defined in ob-lua.el.gz.
Signature
(org-babel-lua-evaluate-external-process BODY &optional RESULT-TYPE RESULT-PARAMS PREAMBLE)
Documentation
Evaluate BODY in external lua process.
If RESULT-TYPE equals output then return standard output as a
string. If RESULT-TYPE equals value then return the value of the
last statement in BODY, as elisp.
Source Code
;; Defined in /usr/src/emacs/lisp/org/ob-lua.el.gz
(defun org-babel-lua-evaluate-external-process
(body &optional result-type result-params preamble)
"Evaluate BODY in external lua process.
If RESULT-TYPE equals `output' then return standard output as a
string. If RESULT-TYPE equals `value' then return the value of the
last statement in BODY, as elisp."
(let ((raw
(pcase result-type
(`output (org-babel-eval org-babel-lua-command
(concat preamble (and preamble "\n")
body)))
(`value (let ((tmp-file (org-babel-temp-file "lua-")))
(org-babel-eval
org-babel-lua-command
(concat
preamble (and preamble "\n")
(format
(if (member "pp" result-params)
org-babel-lua-pp-wrapper-method
org-babel-lua-wrapper-method)
(mapconcat
(lambda (line) (format "\t%s" line))
(split-string
(org-remove-indentation
(org-trim body))
"[\r\n]") "\n")
(org-babel-process-file-name tmp-file 'noquote))))
(org-babel-eval-read-file tmp-file))))))
(org-babel-result-cond result-params
raw
(org-babel-lua-table-or-string (org-trim raw)))))