> Can you send a patch and a reproducer? Then, I can debug on my side.

Thanks, I attached diff file in attachment.

diff --git a/lisp/ob-lua.el b/lisp/ob-lua.el
index f3b7ff2f8..2b864af1a 100644
--- a/lisp/ob-lua.el
+++ b/lisp/ob-lua.el
@@ -76,8 +76,6 @@ (defcustom org-babel-lua-multiple-values-separator ", "
 
 (defvar org-babel-lua-eoe "org-babel-lua-eoe"
   "String to indicate that Lua evaluation has completed.")
-(defvar org-babel-lua-eoe-indicator "print(\"org_babel_lua_eoe\")"
-  "String to indicate that Lua evaluation has completed.")
 
 (defun org-babel-execute:lua (body params)
   "Execute Lua BODY according to PARAMS.
@@ -99,26 +97,37 @@ (defun org-babel-execute:lua (body params)
                    (org-babel-lua-evaluate
 		    full-body cmd result-type result-params preamble))
                   ;; session evaluation
+
+                  ;; (t
+                  ;;  (let* ((session (org-babel-lua-initiate-session (cdr (assq :session params)))))
+                  ;;    (org-babel-comint-with-output
+                  ;;        ;; (BUFFER EOE-INDICATOR REMOVE-ECHO FULL-BODY PROMPT-HANDLING)
+                  ;;        (session (format "%S" org-babel-lua-eoe) 'remove-echo full-body 'filter-prompts)
+                  ;;      (goto-char (point-max))
+                  ;;      (insert full-body)
+                  ;;      (comint-send-input nil nil))))
+
                   (t
                    (let* ((session (org-babel-lua-initiate-session (cdr (assq :session params)))))
                      (mapconcat
                       #'org-babel-lua-strip-prompt
-                      (split-string
-                       (car
-                        (mapcar
-                         #'substring-no-properties
-                         (org-babel-comint-with-output
-                             (session (format "%S" org-babel-lua-eoe) 'remove-echo body 'filter-prompts)
-                           (dolist (code (append (split-string body "\n")
-                                                 (list (format "print(%S)" org-babel-lua-eoe))))
-                             (goto-char (point-max))
-                             (insert (org-babel-chomp code))
-                             (comint-send-input nil t)))))
-                       "\n")
-                      ;; (butlast
-                      ;;  ;; Remove `org-babel-lua-eoe-indicator' output line.
-                      ;;  1)
-                      ))))))
+                      ;; remove `org-babel-lua-eoe-indicator' output line.
+                      (butlast
+                       (split-string
+                        (car
+                         (mapcar
+                          #'substring-no-properties
+                          (org-babel-comint-with-output
+                              (session (format "%S" org-babel-lua-eoe) 'remove-echo body 'filter-prompts)
+                            (dolist (code (append (split-string body "\n")
+                                                  (list (format "print(%S)" org-babel-lua-eoe))))
+                              (goto-char (point-max))
+                              (insert (org-babel-chomp code))
+                              (comint-send-input nil t)))))
+                        "\n")
+                       2)
+                      )))
+                  )))
     (org-babel-result-cond (cdr (assq :result-params params))
       result (org-babel-lua-read result))))
 
-- 

[ stardiviner ]
I try to make every word tell the meaning that I want to express without 
misunderstanding.

Blog: https://stardiviner.github.io/
IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner
GPG: F09F650D7D674819892591401B5DF1C95AE89AC3

Attachment: signature.asc
Description: PGP signature

Reply via email to