aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-search.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/mastodon-search.el')
-rw-r--r--lisp/mastodon-search.el58
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.