mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-11-21 06:55:35 +00:00
Backport commit a7dff8c53 from Emacs
* lisp/ob-lua.el: Minor doc fixes. a7dff8c53dde18c703f470cde9ad033cffe8c766 Stefan Kangas Tue Jun 18 21:27:51 2024 +0200
This commit is contained in:
parent
5d7218ceff
commit
b72871ab6a
@ -23,12 +23,14 @@
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; Org-Babel support for evaluating lua source code.
|
||||
;; Org-Babel support for evaluating Lua source code.
|
||||
|
||||
;; Requirements:
|
||||
;; for session support, lua-mode is needed.
|
||||
;;
|
||||
;; lua-mode is not part of GNU Emacs/orgmode, but can be obtained
|
||||
;; from marmalade or melpa.
|
||||
;; from NonGNU ELPA (see `M-x list-packages').
|
||||
;;
|
||||
;; The source repository is here:
|
||||
;; https://github.com/immerrr/lua-mode
|
||||
|
||||
@ -68,14 +70,14 @@ This will typically be `lua-mode'."
|
||||
:type 'symbol)
|
||||
|
||||
(defcustom org-babel-lua-hline-to "None"
|
||||
"Replace hlines in incoming tables with this when translating to lua."
|
||||
"Replace hlines in incoming tables with this when translating to Lua."
|
||||
:group 'org-babel
|
||||
:version "26.1"
|
||||
:package-version '(Org . "8.3")
|
||||
:type 'string)
|
||||
|
||||
(defcustom org-babel-lua-None-to 'hline
|
||||
"Replace `None' in lua tables with this before returning."
|
||||
"Replace `None' in Lua tables with this before returning."
|
||||
:group 'org-babel
|
||||
:version "26.1"
|
||||
:package-version '(Org . "8.3")
|
||||
@ -145,8 +147,8 @@ The variable definitions are defining in PARAMS."
|
||||
(org-babel--get-vars params)))
|
||||
|
||||
(defun org-babel-lua-var-to-lua (var)
|
||||
"Convert an elisp value to a lua variable.
|
||||
Convert an elisp value, VAR, into a string of lua source code
|
||||
"Convert an Emacs Lisp value to a Lua variable.
|
||||
Convert an Emacs Lisp value, VAR, into a string of Lua source code
|
||||
specifying a variable of the same value."
|
||||
(if (listp var)
|
||||
(if (and (= 1 (length var)) (not (listp (car var))))
|
||||
@ -207,7 +209,7 @@ Emacs-lisp table, otherwise return the results as a string."
|
||||
(defvar lua-which-bufname)
|
||||
(defvar lua-shell-buffer-name)
|
||||
(defun org-babel-lua-initiate-session-by-key (&optional session)
|
||||
"Initiate a lua session.
|
||||
"Initiate a Lua session.
|
||||
If there is not a current inferior-process-buffer in SESSION
|
||||
then create. Return the initialized session."
|
||||
;; (require org-babel-lua-mode)
|
||||
@ -317,7 +319,7 @@ PREAMBLE is passed to `org-babel-lua-evaluate-external-process'."
|
||||
"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.
|
||||
last statement in BODY, as Emacs Lisp.
|
||||
RESULT-PARAMS list all the :result header arg parameters.
|
||||
PREAMBLE string is appended to BODY."
|
||||
(let ((raw
|
||||
@ -353,7 +355,7 @@ PREAMBLE string is appended to BODY."
|
||||
"Pass BODY to the Lua process in SESSION.
|
||||
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."
|
||||
last statement in BODY, as Emacs Lisp."
|
||||
(let* ((send-wait (lambda () (comint-send-input nil t) (sleep-for 0.005)))
|
||||
(dump-last-value
|
||||
(lambda
|
||||
|
Loading…
Reference in New Issue
Block a user