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

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

[nongnu] elpa/subed 3baf5c1 296/389: subed-mpv--client-filter: Store pro


From: ELPA Syncer
Subject: [nongnu] elpa/subed 3baf5c1 296/389: subed-mpv--client-filter: Store process mark in variable
Date: Fri, 3 Dec 2021 11:00:45 -0500 (EST)

branch: elpa/subed
commit 3baf5c138b9c307ad3948fb48a4fdfefeb36d5a8
Author: Random User <rndusr@posteo.de>
Commit: Random User <rndusr@posteo.de>

    subed-mpv--client-filter: Store process mark in variable
---
 subed/subed-mpv.el | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/subed/subed-mpv.el b/subed/subed-mpv.el
index e66d3c6..096a7cb 100644
--- a/subed/subed-mpv.el
+++ b/subed/subed-mpv.el
@@ -220,13 +220,15 @@ string."
     (let ((orig-buffer (current-buffer)))
          (with-current-buffer (process-buffer proc)
         ;; Insert new response where previous response ended
-           (let ((moving (= (point) (process-mark proc))))
+           (let* ((proc-mark (process-mark proc))
+               (moving (= (point) proc-mark)))
                  (save-excursion
-                   (goto-char (process-mark proc))
+                   (goto-char proc-mark)
                    (insert response)
-                   (set-marker (process-mark proc) (point)))
-                 (if moving (goto-char (process-mark proc))))
-           ;; Process and remove all complete lines of JSON
+                   (set-marker proc-mark (point)))
+                 (if moving (goto-char proc-mark)))
+           ;; Process and remove all complete lines of JSON (lines are 
complete if
+           ;; they end with \n)
            (let ((p0 (point-min)))
                  (while (progn (goto-char p0)
                         (end-of-line)



reply via email to

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