branch: externals/poke
commit 3ac0d4c6119ca6d6ba47794da7487b7cdec267c9
Author: Jose E. Marchesi <[email protected]>
Commit: Jose E. Marchesi <[email protected]>
poke.el: avoid race condition in REPL handling
2022-03-21 Jose E. Marchesi <[email protected]>
* emacs/poke.el (poke-repl-input-sender): Avoid race condition in
repl handling.
---
poke.el | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/poke.el b/poke.el
index 9abcc1328c..7ae513ae0e 100644
--- a/poke.el
+++ b/poke.el
@@ -795,11 +795,12 @@ fun plet_elval = (string s) void:
(comint-output-filter poke-repl-process poke-repl-prompt))))
(defun poke-repl-input-sender (proc input)
- (unless (string-blank-p input)
+ (if (not (string-blank-p input))
(let ((id (number-to-string poke-repl-seq))
(buffer-read-only nil)
(lb (- (line-beginning-position) 5)))
(comint-output-filter poke-repl-process (format "#%s\n" id))
+ (comint-output-filter poke-repl-process poke-repl-prompt)
(cond
((string-match "^[ \t]*\\(var\\|type\\|unit\\|fun\\) " input)
(poke-code-send (concat input ";")))
@@ -812,9 +813,9 @@ fun plet_elval = (string s) void:
"\"" (match-string 1 input) "\""
");")))
(t
- (poke-cmd-send (concat input ";"))))))
- (poke-vu-refresh)
- (comint-output-filter poke-repl-process poke-repl-prompt))
+ (poke-cmd-send (concat input ";")))))
+ (comint-output-filter poke-repl-process poke-repl-prompt))
+ (poke-vu-refresh))
(defun poke-repl ()
(interactive)