diff options
author | mousebot <mousebot@riseup.net> | 2022-02-16 20:59:05 +0100 |
---|---|---|
committer | mousebot <mousebot@riseup.net> | 2022-02-17 09:58:02 +0100 |
commit | f71bf45d0aee94f360c10c6f121711386c55a457 (patch) | |
tree | 50892bc64b776e4004954145be79a9bcc8995b25 | |
parent | fce69f724310896f7bbb071e74c7a9c1663153de (diff) |
improve check for any existing masto buffers on mastodon load
-rw-r--r-- | lisp/mastodon.el | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lisp/mastodon.el b/lisp/mastodon.el index 51e27ec..6eddd3d 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -204,12 +204,17 @@ Use. e.g. \"%c\" for your locale's date and time format." (let* ((tls (list "home" "local" "federated" - (concat (mastodon-auth--user-acct) "-statuses") ; profile + (concat (mastodon-auth--user-acct) "-statuses") ; own profile "favourites" "search")) - (buffer (cl-some (lambda (el) - (get-buffer (concat "*mastodon-" el "*"))) - tls))) ; return first buff that exists + (buffer (or (cl-some (lambda (el) + (get-buffer (concat "*mastodon-" el "*"))) + tls) ; return first buff that exists + (cl-some (lambda (x) + (when + (string-prefix-p "*mastodon-" (buffer-name x)) + (get-buffer x))) + (buffer-list))))) ; catch any other masto buffer (if buffer (switch-to-buffer buffer) (mastodon-tl--get-home-timeline) |