From fb3c01eec51db79d5327ca8492c15477a1ed6963 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Sun, 27 Oct 2024 16:15:29 +0100 Subject: rough search widget search - require widget widget: restore search view heading --- lisp/mastodon-search.el | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lisp/mastodon-search.el b/lisp/mastodon-search.el index 25db7d8..501344b 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") @@ -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 -- cgit v1.2.3