branch: externals/poke
commit 2f41f6e2fc884051bf682f6f83bde29147bfd40c
Author: Jose E. Marchesi <[email protected]>
Commit: Jose E. Marchesi <[email protected]>
poke.el: several improvements
2022-03-14 Jose E. Marchesi <[email protected]>
* emacs/poke.el (poke-exit): Handle *poke-ios*.
(poke): Create *poke-ios*.
(poke-repl-set-prompt): Fixed to not leave a spurious prompt.
(poke-elval-init-pk): Remove trace.
---
poke.el | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/poke.el b/poke.el
index 6d557d4264..5d2ccd74ef 100644
--- a/poke.el
+++ b/poke.el
@@ -548,7 +548,6 @@ fun plet_elval = (string s) void:
stoca (s, c);
chan_send (100, [PLET_ELVAL_CMD_EVAL] + c);
- //print \"elval: sent '\" + s + \"'\n\";
}
")
@@ -608,10 +607,14 @@ fun plet_elval = (string s) void:
(setq poke-repl-seq (1+ poke-repl-seq)))))
(defun poke-repl-set-prompt (string)
- (setq poke-repl-prompt string)
- (when (process-live-p poke-repl-process)
- (comint-output-filter poke-repl-process "\n")
- (comint-output-filter poke-repl-process poke-repl-prompt)))
+ (let ((previous-prompt poke-repl-prompt))
+ (setq poke-repl-prompt string)
+ (when (process-live-p poke-repl-process)
+ (with-current-buffer "*poke-repl*"
+ (save-excursion
+ (re-search-backward (regexp-quote previous-prompt) nil t)
+ (delete-region (point) (line-end-position))))
+ (comint-output-filter poke-repl-process poke-repl-prompt))))
(defun poke-repl-input-sender (proc input)
(unless (string-blank-p input)
@@ -794,9 +797,11 @@ fun quit = void:
(poke-code-send poke-pk)
(poke-repl)
(poke-vu)
+ (poke-ios)
(delete-other-windows)
(switch-to-buffer "*poke-vu*")
(switch-to-buffer-other-window "*poke-out*")
+ (switch-to-buffer-other-window "*poke-ios*")
(switch-to-buffer-other-window "*poke-repl*"))
(defun poke-exit ()
@@ -809,7 +814,7 @@ fun quit = void:
(lambda (bufname)
(let ((buf (get-buffer bufname)))
(when buf (kill-buffer buf))))
- '("*poke-out*" "*poke-cmd*" "*poke-code*"
+ '("*poke-out*" "*poke-cmd*" "*poke-code*" "*poke-ios*"
"*poke-vu*" "*poke-repl*" "*poke-elval*" "*poked*"))
(setq poke-repl-prompt poke-repl-default-prompt)
(setq poke-ios-alist nil)))