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

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

[elpa] externals/ement 40a9833b90 3/3: Change: (ement-room-update-read-r


From: ELPA Syncer
Subject: [elpa] externals/ement 40a9833b90 3/3: Change: (ement-room-update-read-receipt) Also mark buffer unmodified
Date: Wed, 5 Oct 2022 17:57:36 -0400 (EDT)

branch: externals/ement
commit 40a9833b905814d947d8dfd51e8244490ae0f37b
Author: Adam Porter <adam@alphapapa.net>
Commit: Adam Porter <adam@alphapapa.net>

    Change: (ement-room-update-read-receipt) Also mark buffer unmodified
---
 README.org    | 3 +++
 ement-room.el | 8 +++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/README.org b/README.org
index d7ea60de94..43432f6ea3 100644
--- a/README.org
+++ b/README.org
@@ -291,6 +291,9 @@ Note that, while ~matrix-client~ remains usable, and 
probably will for some time
 *Additions*
 + Option ~ement-room-unread-only-counts-notifications~, now enabled by 
default, causes rooms' unread status to be determined only by their 
notification counts (which are set by the server and depend on rooms' 
notification settings).
 
+*Changes*
++ When a room's read receipt is updated, the room's buffer is also marked as 
unmodified.  (In concert with the new option, this makes rooms' unread status 
more intuitive.)
+
 ** 0.3.1
 
 *Fixes*
diff --git a/ement-room.el b/ement-room.el
index 3d1154d0f5..49b0d49326 100644
--- a/ement-room.el
+++ b/ement-room.el
@@ -2434,7 +2434,8 @@ To be called from timer stored in
         (ement-room-update-read-receipt window)))))
 
 (defun ement-room-update-read-receipt (window)
-  "Update read receipt for room displayed in WINDOW."
+  "Update read receipt for room displayed in WINDOW.
+Also, mark room's buffer as unmodified."
   (with-selected-window window
     (let ((read-receipt-node (ement-room--ewoc-last-matching ement-ewoc
                                (lambda (node-data)
@@ -2469,6 +2470,11 @@ To be called from timer stored in
               (setf event-node (ement-room--ewoc-next-matching ement-ewoc 
event-node
                                  #'ement-event-p #'ewoc-prev)))
             (setf event (ewoc-data event-node))
+            ;; Mark the buffer as not modified so that will not contribute to 
its being
+            ;; considered unread.  NOTE: This will mean that any room buffer 
displayed in
+            ;; a window will have its buffer marked unmodified when this 
function is
+            ;; called.  This is probably for the best.
+            (set-buffer-modified-p nil)
             (unless (alist-get event ement-room-read-receipt-request)
               ;; No existing request for this event: cancel any outstanding 
request and
               ;; send a new one.



reply via email to

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