diff options
Diffstat (limited to 'lisp/mastodon.el')
-rw-r--r-- | lisp/mastodon.el | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/lisp/mastodon.el b/lisp/mastodon.el index 6daa755..49abe26 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -6,7 +6,7 @@ ;; Maintainer: Marty Hiatt <martianhiatus@riseup.net> ;; Version: 0.10.0 ;; Package-Requires: ((emacs "27.1") (request "0.3.2") (seq "1.0")) -;; Homepage: https://git.blast.noho.st/mouse/mastodon.el +;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. @@ -33,7 +33,6 @@ ;;; Code: (require 'cl-lib) ; for `cl-some' call in mastodon -;; hack to make mastodon-toot customizes visible prior to running mastodon-toot: (require 'mastodon-toot) (declare-function discover-add-context-menu "discover") @@ -87,8 +86,12 @@ (autoload 'mastodon-tl--poll-vote "mastodon-http") ;; (autoload 'mastodon-toot--delete-and-redraft-toot "mastodon-toot") (autoload 'mastodon-profile--view-bookmarks "mastodon-profile") +(autoload 'mastoton-tl--view-filters "mastodon-tl") ;; (autoload 'mastodon-toot--bookmark-toot-toggle "mastodon-toot") +(when (require 'lingva nil :no-error) + (autoload 'mastodon-toot--translate-toot-text "mastodon-toot")) + (defgroup mastodon nil "Interface with Mastodon." :prefix "mastodon-" @@ -193,6 +196,10 @@ Use. e.g. \"%c\" for your locale's date and time format." (define-key map (kbd "v") #'mastodon-tl--poll-vote) (define-key map (kbd "k") #'mastodon-toot--bookmark-toot-toggle) (define-key map (kbd "K") #'mastodon-profile--view-bookmarks) + (define-key map (kbd "I") #'mastodon-tl--view-filters) + (define-key map (kbd "G") #'mastodon-tl--get-follow-suggestions) + (when (require 'lingva nil :no-error) + (define-key map (kbd "s") #'mastodon-toot--translate-toot-text)) map) "Keymap for `mastodon-mode'.") @@ -230,12 +237,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) |