diff options
author | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2023-05-06 14:46:34 +0200 |
---|---|---|
committer | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2023-05-06 14:46:34 +0200 |
commit | 5970c9de908fbb8009de86a2371578de231b3cee (patch) | |
tree | 3c91818739b26a2533712104d71eff628fad821a /lisp/mastodon-search.el | |
parent | 4a4eaa48557c50c393af2a0b499023fad4474a24 (diff) |
Revert "updates to with-mastodon-buffer macro"
This reverts commit 59e5e3ece54bcac36d9debad392bff25a31438b5.
Diffstat (limited to 'lisp/mastodon-search.el')
-rw-r--r-- | lisp/mastodon-search.el | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/lisp/mastodon-search.el b/lisp/mastodon-search.el index 26790ea..86ebb90 100644 --- a/lisp/mastodon-search.el +++ b/lisp/mastodon-search.el @@ -100,7 +100,7 @@ QUERY is the string to search." status-ids-list))) (defun mastodon-search--view-trending (type print-fun) - "Display a list of items trending on your instance. + "Display a list of tags trending on your instance. TYPE is a string, either tags, statuses, or links. PRINT-FUN is the function used to print the data from the response." (let* ((url (mastodon-http--api @@ -119,19 +119,22 @@ PRINT-FUN is the function used to print the data from the response." (message "todo")))) (buffer (get-buffer-create (format "*mastodon-trending-%s*" type)))) - (with-mastodon-buffer - buffer #'mastodon-mode nil - (mastodon-tl--set-buffer-spec (buffer-name buffer) - (format "api/v1/trends/%s" type) - nil) - (insert (mastodon-tl--set-face - (concat "\n " mastodon-tl--horiz-bar "\n" - (upcase (format " TRENDING %s\n" type)) - " " mastodon-tl--horiz-bar "\n\n") - 'success)) - (funcall print-fun data) - (unless (equal type "statuses") - (goto-char (point-min)))))) + (with-current-buffer buffer + (switch-to-buffer (current-buffer)) + (mastodon-mode) + (let ((inhibit-read-only t)) + (erase-buffer) + (mastodon-tl--set-buffer-spec (buffer-name buffer) + (format "api/v1/trends/%s" type) + nil) + (insert (mastodon-tl--set-face + (concat "\n " mastodon-tl--horiz-bar "\n" + (upcase (format " TRENDING %s\n" type)) + " " mastodon-tl--horiz-bar "\n\n") + 'success)) + (funcall print-fun data) + (unless (equal type "statuses") + (goto-char (point-min))))))) ;; functions for mastodon search @@ -152,7 +155,7 @@ PRINT-FUN is the function used to print the data from the response." (toots-list-json (mastodon-search--get-full-statuses-data statuses))) (with-mastodon-buffer - buffer #'mastodon-mode nil + buffer (mastodon-tl--set-buffer-spec buffer "api/v2/search" nil) |