[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ement 524bf5fda7 5/5: Change: (ement-room--buffer) Add
From: |
ELPA Syncer |
Subject: |
[elpa] externals/ement 524bf5fda7 5/5: Change: (ement-room--buffer) Add footer for spaces |
Date: |
Wed, 24 May 2023 09:57:47 -0400 (EDT) |
branch: externals/ement
commit 524bf5fda74662bf6b2fe203653ddc9cc28818ac
Author: Adam Porter <adam@alphapapa.net>
Commit: Adam Porter <adam@alphapapa.net>
Change: (ement-room--buffer) Add footer for spaces
---
README.org | 1 +
ement-room.el | 19 ++++++++++++++++++-
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/README.org b/README.org
index 3354faf74f..38dc442426 100644
--- a/README.org
+++ b/README.org
@@ -303,6 +303,7 @@ Note that, while ~matrix-client~ remains usable, and
probably will for some time
+ Command ~ement-describe-room~ shows whether a room is a space or a normal
room.
+ Activating a space in the room list uses ~ement-view-space~ (which shows a
directory of rooms in the space) instead of ~ement-view-room~ (which shows
events in the space, which is generally not useful).
+ Command ~ement-view-space~ shows the space's name and alias.
++ Command ~ement-view-room~, when used for a space, shows a footer explaining
that the buffer is showing a space rather than a normal room, with a button to
call ~ement-view-space~ for it (which lists rooms in the space).
+ Improve readme export settings.
** 0.9.3
diff --git a/ement-room.el b/ement-room.el
index e91fdd1d08..b571f0b744 100644
--- a/ement-room.el
+++ b/ement-room.el
@@ -2098,6 +2098,7 @@ see."
"Return buffer named NAME showing ROOM's events on SESSION.
If ROOM has no buffer, one is made and stored in the room's local
data slot."
+ (declare (function ement-view-space "ement-directory"))
(or (map-elt (ement-room-local room) 'buffer)
(let ((new-buffer (generate-new-buffer name)))
(with-current-buffer new-buffer
@@ -2142,7 +2143,23 @@ data slot."
(kill-buffer)
(message "Joining
room... (buffer will be reopened after joining)")
(ement-room-join
(ement-room-id room) session))))))
- (_ ""))))
+ (_ (if (ement--space-p room)
+ (concat (propertize "This room is a space.
It is not for messaging, but only a grouping of other rooms. "
+ 'face
'font-lock-type-face)
+ (propertize "[View rooms in this
space]"
+ 'button '(t)
+ 'category 'default-button
+ 'mouse-face 'highlight
+ 'follow-link t
+ 'action (lambda (_button)
+ ;; Kill the
room buffer so it can be recreated after joining
+ ;; (which will
cleanly update the room's name, footer, etc).
+ (let ((room
ement-room)
+ (session
ement-session))
+ (kill-buffer)
+ (message
"Viewing space...")
+
(ement-view-space room session)))))
+ "")))))
(ewoc-set-hf ement-ewoc header footer))
(setf
;; Clear new-events, because those only matter when a buffer is
already open.