branch: elpa/subed
commit 3baf5c138b9c307ad3948fb48a4fdfefeb36d5a8
Author: Random User <rnd...@posteo.de>
Commit: Random User <rnd...@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