|
23 | 23 |
|
24 | 24 | ;;; Commentary: |
25 | 25 |
|
26 | | -;; Org-Babel support for evaluating lua source code. |
| 26 | +;; Org-Babel support for evaluating Lua source code. |
27 | 27 |
|
28 | 28 | ;; Requirements: |
29 | 29 | ;; for session support, lua-mode is needed. |
| 30 | +;; |
30 | 31 | ;; lua-mode is not part of GNU Emacs/orgmode, but can be obtained |
31 | | -;; from marmalade or melpa. |
| 32 | +;; from NonGNU ELPA (see `M-x list-packages'). |
| 33 | +;; |
32 | 34 | ;; The source repository is here: |
33 | 35 | ;; https://github.com/immerrr/lua-mode |
34 | 36 |
|
@@ -68,14 +70,14 @@ This will typically be `lua-mode'." |
68 | 70 | :type 'symbol) |
69 | 71 |
|
70 | 72 | (defcustom org-babel-lua-hline-to "None" |
71 | | - "Replace hlines in incoming tables with this when translating to lua." |
| 73 | + "Replace hlines in incoming tables with this when translating to Lua." |
72 | 74 | :group 'org-babel |
73 | 75 | :version "26.1" |
74 | 76 | :package-version '(Org . "8.3") |
75 | 77 | :type 'string) |
76 | 78 |
|
77 | 79 | (defcustom org-babel-lua-None-to 'hline |
78 | | - "Replace `None' in lua tables with this before returning." |
| 80 | + "Replace `None' in Lua tables with this before returning." |
79 | 81 | :group 'org-babel |
80 | 82 | :version "26.1" |
81 | 83 | :package-version '(Org . "8.3") |
@@ -145,8 +147,8 @@ The variable definitions are defining in PARAMS." |
145 | 147 | (org-babel--get-vars params))) |
146 | 148 |
|
147 | 149 | (defun org-babel-lua-var-to-lua (var) |
148 | | - "Convert an elisp value to a lua variable. |
149 | | -Convert an elisp value, VAR, into a string of lua source code |
| 150 | + "Convert an Emacs Lisp value to a Lua variable. |
| 151 | +Convert an Emacs Lisp value, VAR, into a string of Lua source code |
150 | 152 | specifying a variable of the same value." |
151 | 153 | (if (listp var) |
152 | 154 | (if (and (= 1 (length var)) (not (listp (car var)))) |
@@ -207,7 +209,7 @@ Emacs-lisp table, otherwise return the results as a string." |
207 | 209 | (defvar lua-which-bufname) |
208 | 210 | (defvar lua-shell-buffer-name) |
209 | 211 | (defun org-babel-lua-initiate-session-by-key (&optional session) |
210 | | - "Initiate a lua session. |
| 212 | + "Initiate a Lua session. |
211 | 213 | If there is not a current inferior-process-buffer in SESSION |
212 | 214 | then create. Return the initialized session." |
213 | 215 | ;; (require org-babel-lua-mode) |
@@ -317,7 +319,7 @@ PREAMBLE is passed to `org-babel-lua-evaluate-external-process'." |
317 | 319 | "Evaluate BODY in external Lua process. |
318 | 320 | If RESULT-TYPE equals `output' then return standard output as a |
319 | 321 | string. If RESULT-TYPE equals `value' then return the value of the |
320 | | -last statement in BODY, as elisp. |
| 322 | +last statement in BODY, as Emacs Lisp. |
321 | 323 | RESULT-PARAMS list all the :result header arg parameters. |
322 | 324 | PREAMBLE string is appended to BODY." |
323 | 325 | (let ((raw |
@@ -353,7 +355,7 @@ PREAMBLE string is appended to BODY." |
353 | 355 | "Pass BODY to the Lua process in SESSION. |
354 | 356 | If RESULT-TYPE equals `output' then return standard output as a |
355 | 357 | string. If RESULT-TYPE equals `value' then return the value of the |
356 | | -last statement in BODY, as elisp." |
| 358 | +last statement in BODY, as Emacs Lisp." |
357 | 359 | (let* ((send-wait (lambda () (comint-send-input nil t) (sleep-for 0.005))) |
358 | 360 | (dump-last-value |
359 | 361 | (lambda |
|
0 commit comments