branch: elpa/fedi
commit 3e6a78d0b6ba5706b6c709119acd00626f2c98f7
Merge: 870e9487968 5bb083fdeff
Author: marty hiatt <[email protected]>
Commit: marty hiatt <[email protected]>

    Merge branch 'main' into dev
---
 fedi.el    | 22 +++++++++++++++-------
 readme.org |  6 +++---
 2 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/fedi.el b/fedi.el
index 52fe4aa7397..51c4af849c6 100644
--- a/fedi.el
+++ b/fedi.el
@@ -281,7 +281,9 @@ text, i.e. hidden spoiler text."
     (replied   . ("⬇" . "↓"))
     (community . ("👪" . "[community]"))
     (reply-bar . ("│" . "|")) ;┃
-    (deleted   . ("🗑" . "[deleted]")))
+    (deleted   . ("🗑" . "[deleted]"))
+    (plus      . ("+" . "+"))
+    (minus     . ("-" . "-")))
   "A set of symbols (and fallback strings) to be used in timeline.
 If a symbol does not look right (tofu), it means your
 font settings do not support it."
@@ -587,18 +589,24 @@ candidate's car, a string, usually its name or a handle."
          (completion-extra-properties
           (when list
             (list :annotation-function
-                  (lambda (i)
-                    (let ((annot (nth 2 (assoc i list #'equal))))
-                      (concat
-                       (propertize " " 'display
-                                   '(space :align-to (- right-margin 51)))
-                       (string-limit (car (string-lines annot)) 50)))))))
+                  (lambda (cand)
+                    (funcall #'fedi-annot-fun cand list)))))
          (choice (when list (completing-read prompt list)))
          (id (when list (nth 1 (assoc choice list #'equal)))))
     (if (not list)
         (user-error "No items returned")
       (funcall action-fun id choice))))
 
+(defun fedi-annot-fun (cand list)
+  "Annotation function for `fedi-do-item-completing'.
+Given CAND, return from LIST its annotation."
+  (let ((annot (nth 2
+                    (assoc cand list #'equal))))
+    (concat
+     (propertize " " 'display
+                 '(space :align-to (- right-margin 51)))
+     (string-limit (car (string-lines annot)) 50))))
+
 (defun fedi-response-msg (response &optional key value format-str)
   "Check RESPONSE, JSON from the server, and message on success.
 Used to handle server responses after the user
diff --git a/readme.org b/readme.org
index 2e9f57a4b1f..177bb5673b4 100644
--- a/readme.org
+++ b/readme.org
@@ -47,6 +47,6 @@ completion of items like handles and tags.
 * contributing
 
 If you're making an Emacs to a fediverse (or similar) service and interested
-in using this library, don't hesitate to get in touch. The library was only
-created to port code from =mastodon.el= to =lem.el=, but could happily be 
further
-adapted to accommodate other projects.
+in using this library, don't hesitate to get in touch. The library was
+originally created to abstract code out of =mastodon.el= for use in =lem.el=, 
but
+could happily be further adapted to accommodate other projects.

Reply via email to