branch: externals/ement commit 98745950b673790c5648e67cc75b83da94b5b018 Author: Adam Porter <a...@alphapapa.net> Commit: Adam Porter <a...@alphapapa.net>
Change: (ement--format-room) Don't display nil topics --- README.org | 2 +- ement-lib.el | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.org b/README.org index 21614ab707..c9f2341719 100644 --- a/README.org +++ b/README.org @@ -295,7 +295,7 @@ Note that, while ~matrix-client~ remains usable, and probably will for some time *Changes* + When selecting a room to view with completion, don't offer spaces. -+ When selecting a room with completion, empty aliases are omitted instead of being displayed as ~<nil>~. ++ When selecting a room with completion, empty aliases and topics are omitted instead of being displayed as nil. *Fixes* + Use of send-message filter when replying. diff --git a/ement-lib.el b/ement-lib.el index 814de6ed63..a8241b9c39 100644 --- a/ement-lib.el +++ b/ement-lib.el @@ -1138,7 +1138,7 @@ m.replace metadata)." "Return ROOM formatted with name, alias, ID, and optionally TOPIC. Suitable for use in completion, etc." (if topic - (format "\"%s\"%s(<%s>): \"%s\"" + (format "%s%s(<%s>)%s" (or (ement-room-display-name room) (setf (ement-room-display-name room) (ement--room-display-name room))) @@ -1146,8 +1146,10 @@ Suitable for use in completion, etc." (format " <%s> " (ement-room-canonical-alias room)) " ") (ement-room-id room) - (ement-room-topic room)) - (format "\"%s\"%s(<%s>)" + (if (ement-room-topic room) + (format ": \"%s\"" (ement-room-topic room)) + "")) + (format "%s%s(<%s>)" (or (ement-room-display-name room) (setf (ement-room-display-name room) (ement--room-display-name room)))