[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/poke b517d98e21 05/76: poke.el: improvements in *poke-o
From: |
ELPA Syncer |
Subject: |
[elpa] externals/poke b517d98e21 05/76: poke.el: improvements in *poke-out* |
Date: |
Tue, 5 Apr 2022 14:59:27 -0400 (EDT) |
branch: externals/poke
commit b517d98e2110f0c8f7a07d7d2a6a89cb4d49a88b
Author: Jose E. Marchesi <jose.marchesi@oracle.com>
Commit: Jose E. Marchesi <jose.marchesi@oracle.com>
poke.el: improvements in *poke-out*
2022-03-12 Jose E. Marchesi <jemarch@gnu.org>
* emacs/poke.el (poke-iter-string-face): Define.
(poke-out-iter-string): Likewise.
(poke-out-filter): Insert iterator separator string and update
cursor in all windows showing *poke-out* after iterations.
(poke-out-got-output): Define.
---
poke.el | 61 ++++++++++++++++++++++++++++++++++---------------------------
1 file changed, 34 insertions(+), 27 deletions(-)
diff --git a/poke.el b/poke.el
index 370979e615..8763d06957 100644
--- a/poke.el
+++ b/poke.el
@@ -81,6 +81,8 @@
"Face for deletion thunk lines.")
(defface poke-diff-plus-face '((t :foreground "green"))
"Face for addition thunk lines.")
+(defface poke-iter-string-face '((t :bold t))
+ "Face for iteration separator in *poke-out* buffer.")
(defvar poke-styling-faces
'(("integer" poke-integer-face)
@@ -125,6 +127,9 @@
(defvar poke-out-length 0)
(defvar poke-out-eval "")
(defvar poke-out-styles nil)
+(defvar poke-out-got-output nil)
+(defvar poke-out-iter-string
+ (propertize (char-to-string 8594) 'font-lock-face poke-iter-string-face))
(defconst poke-out-state-waiting-for-length 0)
(defconst poke-out-state-waiting-for-msg 1)
@@ -160,27 +165,27 @@
(pcase (aref poke-out-buf 0)
(1 ;; Iteration begin
(setq poke-out-eval "")
- (when poke-debug-p
- (let ((iteration-number (poke-decode-u64-le
- (substring poke-out-buf 1 9))))
- (when (buffer-live-p (process-buffer proc))
- (with-current-buffer (process-buffer proc)
- (goto-char (point-max))
- (insert (concat "\n//---- iteration begin "
- (number-to-string iteration-number)
- "\n")))))))
+ (when (buffer-live-p (process-buffer proc))
+ (with-current-buffer (process-buffer proc)
+ (let ((buffer-read-only nil))
+ (goto-char (point-max))
+ (setq poke-out-iter-begin (point))
+ (if poke-debug-p
+ (let ((iteration-number (poke-decode-u64-le
+ (substring poke-out-buf 1 9))))
+ (insert (concat "//---- iteration begin "
+ (number-to-string iteration-number)
+ "\n"))))))))
(2 ;; Process terminal poke output
(let ((output (poke-out-stylize
(substring poke-out-buf 1 (- poke-out-length 1)))))
+ (setq poke-out-got-output t)
(when (buffer-live-p (process-buffer proc))
(with-current-buffer (process-buffer proc)
- (let ((moving (= (point) (process-mark proc))))
- (save-excursion
- (let ((buffer-read-only nil))
- (goto-char (process-mark proc))
- (insert output)
- (set-marker (process-mark proc) (point))))
- (if moving (goto-char (process-mark proc))))))))
+ (save-excursion
+ (let ((buffer-read-only nil))
+ (goto-char (point-max))
+ (insert output)))))))
(6 ;; Process eval poke output
(let ((output (poke-out-stylize
(substring poke-out-buf 1 (- poke-out-length 1)))))
@@ -211,17 +216,19 @@
(goto-char (point-max))
(insert (concat "error>" output))))))))
(3 ;; Iteration end
- (let ((iteration-number (poke-decode-u64-le
- (substring poke-out-buf 1 9))))
- (when poke-debug-p
- (when (buffer-live-p (process-buffer proc))
- (with-current-buffer (process-buffer proc)
- (goto-char (point-max))
- (insert (concat "\n//---- iteration end "
- (number-to-string iteration-number)
- "\n")))))
- (when (process-live-p poke-repl-process)
- (poke-repl-end-of-iteration))))
+ (when (buffer-live-p (process-buffer proc))
+ (with-current-buffer (process-buffer proc)
+ (save-excursion
+ (let ((buffer-read-only nil))
+ (when poke-out-iter-string
+ (when poke-out-got-output
+ (insert (concat poke-out-iter-string "\n"))))
+ (mapcar (lambda (window)
+ (set-window-point window (point-max)))
+ (get-buffer-window-list))))))
+ (setq poke-out-got-output nil)
+ (when (process-live-p poke-repl-process)
+ (poke-repl-end-of-iteration)))
(4 ;; Styling class begin
(let ((style (substring poke-out-buf 1 (- poke-out-length 1))))
(setq poke-out-styles (cons style poke-out-styles))))
- [elpa] branch externals/poke created (now 454a62bdd8), ELPA Syncer, 2022/04/05
- [elpa] externals/poke b517d98e21 05/76: poke.el: improvements in *poke-out*,
ELPA Syncer <=
- [elpa] externals/poke 020c404fce 12/76: poke.el: convert poke-out to the new infrastructure, ELPA Syncer, 2022/04/05
- [elpa] externals/poke 943fdf7d84 11/76: poke.el: new pokelet protocol infrastructure and convert poke-elval, ELPA Syncer, 2022/04/05
- [elpa] externals/poke d29be6c3a7 18/76: poke.el: highlight errors and warnings, ELPA Syncer, 2022/04/05
- [elpa] externals/poke 83459fae6e 09/76: poke.el: new pokelet elval and plet_elval, ELPA Syncer, 2022/04/05
- [elpa] externals/poke 84913982b0 23/76: poke.el: set_ios support, ELPA Syncer, 2022/04/05
- [elpa] externals/poke ad7ecfce56 28/76: poke.el: highlight lines in *poke-ios*, ELPA Syncer, 2022/04/05
- [elpa] externals/poke b88ff20148 31/76: poke.el: couple of small fixes, ELPA Syncer, 2022/04/05
- [elpa] externals/poke 44f8443088 35/76: poke.el: minor fixes, ELPA Syncer, 2022/04/05
- [elpa] externals/poke 46d106a707 40/76: poke.el: remove some non-needed functions, ELPA Syncer, 2022/04/05
- [elpa] externals/poke 67aec94f24 42/76: poke.el: improvements in poke-edit, ELPA Syncer, 2022/04/05