[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/crdt 5719de1 1/2: Check if the process-mark is non-nil
From: |
ELPA Syncer |
Subject: |
[elpa] externals/crdt 5719de1 1/2: Check if the process-mark is non-nil and if mark-pos is non-nil to prevent errors |
Date: |
Fri, 10 Dec 2021 15:57:14 -0500 (EST) |
branch: externals/crdt
commit 5719de1c06a81923ecdfb21d2923ce4cc5f4cc9c
Author: Jimmy Miller <jimmyhmiller@gmail.com>
Commit: Jimmy Miller <jimmyhmiller@gmail.com>
Check if the process-mark is non-nil and if mark-pos is non-nil to prevent
errors
---
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)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] externals/crdt 5719de1 1/2: Check if the process-mark is non-nil and if mark-pos is non-nil to prevent errors,
ELPA Syncer <=