diff options
author | marty hiatt <martianhiatus@riseup.net> | 2024-06-04 11:42:42 +0200 |
---|---|---|
committer | marty hiatt <martianhiatus@riseup.net> | 2024-06-04 11:42:42 +0200 |
commit | daf97c3d8fc3560fb3d79aaffcfebf65802af4e2 (patch) | |
tree | d716ab5cd8e74d197f724a52e674ff7a5b9d018c /lisp | |
parent | 5e7e38a81a99e110ec62c0ccc622eb3c4b476cbc (diff) |
factor out format-heading from insert-heading
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/mastodon-search.el | 20 |
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")) |