aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-10-13 18:57:45 +0200
committermarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-10-13 22:34:37 +0200
commitf7526642d302ea504f4be2e7dcb5846ecb764ccb (patch)
treed19d3bc4032b9034667c55feca096974500c18db
parentfedba9ed92ed2b4adb12054910bef97f35a15a2a (diff)
add fun mastodon-buffer-p
-rw-r--r--lisp/mastodon.el5
1 files changed, 5 insertions, 0 deletions
diff --git a/lisp/mastodon.el b/lisp/mastodon.el
index 1e6674d..95ae338 100644
--- a/lisp/mastodon.el
+++ b/lisp/mastodon.el
@@ -405,6 +405,11 @@ Calls `mastodon-tl--get-buffer-type', which see."
when (with-current-buffer x (mastodon-tl--get-buffer-type))
collect (get-buffer x)))
+(defun mastodon-buffer-p (&optional buffer)
+ "Non-nil if BUFFER or `current-buffer' is a mastodon one."
+ (let ((buf (or buffer (current-buffer))))
+ (member buf (mastodon-live-buffers))))
+
(defun mastodon-kill-all-buffers ()
"Kill any and all open mastodon buffers, hopefully."
(interactive)