From 6691dab7aa4372192ca23cdbef2ff5c98b9e69b7 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Thu, 12 Oct 2023 17:30:00 +0200 Subject: handle search type buffers in buffer-type --- lisp/mastodon-tl.el | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'lisp') diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index cdc06c9..25ffcd7 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -1573,8 +1573,13 @@ call this function after it is set or use something else." ((mastodon-tl--endpoint-str-= "preferences") 'preferences) ;; search - ((mastodon-tl--endpoint-str-= "search" :suffix) - 'search) + ((mastodon-tl--search-buffer-p) + (cond ((equal (mastodon-search--buf-type) "accounts") + 'search-accounts) + ((equal (mastodon-search--buf-type) "hashtags") + 'search-hashtags) + ((equal (mastodon-search--buf-type) "statuses") + 'search-statuses))) ;; trends ((mastodon-tl--endpoint-str-= "api/v1/trends/statuses") 'trending-statuses) @@ -1612,6 +1617,10 @@ call this function after it is set or use something else." This includes the update profile note buffer, but not the preferences one." (string-prefix-p "accounts" (mastodon-tl--endpoint nil :no-error))) +(defun mastodon-tl--search-buffer-p () + "T if current buffer is a search buffer." + (string-suffix-p "search" (mastodon-tl--endpoint nil :no-error))) + (defun mastodon-tl--timeline-proper-p () "Return non-nil if the current buffer is a \"proper\" timeline. A proper timeline excludes notifications, threads, profiles, and -- cgit v1.2.3