aboutsummaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus@riseup.net>2024-06-04 11:42:42 +0200
committermarty hiatt <martianhiatus@riseup.net>2024-06-04 11:42:42 +0200
commitdaf97c3d8fc3560fb3d79aaffcfebf65802af4e2 (patch)
treed716ab5cd8e74d197f724a52e674ff7a5b9d018c /lisp
parent5e7e38a81a99e110ec62c0ccc622eb3c4b476cbc (diff)
factor out format-heading from insert-heading
Diffstat (limited to 'lisp')
-rw-r--r--lisp/mastodon-search.el20
1 files changed, 13 insertions, 7 deletions
diff --git a/lisp/mastodon-search.el b/lisp/mastodon-search.el
index d73bf9f..e69366e 100644
--- a/lisp/mastodon-search.el
+++ b/lisp/mastodon-search.el
@@ -122,15 +122,21 @@ PRINT-FUN is the function used to print the data from the response."
;; functions for mastodon search
-(defun mastodon-search--insert-heading (heading &optional type)
- "Format HEADING as a heading.
+(defun mastodon-search--insert-heading (str &optional type)
+ "Insert STR as a heading.
Optionally add string TYPE after HEADING."
(insert
- (mastodon-tl--set-face (concat "\n " mastodon-tl--horiz-bar "\n "
- (upcase heading) " "
- (if type (upcase type) "") "\n"
- " " mastodon-tl--horiz-bar "\n")
- 'success)))
+ (mastodon-search--format-heading str type)))
+
+(defun mastodon-search--format-heading (str &optional type)
+ "Format STR as a heading.
+Optionally add string TYPE after HEADING."
+ (mastodon-tl--set-face
+ (concat "\n " mastodon-tl--horiz-bar "\n "
+ (upcase str) " "
+ (if type (upcase type) "") "\n"
+ " " mastodon-tl--horiz-bar "\n")
+ 'success))
(defvar mastodon-search-types
'("statuses" "accounts" "hashtags"))