[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals-release/ement de82db64f1 3/6: Revert "Fix: (ement-room-
From: |
ELPA Syncer |
Subject: |
[elpa] externals-release/ement de82db64f1 3/6: Revert "Fix: (ement-room-list) When no rooms are joined" |
Date: |
Wed, 17 May 2023 07:58:04 -0400 (EDT) |
branch: externals-release/ement
commit de82db64f1bc4c8c1b3f14506c0900afab21c2ba
Author: Adam Porter <adam@alphapapa.net>
Commit: Adam Porter <adam@alphapapa.net>
Revert "Fix: (ement-room-list) When no rooms are joined"
This reverts commit c0b922bcc5d3c11b60d283caf28356c251fe885b.
---
ement-room-list.el | 126 ++++++++++++++++++++++++++---------------------------
1 file changed, 62 insertions(+), 64 deletions(-)
diff --git a/ement-room-list.el b/ement-room-list.el
index bbdbfa69c8..516ac80b05 100644
--- a/ement-room-list.el
+++ b/ement-room-list.el
@@ -547,8 +547,7 @@ After showing it, its window is selected. The buffer is
named
BUFFER-NAME and is shown with DISPLAY-BUFFER-ACTION; or if
DISPLAY-BUFFER-ACTION is nil, the buffer is not displayed."
(interactive)
- (let ((inhibit-read-only t)
- format-table column-sizes window-start room-session-vectors)
+ (let (format-table column-sizes window-start)
(cl-labels (;; (heading-face
;; (depth) (list :inherit (list 'bufler-group
(bufler-level-face depth))))
(format-item (item) (gethash item format-table))
@@ -616,70 +615,69 @@ DISPLAY-BUFFER-ACTION is nil, the buffer is not
displayed."
;; (kill-buffer buffer-name))
(unless ement-sessions
(error "Ement: Not connected. Use `ement-connect' to connect"))
- (setf room-session-vectors
- (cl-loop for (_id . session) in ement-sessions
- append (cl-loop for room in (ement-session-rooms session)
- collect (vector room session))))
(with-current-buffer (get-buffer-create buffer-name)
(ement-room-list-mode)
- (delete-all-overlays)
- (erase-buffer)
- (if (not room-session-vectors)
- (insert "No joined rooms. Use command `ement-join-room' to join a
room, or `ement-directory' or `ement-directory-search' to find rooms.")
- (let* ((taxy (cl-macrolet ((first-item
- (pred) `(lambda (taxy)
- (when (taxy-items taxy)
- (,pred (car (taxy-items
taxy))))))
- (name= (name) `(lambda (taxy)
- (equal ,name (taxy-name
taxy)))))
- (thread-last
- (make-fn
- :name "Ement Rooms"
- :take (taxy-make-take-function keys
ement-room-list-keys))
- (taxy-fill room-session-vectors)
- (taxy-sort #'> #'item-latest-ts)
- (taxy-sort #'t<nil #'item-invited-p)
- (taxy-sort #'t<nil #'item-favourite-p)
- (taxy-sort #'t>nil #'item-low-priority-p)
- (taxy-sort #'t<nil #'item-unread-p)
- (taxy-sort #'t<nil #'item-space-p)
- ;; Within each taxy, left rooms should be sorted
last so that one
- ;; can never be the first room in the taxy (unless
it's the taxy
- ;; of left rooms), which would cause the taxy to be
incorrectly
- ;; sorted last.
- (taxy-sort #'t>nil #'item-left-p)
- (taxy-sort* #'string< #'taxy-name)
- (taxy-sort* #'> #'taxy-latest-ts)
- (taxy-sort* #'t<nil (name= "Buffers"))
- (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))
- (taxy-sort* #'t>nil (first-item item-space-p))
- (taxy-sort* #'t>nil (name= "Low-priority"))
- (taxy-sort* #'t>nil (first-item item-left-p)))))
- (taxy-magit-section-insert-indent-items nil)
- (format-cons (taxy-magit-section-format-items
- ement-room-list-columns
ement-room-list-column-formatters taxy))
- (pos (point))
- (section-ident (when (magit-current-section)
- (magit-section-ident
(magit-current-section)))))
- (setf format-table (car format-cons)
- column-sizes (cdr format-cons)
- header-line-format (taxy-magit-section-format-header
- column-sizes
ement-room-list-column-formatters)
- window-start (if (get-buffer-window buffer-name)
- (window-start (get-buffer-window
buffer-name))
- 0))
- (when ement-room-list-visibility-cache
- (setf magit-section-visibility-cache
ement-room-list-visibility-cache))
- (add-hook 'kill-buffer-hook #'ement-room-list--cache-visibility
nil 'local)
- (save-excursion
- (taxy-magit-section-insert taxy :items 'first
- ;; :blank-between-depth bufler-taxy-blank-between-depth
- :initial-depth 0))
- (goto-char pos)
- (when (and section-ident (magit-get-section section-ident))
- (goto-char (oref (magit-get-section section-ident) start))))))
+ (let* ((room-session-vectors
+ (cl-loop for (_id . session) in ement-sessions
+ append (cl-loop for room in (ement-session-rooms
session)
+ collect (vector room session))))
+ (taxy (cl-macrolet ((first-item
+ (pred) `(lambda (taxy)
+ (when (taxy-items taxy)
+ (,pred (car (taxy-items
taxy))))))
+ (name= (name) `(lambda (taxy)
+ (equal ,name (taxy-name
taxy)))))
+ (thread-last
+ (make-fn
+ :name "Ement Rooms"
+ :take (taxy-make-take-function keys
ement-room-list-keys))
+ (taxy-fill room-session-vectors)
+ (taxy-sort #'> #'item-latest-ts)
+ (taxy-sort #'t<nil #'item-invited-p)
+ (taxy-sort #'t<nil #'item-favourite-p)
+ (taxy-sort #'t>nil #'item-low-priority-p)
+ (taxy-sort #'t<nil #'item-unread-p)
+ (taxy-sort #'t<nil #'item-space-p)
+ ;; Within each taxy, left rooms should be sorted last
so that one
+ ;; can never be the first room in the taxy (unless
it's the taxy
+ ;; of left rooms), which would cause the taxy to be
incorrectly
+ ;; sorted last.
+ (taxy-sort #'t>nil #'item-left-p)
+ (taxy-sort* #'string< #'taxy-name)
+ (taxy-sort* #'> #'taxy-latest-ts)
+ (taxy-sort* #'t<nil (name= "Buffers"))
+ (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))
+ (taxy-sort* #'t>nil (first-item item-space-p))
+ (taxy-sort* #'t>nil (name= "Low-priority"))
+ (taxy-sort* #'t>nil (first-item item-left-p)))))
+ (taxy-magit-section-insert-indent-items nil)
+ (inhibit-read-only t)
+ (format-cons (taxy-magit-section-format-items
+ ement-room-list-columns
ement-room-list-column-formatters taxy))
+ (pos (point))
+ (section-ident (when (magit-current-section)
+ (magit-section-ident
(magit-current-section)))))
+ (setf format-table (car format-cons)
+ column-sizes (cdr format-cons)
+ header-line-format (taxy-magit-section-format-header
+ column-sizes
ement-room-list-column-formatters)
+ window-start (if (get-buffer-window buffer-name)
+ (window-start (get-buffer-window buffer-name))
+ 0))
+ (when ement-room-list-visibility-cache
+ (setf magit-section-visibility-cache
ement-room-list-visibility-cache))
+ (add-hook 'kill-buffer-hook #'ement-room-list--cache-visibility nil
'local)
+ (delete-all-overlays)
+ (erase-buffer)
+ (save-excursion
+ (taxy-magit-section-insert taxy :items 'first
+ ;; :blank-between-depth bufler-taxy-blank-between-depth
+ :initial-depth 0))
+ (goto-char pos)
+ (when (and section-ident (magit-get-section section-ident))
+ (goto-char (oref (magit-get-section section-ident) start)))))
(when display-buffer-action
(when-let ((window (display-buffer buffer-name display-buffer-action)))
(select-window window)))
- [elpa] externals-release/ement updated (7f39fa5694 -> 16e05cf4d3), ELPA Syncer, 2023/05/17
- [elpa] externals-release/ement fbf59554c6 1/6: Meta: v0.9.3-pre, ELPA Syncer, 2023/05/17
- [elpa] externals-release/ement 588113092f 4/6: Fix: (ement-room-list) Another attempt, ELPA Syncer, 2023/05/17
- [elpa] externals-release/ement de82db64f1 3/6: Revert "Fix: (ement-room-list) When no rooms are joined",
ELPA Syncer <=
- [elpa] externals-release/ement 91590202d1 5/6: Fix: (ement-room-list-next-unread), ELPA Syncer, 2023/05/17
- [elpa] externals-release/ement 6a12faa2c5 2/6: Revert "Fix: (ement-room-list) Restore point on refresh", ELPA Syncer, 2023/05/17
- [elpa] externals-release/ement 16e05cf4d3 6/6: Release: v0.9.3, ELPA Syncer, 2023/05/17