diff options
author | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2022-11-21 10:20:59 +0100 |
---|---|---|
committer | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2022-11-21 10:20:59 +0100 |
commit | abbdef12e38c97e571ae8f664596fcf931cb4292 (patch) | |
tree | a75751f73d085f8130ac4c5b181ae8c5cc8a31e5 /lisp/mastodon-search.el | |
parent | 583dad59590bd6423138053b67961cf39fe81d02 (diff) | |
parent | 6e75db20584272ee4a9954129359f5e19d737d75 (diff) |
Merge branch 'develop'
Diffstat (limited to 'lisp/mastodon-search.el')
-rw-r--r-- | lisp/mastodon-search.el | 48 |
1 files changed, 26 insertions, 22 deletions
diff --git a/lisp/mastodon-search.el b/lisp/mastodon-search.el index d161544..31fcae3 100644 --- a/lisp/mastodon-search.el +++ b/lisp/mastodon-search.el @@ -162,34 +162,38 @@ QUERY is the string to search." (defun mastodon-search--insert-users-propertized (json &optional note) "Insert users list into the buffer. -JSON is the data from the server.. If NOTE is non-nil, include +JSON is the data from the server. If NOTE is non-nil, include user's profile note. This is also called by `mastodon-tl--get-follow-suggestions' and `mastodon-profile--insert-follow-requests'." (mapc (lambda (acct) - (let ((user (mastodon-search--get-user-info acct))) - (insert - (propertize - (concat (propertize (car user) - 'face 'mastodon-display-name-face - 'byline t - 'toot-id "0") - " : \n : " - (propertize (concat "@" (cadr user)) - 'face 'mastodon-handle-face - 'mouse-face 'highlight - 'mastodon-tab-stop 'user-handle - 'keymap mastodon-tl--link-keymap - 'mastodon-handle (concat "@" (cadr user)) - 'help-echo (concat "Browse user profile of @" (cadr user))) - " : \n" - (if note - (mastodon-tl--render-text (cadddr user) nil) - "") - "\n") - 'toot-json acct)))) ; so named for compat w other processing functions + (insert (mastodon-search--propertize-user acct note))) json)) +(defun mastodon-search--propertize-user (acct &optional note) + "Propertize display string for ACCT, optionally including profile +NOTE." + (let ((user (mastodon-search--get-user-info acct))) + (propertize + (concat (propertize (car user) + 'face 'mastodon-display-name-face + 'byline t + 'toot-id "0") + " : \n : " + (propertize (concat "@" (cadr user)) + 'face 'mastodon-handle-face + 'mouse-face 'highlight + 'mastodon-tab-stop 'user-handle + 'keymap mastodon-tl--link-keymap + 'mastodon-handle (concat "@" (cadr user)) + 'help-echo (concat "Browse user profile of @" (cadr user))) + " : \n" + (if note + (mastodon-tl--render-text (cadddr user) nil) + "") + "\n") + 'toot-json acct))) ; so named for compat w other processing functions + (defun mastodon-search--print-tags-list (tags) "Insert a propertized list of TAGS." (mapc (lambda (el) |