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

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

[elpa] externals-release/ement 91590202d1 5/6: Fix: (ement-room-list-nex


From: ELPA Syncer
Subject: [elpa] externals-release/ement 91590202d1 5/6: Fix: (ement-room-list-next-unread)
Date: Wed, 17 May 2023 07:58:05 -0400 (EDT)

branch: externals-release/ement
commit 91590202d13623830491ada3bafb03f8b1eb3cc4
Author: Adam Porter <adam@alphapapa.net>
Commit: Adam Porter <adam@alphapapa.net>

    Fix: (ement-room-list-next-unread)
    
    Was broken by 11450ed3440741730581d97c82880cb51d9ff489.
    
    Fixes #149.  Thanks to @jeffbowman for reporting.
---
 README.org         |  1 +
 ement-room-list.el | 14 ++++++--------
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/README.org b/README.org
index a6882d9db8..49aed6e99d 100644
--- a/README.org
+++ b/README.org
@@ -300,6 +300,7 @@ Note that, while ~matrix-client~ remains usable, and 
probably will for some time
 
 *Fixes*
 + Another attempt at restoring position in room list when refreshing.
++ Command ~ement-room-list-next-unread~.
 
 ** 0.9.2
 
diff --git a/ement-room-list.el b/ement-room-list.el
index 076314e13e..6dad23545c 100644
--- a/ement-room-list.el
+++ b/ement-room-list.el
@@ -753,19 +753,17 @@ left."
 (defun ement-room-list-next-unread ()
   "Show next unread room."
   (interactive)
-  (unless (button-at (point))
-    (call-interactively #'forward-button))
+  (when (eobp)
+    (goto-char (point-min)))
   (unless (cl-loop with starting-line = (line-number-at-pos)
                    for value = (oref (magit-current-section) value)
-                   for room = (elt value 0)
-                   for session = (elt value 1)
-                   if (ement--room-unread-p room session)
+                   if (and (vectorp value)
+                           (ement--room-unread-p (elt value 0) (elt value 1)))
                    do (progn
-                        (goto-char (button-end (button-at (point))))
-                        (push-button (1- (point)))
+                        (ement-view-room (elt value 0)  (elt value 1))
                         (ement-room-goto-fully-read-marker)
                         (cl-return t))
-                   else do (call-interactively #'forward-button)
+                   else do (forward-line 1)
                    while (> (line-number-at-pos) starting-line))
     ;; No more unread rooms.
     (message "No more unread rooms")))



reply via email to

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