diff options
-rw-r--r-- | lisp/mastodon-search.el | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/lisp/mastodon-search.el b/lisp/mastodon-search.el index 41e4f23..3fd552d 100644 --- a/lisp/mastodon-search.el +++ b/lisp/mastodon-search.el @@ -122,22 +122,20 @@ PRINT-FUN is the function used to print the data from the response." (format "trends/%s" type) print-fun nil params) - (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)) + (mastodon-search--insert-heading "trending" type) (funcall print-fun data) (unless (equal type "statuses") (goto-char (point-min)))))) ;; functions for mastodon search -(defun mastodon-search--format-heading (heading) - "Format HEADING as a heading." +(defun mastodon-search--insert-heading (heading &optional type) + "Format HEADING as a heading. +Optionally add string TYPE after HEADING." (insert (mastodon-tl--set-face (concat "\n " mastodon-tl--horiz-bar "\n " - heading "\n" + (upcase heading) " " + (if type (upcase type) "") "\n" " " mastodon-tl--horiz-bar "\n") 'success))) @@ -186,7 +184,7 @@ is used for pagination." (alist-get 'statuses response)))) (with-mastodon-buffer buffer #'mastodon-mode nil (mastodon-search-mode) - (mastodon-search--format-heading (upcase type)) + (mastodon-search--insert-heading type) ;; user results: (cond ((equal type "accounts") (mastodon-search--render-response accts type buffer params |