diff options
Diffstat (limited to 'lisp/mastodon-profile.el')
-rw-r--r-- | lisp/mastodon-profile.el | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index 6065bdd..0458e73 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -78,6 +78,7 @@ (let ((map (make-sparse-keymap))) (define-key map (kbd "s") #'mastodon-profile--open-followers) (define-key map (kbd "g") #'mastodon-profile--open-following) + (define-key map (kbd "C-c C-c") #'mastodon-profile--account-view-cycle) map) "Keymap for `mastodon-profile-mode'.") @@ -88,7 +89,7 @@ (define-key map (kbd "a") #'mastodon-notifications--follow-request-accept) (define-key map (kbd "n") #'mastodon-tl--goto-next-item) (define-key map (kbd "p") #'mastodon-tl--goto-prev-item) - (define-key map (kbd "g") 'mastodon-profile--view-follow-requests) + (define-key map (kbd "g") #'mastodon-profile--view-follow-requests) ;; (define-key map (kbd "t") #'mastodon-toot) ;; (define-key map (kbd "q") #'kill-current-buffer) ;; (define-key map (kbd "Q") #'kill-buffer-and-window) @@ -130,6 +131,19 @@ extra keybindings." (mastodon-profile--make-profile-buffer-for account "statuses" #'mastodon-tl--timeline)) +;; TODO: we shd just load all views' data then switch coz this is slow af: +(defun mastodon-profile-account-view-cycle () + "Cycle through profile view: toots, followers, and following." + (interactive) + (let ((endpoint (plist-get mastodon-tl--buffer-spec 'endpoint))) + (cond ((string-suffix-p "statuses" endpoint) + (mastodon-profile--open-followers)) + ((string-suffix-p "followers" endpoint) + (mastodon-profile--open-following)) + (t + (mastodon-profile--make-profile-buffer-for + mastodon-profile--account "statuses" #'mastodon-tl--timeline))))) + (defun mastodon-profile--open-following () "Open a profile buffer showing the accounts that current profile follows." (interactive) @@ -420,7 +434,8 @@ If toot is a boost, opens the profile of the booster." (if account (progn (message "Loading profile of user %s..." user-handle) - (mastodon-profile--make-author-buffer account)) + (mastodon-profile--make-author-buffer account) + (message "'C-c C-c' to cycle profile views: toots, followers, following")) (message "Cannot find a user with handle %S" user-handle))))) (defun mastodon-profile--my-profile () |