emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/lua-mode 5fe5f57 422/468: Fix wait-for-prompt to take lua-


From: Philip Kaludercic
Subject: [nongnu] elpa/lua-mode 5fe5f57 422/468: Fix wait-for-prompt to take lua-prompt-regexp into account
Date: Thu, 5 Aug 2021 04:59:21 -0400 (EDT)

branch: elpa/lua-mode
commit 5fe5f572b1d244f64df96cde8255f3c2102f818d
Author: immerrr <immerrr+lua@gmail.com>
Commit: immerrr <immerrr+lua@gmail.com>

    Fix wait-for-prompt to take lua-prompt-regexp into account
---
 lua-mode.el | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/lua-mode.el b/lua-mode.el
index 32f9750..74a6cf6 100644
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -1863,13 +1863,6 @@ When called interactively, switch to the process buffer."
   (setq lua-process (get-buffer-process lua-process-buffer))
   (set-process-query-on-exit-flag lua-process nil)
   (with-current-buffer lua-process-buffer
-    ;; wait for prompt
-    (while (not (lua-prompt-line))
-      (accept-process-output (get-buffer-process (current-buffer)))
-      (goto-char (point-max)))
-    ;; send initialization code
-    (lua-send-string lua-process-init-code)
-
     ;; enable error highlighting in stack traces
     (require 'compile)
     (setq lua--repl-buffer-p t)
@@ -1878,7 +1871,14 @@ When called interactively, switch to the process buffer."
           (cons (list lua-traceback-line-re 1 2)
                 compilation-error-regexp-alist))
     (compilation-shell-minor-mode 1)
-    (setq-local comint-prompt-regexp lua-prompt-regexp))
+    (setq-local comint-prompt-regexp lua-prompt-regexp)
+
+    ;; Don't send initialization code until seeing the prompt to ensure that
+    ;; the interpreter is ready.
+    (while (not (lua-prompt-line))
+      (accept-process-output (get-buffer-process (current-buffer)))
+      (goto-char (point-max)))
+    (lua-send-string lua-process-init-code))
 
   ;; when called interactively, switch to process buffer
   (if (called-interactively-p 'any)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]