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

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

[elpa] externals/ement a7ab44e011 1/3: Fix: (ement-taxy-room-list) Group


From: ELPA Syncer
Subject: [elpa] externals/ement a7ab44e011 1/3: Fix: (ement-taxy-room-list) Group sorting by timestamp
Date: Tue, 11 Oct 2022 20:57:36 -0400 (EDT)

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

    Fix: (ement-taxy-room-list) Group sorting by timestamp
    
    Now sorts groups recursively by room timestamp.
---
 ement-taxy.el | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/ement-taxy.el b/ement-taxy.el
index 23a8c672b6..2cb00e1788 100644
--- a/ement-taxy.el
+++ b/ement-taxy.el
@@ -445,6 +445,15 @@ DISPLAY-BUFFER-ACTION."
                 (item-invited-p
                  (item) (pcase-let ((`[,(cl-struct ement-room status) 
,_session] item))
                           (equal 'invite status)))
+                (taxy-latest-ts
+                 (taxy) (apply #'max most-negative-fixnum
+                               (delq nil
+                                     (list
+                                      (when (taxy-items taxy)
+                                        (item-latest-ts (car (taxy-items 
taxy))))
+                                      (when (taxy-taxys taxy)
+                                        (cl-loop for sub-taxy in (taxy-taxys 
taxy)
+                                                 maximizing (taxy-latest-ts 
sub-taxy)))))))
                 (t<nil (a b) (and a (not b)))
                 (t>nil (a b) (and (not a) b))
                 (make-fn (&rest args)
@@ -488,10 +497,7 @@ DISPLAY-BUFFER-ACTION."
                          ;; sorted last.
                          (taxy-sort #'t>nil #'item-left-p)
                          (taxy-sort* #'string< #'taxy-name)
-                         (taxy-sort* #'> (lambda (taxy)
-                                           (if (taxy-items taxy)
-                                               (item-latest-ts (car 
(taxy-items taxy)))
-                                             most-negative-fixnum)))
+                         (taxy-sort* #'> #'taxy-latest-ts)
                          (taxy-sort* #'t<nil (first-item item-unread-p))
                          (taxy-sort* #'t<nil (first-item item-favourite-p))
                          (taxy-sort* #'t<nil (first-item item-invited-p))



reply via email to

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