mirror of
https://github.com/vale981/ement.el
synced 2025-03-05 09:21:37 -05:00
Add: Auto-update room list buffer
This commit is contained in:
parent
6fefd3c075
commit
d56c1bb4ec
2 changed files with 19 additions and 1 deletions
|
@ -64,6 +64,14 @@
|
|||
|
||||
;;;; Customization
|
||||
|
||||
(defgroup ement-room-list nil
|
||||
"Options for the room list buffer."
|
||||
:group 'ement)
|
||||
|
||||
(defcustom ement-room-list-auto-update t
|
||||
"Automatically update the room list buffer."
|
||||
:type 'boolean)
|
||||
|
||||
;;;; Bookmark support
|
||||
|
||||
;; Especially useful with Burly: <https://github.com/alphapapa/burly.el>
|
||||
|
@ -157,6 +165,15 @@ call `pop-to-buffer'."
|
|||
|
||||
;;;; Functions
|
||||
|
||||
(defun ement-room-list-auto-update (_session)
|
||||
"Automatically update the room list buffer.
|
||||
Does so when variable `ement-room-list-auto-update' is non-nil.
|
||||
To be called in `ement-sync-callback-hook'."
|
||||
(when (and ement-room-list-auto-update
|
||||
(buffer-live-p (get-buffer "*Ement Rooms*")))
|
||||
(with-current-buffer (get-buffer "*Ement Rooms*")
|
||||
(revert-buffer))))
|
||||
|
||||
(defun ement-room-list--set-entries ()
|
||||
"Set `tabulated-list-entries'."
|
||||
;; Reset avatar size in case default font size has changed.
|
||||
|
|
3
ement.el
3
ement.el
|
@ -75,7 +75,8 @@
|
|||
(defvar ement-progress-value nil
|
||||
"Used to report progress while processing sync events.")
|
||||
|
||||
(defvar ement-sync-callback-hook '(ement--update-room-buffers ement--auto-sync)
|
||||
(defvar ement-sync-callback-hook
|
||||
'(ement--update-room-buffers ement--auto-sync ement-room-list-auto-update)
|
||||
"Hook run after `ement--sync-callback'.
|
||||
Hooks are called with one argument, the session that was
|
||||
synced.")
|
||||
|
|
Loading…
Add table
Reference in a new issue