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

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

[elpa] externals/crdt 81b55a2 2/2: Merge branch 'jimmyhmiller-master-pat


From: ELPA Syncer
Subject: [elpa] externals/crdt 81b55a2 2/2: Merge branch 'jimmyhmiller-master-patch-76360' into 'master'
Date: Fri, 10 Dec 2021 15:57:15 -0500 (EST)

branch: externals/crdt
commit 81b55a27b815b8afec7a93d22c65029aa06ae870
Merge: c427979 5719de1
Author: Qiantan Hong <qhong@alum.mit.edu>
Commit: Qiantan Hong <qhong@alum.mit.edu>

    Merge branch 'jimmyhmiller-master-patch-76360' into 'master'
    
    Check if the process-mark is non-nil and if mark-pos is non-nil to prevent 
errors
    
    See merge request qhong/crdt.el!1
---
 crdt.el | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/crdt.el b/crdt.el
index abac05c..001f517 100644
--- a/crdt.el
+++ b/crdt.el
@@ -2596,14 +2596,17 @@ The result DIFF can be used in (CRDT--NAPPLY-DIFF OLD 
DIFF) to reproduce NEW."
 (cl-defun crdt--send-process-mark-maybe (&optional (lazy t))
   (let ((buffer-process (get-buffer-process (current-buffer))))
     (when buffer-process
-      (let* ((mark-pos (marker-position (process-mark buffer-process)))
-             (current-id (crdt--get-id mark-pos)))
-        (unless (and lazy (string-equal crdt--last-process-mark-id current-id))
-          (setq crdt--last-process-mark-id current-id)
-          (crdt--broadcast-maybe
-           (crdt--format-message
-            `(process-mark ,crdt--buffer-network-name
-                           ,current-id ,mark-pos))))))))
+      (let* ((mark (process-mark buffer-process)))
+        (when mark
+          (let* ((mark-pos (marker-position mark)))
+            (when mark-pos
+              (let* ((current-id (crdt--get-id mark-pos)))
+                (unless (and lazy (string-equal crdt--last-process-mark-id 
current-id))
+                  (setq crdt--last-process-mark-id current-id)
+                  (crdt--broadcast-maybe
+                   (crdt--format-message
+                    `(process-mark ,crdt--buffer-network-name
+                                   ,current-id ,mark-pos))))))))))))
 
 (defun crdt--process-status-advice (orig-func process)
   (if (crdt--pseudo-process-p process)



reply via email to

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