Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into fix/setf-point-depr…
Browse files Browse the repository at this point in the history
…ecation
  • Loading branch information
polaris64 committed Nov 21, 2022
2 parents 5b07569 + f167987 commit 95c5c90
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
6 changes: 6 additions & 0 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,12 @@ Note that, while ~matrix-client~ remains usable, and probably will for some time
:TOC: :depth 0
:END:

** 0.5.1-pre

*Fixes*
+ Autoload ~ement-directory~ commands.
+ Faces in ~ement-directory~ listings.

** 0.5

*Additions*
Expand Down
11 changes: 9 additions & 2 deletions ement-directory.el
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@
(ement-directory-define-column "Name" (:max-width 25)
(pcase-let* (((map name ('room_type type)) item)
(face (pcase type
("m.space" 'ement-tabulated-room-list-space)
(_ 'ement-tabulated-room-list-name))))
("m.space" 'ement-room-list-space)
(_ 'ement-room-list-name))))
(propertize (or name "[unnamed]")
'face face)))

Expand Down Expand Up @@ -150,6 +150,7 @@

;; TODO: Pagination of results.

;;;###autoload
(cl-defun ement-directory (&key server session since (limit 100))
"View the public room directory on SERVER with SESSION.
Show up to LIMIT rooms. Interactively, with prefix, prompt for
Expand Down Expand Up @@ -188,12 +189,18 @@ SINCE may be a next-batch token."
(alist-get 'limit ement-directory-etc) limit)
(setq-local revert-buffer-function revert-function)
(when remaining
;; FIXME: The server seems to report all of the rooms on
;; the server as remaining even when searching for a
;; specific term like "emacs".
;; TODO: Display this in a more permanent place (like a
;; header or footer).
(message
(substitute-command-keys
"%s rooms remaining (use \\[ement-directory-next] to fetch more)")
remaining)))))))
(ement-message "Listing %s rooms on %s..." limit server)))

;;;###autoload
(cl-defun ement-directory-search (query &key server session since (limit 1000))
"View public rooms on SERVER matching QUERY.
QUERY is a string used to filter results."
Expand Down
4 changes: 4 additions & 0 deletions ement-room.el
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,10 @@ Note that, if ROOM has no buffer, STRING is returned unchanged."
(ement-afirst (equal room-id (ement-room-id it))
(ement-session-rooms session))
(cl-assert it nil "Room %S not found on session %S" room-id session-id))))
;; TODO: Put point at the end of the room buffer. However, this doesn't seem easy or
;; even possible, possibly because the bookmark library itself moves point after this
;; function returns. My attempts at setting the buffer's and window's points after
;; calling `ement-view-room' have had no effect.
(ement-view-room room session)))

;;;; Commands
Expand Down
2 changes: 1 addition & 1 deletion ement.el
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
;; Author: Adam Porter <adam@alphapapa.net>
;; Maintainer: Adam Porter <adam@alphapapa.net>
;; URL: https://github.com/alphapapa/ement.el
;; Version: 0.5
;; Version: 0.5.1-pre
;; Package-Requires: ((emacs "27.1") (map "2.1") (plz "0.2") (taxy "0.10") (taxy-magit-section "0.12.1") (svg-lib "0.2.5") (transient "0.3.7"))
;; Keywords: comm

Expand Down

0 comments on commit 95c5c90

Please sign in to comment.