mirror of
https://github.com/vale981/ement.el
synced 2025-03-06 01:31:41 -05:00
Tidy: (ement-taxy-room-list) Macrolet for taxy-sort* calls
This commit is contained in:
parent
8c9d440f0c
commit
5ce88056e8
1 changed files with 21 additions and 20 deletions
|
@ -401,7 +401,10 @@
|
||||||
(cl-loop for (_id . session) in ement-sessions
|
(cl-loop for (_id . session) in ement-sessions
|
||||||
append (cl-loop for room in (ement-session-rooms session)
|
append (cl-loop for room in (ement-session-rooms session)
|
||||||
collect (vector room session))))
|
collect (vector room session))))
|
||||||
(taxy (thread-last
|
(taxy (cl-macrolet ((first-item-p
|
||||||
|
(pred) `(lambda (taxy)
|
||||||
|
(,pred (car (taxy-items taxy))))))
|
||||||
|
(thread-last
|
||||||
(make-fn
|
(make-fn
|
||||||
:name "Ement Rooms"
|
:name "Ement Rooms"
|
||||||
:take (taxy-make-take-function keys ement-taxy-keys))
|
:take (taxy-make-take-function keys ement-taxy-keys))
|
||||||
|
@ -411,16 +414,14 @@
|
||||||
(taxy-sort #'t<nil #'room-invited-p)
|
(taxy-sort #'t<nil #'room-invited-p)
|
||||||
(taxy-sort #'t<nil #'room-favourite-p)
|
(taxy-sort #'t<nil #'room-favourite-p)
|
||||||
(taxy-sort #'t>nil #'room-low-priority-p)
|
(taxy-sort #'t>nil #'room-low-priority-p)
|
||||||
|
(taxy-sort #'t>nil #'room-left-p)
|
||||||
|
(taxy-sort #'t<nil #'room-space-p)
|
||||||
(taxy-sort* #'string< #'taxy-name)
|
(taxy-sort* #'string< #'taxy-name)
|
||||||
(taxy-sort* #'t<nil (lambda (taxy)
|
(taxy-sort* #'t<nil (first-item-p room-unread-p))
|
||||||
(room-unread-p (car (taxy-items taxy)))))
|
(taxy-sort* #'t<nil (first-item-p room-invited-p))
|
||||||
(taxy-sort* #'t<nil (lambda (taxy)
|
(taxy-sort* #'t<nil (first-item-p room-favourite-p))
|
||||||
(room-favourite-p (car (taxy-items taxy)))))
|
(taxy-sort* #'t>nil (first-item-p room-low-priority-p))
|
||||||
(taxy-sort* #'t>nil (lambda (taxy)
|
(taxy-sort* #'t>nil (first-item-p room-left-p)))))
|
||||||
(room-low-priority-p (car (taxy-items taxy)))))
|
|
||||||
(taxy-sort* #'t<nil (lambda (taxy)
|
|
||||||
(not (room-left-p (car (taxy-items taxy))))))
|
|
||||||
(taxy-sort #'t<nil #'room-space-p)))
|
|
||||||
(taxy-magit-section-insert-indent-items nil)
|
(taxy-magit-section-insert-indent-items nil)
|
||||||
(inhibit-read-only t)
|
(inhibit-read-only t)
|
||||||
(format-cons (taxy-magit-section-format-items
|
(format-cons (taxy-magit-section-format-items
|
||||||
|
|
Loading…
Add table
Reference in a new issue