[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/crdt d10f9c0 30/80: bug fix, debug switch
From: |
ELPA Syncer |
Subject: |
[elpa] externals/crdt d10f9c0 30/80: bug fix, debug switch |
Date: |
Sat, 28 Aug 2021 10:57:36 -0400 (EDT) |
branch: externals/crdt
commit d10f9c0b012e361b8932a89bb488e2bc8490c528
Author: Qiantan Hong <qhong@mit.edu>
Commit: Qiantan Hong <qhong@mit.edu>
bug fix, debug switch
---
crdt.el | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/crdt.el b/crdt.el
index 341673e..798adbc 100644
--- a/crdt.el
+++ b/crdt.el
@@ -48,6 +48,9 @@
and there are some client connected to it currently."
:type 'boolean)
+(defvar crdt--log-network-traffic nil
+ "Debug switch to log network traffic to *Messages*.")
+
(require 'cl-lib)
(require 'subr-x)
@@ -928,7 +931,6 @@ If INCLUDE-CONTENT is non-NIL, the list contains STRING
instead of LENGTH."
(t (substring object prev-pos pos)))
(- pos prev-pos))
(cl-destructuring-bind (id . eob)
(crdt--get-crdt-id-pair prev-pos object)
- (print omit-end-of-block-p)
(let ((id-base64 (base64-encode-string id)))
(if omit-end-of-block-p (list id-base64) (list
id-base64 eob)))))
ids))
@@ -975,7 +977,8 @@ If CRDT--NETWORK-PROCESS is a server process, broadcast
MESSAGE-STRING
to clients except the one of which CLIENT-ID property is EQ to WITHOUT.
If CRDT--NETWORK-PROCESS is a client process, send MESSAGE-STRING
to server when WITHOUT is T."
- (message "Send %s" message-string)
+ (when crdt--log-network-traffic
+ (message "Send %s" message-string))
(if (process-contact (crdt--network-process) :server)
(dolist (client (crdt--network-clients))
(when (and (eq (process-status client) 'open)
@@ -1041,7 +1044,8 @@ to server when WITHOUT is T."
(cl-loop for (prop value) on (crdt--overlay-metadata-plist
meta) by #'cddr
do (process-send-string
process
- (crdt--format-message `(overlay-put ,(car k) ,(cdr
k) ,prop ,value))))))
+ (crdt--format-message `(overlay-put
,crdt--buffer-network-name
+ ,(car k) ,(cdr
k) ,prop ,value))))))
crdt--overlay-table)
(process-send-string process (crdt--format-message `(ready
,crdt--buffer-network-name)))))
@@ -1225,7 +1229,8 @@ to server when WITHOUT is T."
(goto-char (point-min))
(let (message)
(while (setq message (ignore-errors (read (current-buffer))))
- (print message)
+ (when crdt--log-network-traffic
+ (print message))
(cl-macrolet ((body ()
'(if (or (not (crdt--server-p)) (process-get process
'authenticated))
(let ((crdt--inhibit-update t))
@@ -1464,7 +1469,8 @@ Open a new buffer to display the shared content."
(list (let ((address
(read-from-minibuffer "Address: " nil nil nil
'crdt-connect-address-history)))
(when (eq (length address) 0)
- (error "Please input a valid address")))
+ (error "Please input a valid address"))
+ address)
(let ((port (read-from-minibuffer "Port (default 6530): " nil nil t
nil "6530")))
(when (not (numberp port))
(error "Port must be a number"))
- [elpa] externals/crdt d9d7100 53/80: remote process support, (continued)
- [elpa] externals/crdt d9d7100 53/80: remote process support, ELPA Syncer, 2021/08/28
- [elpa] externals/crdt 9a7ce57 56/80: fix fill-paragraph bug, ELPA Syncer, 2021/08/28
- [elpa] externals/crdt bc98495 60/80: I imagine this fix an imaginary bug with tuntox, ELPA Syncer, 2021/08/28
- [elpa] externals/crdt eb184d8 61/80: clean up *crdt - client*, ELPA Syncer, 2021/08/28
- [elpa] externals/crdt 76da6ac 62/80: update buffer/user menu in post-command-hook to account for focus change, ELPA Syncer, 2021/08/28
- [elpa] externals/crdt 20ff5b3 65/80: reenable crdt-mode and synchronize after major mode change, ELPA Syncer, 2021/08/28
- [elpa] externals/crdt d20b384 16/80: document and improvements, ELPA Syncer, 2021/08/28
- [elpa] externals/crdt 9c37d4d 19/80: remove superfluous crdt--inhibit-update bind, ELPA Syncer, 2021/08/28
- [elpa] externals/crdt 515959c 23/80: partially fixed deleted buffer bug, ELPA Syncer, 2021/08/28
- [elpa] externals/crdt 35d9612 28/80: fix some read functions, ELPA Syncer, 2021/08/28
- [elpa] externals/crdt d10f9c0 30/80: bug fix, debug switch,
ELPA Syncer <=
- [elpa] externals/crdt 2cee2da 41/80: fix bug in crdt-process-message (head remove), ELPA Syncer, 2021/08/28
- [elpa] externals/crdt 12d9a25 40/80: remove buffer bug, ELPA Syncer, 2021/08/28
- [elpa] externals/crdt 903ebf9 36/80: better display for address in user menu, ELPA Syncer, 2021/08/28
- [elpa] externals/crdt e7a3607 45/80: fix cl-block, ELPA Syncer, 2021/08/28
- [elpa] externals/crdt c10b38e 43/80: shorten string when ask for stop session confirmation, ELPA Syncer, 2021/08/28
- [elpa] externals/crdt c495170 09/80: remove debug statements, ELPA Syncer, 2021/08/28
- [elpa] externals/crdt f3e59a4 13/80: usability, ELPA Syncer, 2021/08/28
- [elpa] externals/crdt 81f288d 35/80: improve message parser performance, fix buffer list update bug, ELPA Syncer, 2021/08/28
- [elpa] externals/crdt d2fe006 39/80: refactor, get rid of status buffer, ELPA Syncer, 2021/08/28
- [elpa] externals/crdt efe7f10 44/80: fix byte compile warnings, ELPA Syncer, 2021/08/28