aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-search.el
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus@disroot.org>2024-10-29 10:17:57 +0100
committermarty hiatt <martianhiatus@disroot.org>2024-10-29 10:17:57 +0100
commitbc11edccc2c292972e2e0c08bc81a9e29c2cf048 (patch)
tree3dfd1b191998b7369e8812c449b87a637726d43d /lisp/mastodon-search.el
parent31df8d9a0ae57342961ff46fe032c6871d2cefbb (diff)
parent7d23c74ed57a56a1a0b640c4cf443c269486ab09 (diff)
Merge branch 'develop'
Diffstat (limited to 'lisp/mastodon-search.el')
-rw-r--r--lisp/mastodon-search.el13
1 files changed, 11 insertions, 2 deletions
diff --git a/lisp/mastodon-search.el b/lisp/mastodon-search.el
index 25db7d8..5f1e980 100644
--- a/lisp/mastodon-search.el
+++ b/lisp/mastodon-search.el
@@ -29,6 +29,7 @@
;;; Code:
(require 'json)
(require 'mastodon-tl)
+(require 'mastodon-widget)
(autoload 'mastodon-auth--access-token "mastodon-auth")
(autoload 'mastodon-http--api "mastodon-http")
@@ -193,7 +194,7 @@ is used for pagination."
(following (when (or following (equal current-prefix-arg '(4)))
"true"))
(type (or type
- (if (eq current-prefix-arg '(4))
+ (if (equal current-prefix-arg '(4))
"accounts" ; if FOLLOWING, must be "accounts"
(completing-read "Search type: "
mastodon-search-types nil :match))))
@@ -211,7 +212,15 @@ is used for pagination."
(items (alist-get (intern type) response)))
(with-mastodon-buffer buffer #'mastodon-mode nil
(mastodon-search-mode)
- (mastodon-search--insert-heading type)
+ (mastodon-search--insert-heading "search")
+ (mastodon-widget--create
+ "Results"
+ '(accounts hashtags statuses)
+ (intern type)
+ (lambda (widget &rest _ignore)
+ (let ((value (widget-value widget)))
+ (mastodon-search--query query (symbol-name value)))))
+ (insert "\n\n")
(cond ((string= type "accounts")
(mastodon-search--render-response items type buffer params
'mastodon-views--insert-users-propertized-note