diff options
author | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2023-05-06 14:47:31 +0200 |
---|---|---|
committer | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2023-05-06 14:47:31 +0200 |
commit | 7ca70346ac60436c359a754de56842fdc7280fe3 (patch) | |
tree | 64bc358ea37bb2773d5d4b3f3cef1db70adeab72 /lisp/mastodon-search.el | |
parent | 5970c9de908fbb8009de86a2371578de231b3cee (diff) |
Revert "with-mastodon-buffer macro"
This reverts commit 51f8b782ac6721939e20eca459fe88eb4304857c.
Diffstat (limited to 'lisp/mastodon-search.el')
-rw-r--r-- | lisp/mastodon-search.el | 58 |
1 files changed, 30 insertions, 28 deletions
diff --git a/lisp/mastodon-search.el b/lisp/mastodon-search.el index 86ebb90..8cfa3cb 100644 --- a/lisp/mastodon-search.el +++ b/lisp/mastodon-search.el @@ -35,7 +35,6 @@ (autoload 'mastodon-http--get-json "mastodon-http") (autoload 'mastodon-http--get-search-json "mastodon-http") (autoload 'mastodon-mode "mastodon") -(autoload 'with-mastodon-buffer "mastodon") (autoload 'mastodon-tl--as-string "mastodon-tl") (autoload 'mastodon-tl--as-string "mastodon-tl") (autoload 'mastodon-tl--render-text "mastodon-tl") @@ -154,33 +153,36 @@ PRINT-FUN is the function used to print the data from the response." tags)) (toots-list-json (mastodon-search--get-full-statuses-data statuses))) - (with-mastodon-buffer - buffer - (mastodon-tl--set-buffer-spec buffer - "api/v2/search" - nil) - ;; user results: - (insert (mastodon-tl--set-face - (concat "\n " mastodon-tl--horiz-bar "\n" - " USERS\n" - " " mastodon-tl--horiz-bar "\n\n") - 'success)) - (mastodon-search--insert-users-propertized accts :note) - ;; hashtag results: - (insert (mastodon-tl--set-face - (concat "\n " mastodon-tl--horiz-bar "\n" - " HASHTAGS\n" - " " mastodon-tl--horiz-bar "\n\n") - 'success)) - (mastodon-search--print-tags-list tags-list) - ;; status results: - (insert (mastodon-tl--set-face - (concat "\n " mastodon-tl--horiz-bar "\n" - " STATUSES\n" - " " mastodon-tl--horiz-bar "\n") - 'success)) - (mapc #'mastodon-tl--toot toots-list-json) - (goto-char (point-min))))) + (with-current-buffer (get-buffer-create buffer) + (switch-to-buffer buffer) + (mastodon-mode) + (let ((inhibit-read-only t)) + (erase-buffer) + (mastodon-tl--set-buffer-spec buffer + "api/v2/search" + nil) + ;; user results: + (insert (mastodon-tl--set-face + (concat "\n " mastodon-tl--horiz-bar "\n" + " USERS\n" + " " mastodon-tl--horiz-bar "\n\n") + 'success)) + (mastodon-search--insert-users-propertized accts :note) + ;; hashtag results: + (insert (mastodon-tl--set-face + (concat "\n " mastodon-tl--horiz-bar "\n" + " HASHTAGS\n" + " " mastodon-tl--horiz-bar "\n\n") + 'success)) + (mastodon-search--print-tags-list tags-list) + ;; status results: + (insert (mastodon-tl--set-face + (concat "\n " mastodon-tl--horiz-bar "\n" + " STATUSES\n" + " " mastodon-tl--horiz-bar "\n") + 'success)) + (mapc #'mastodon-tl--toot toots-list-json) + (goto-char (point-min)))))) (defun mastodon-search--insert-users-propertized (json &optional note) "Insert users list into the buffer. |