aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/mastodon.el')
-rw-r--r--lisp/mastodon.el102
1 files changed, 50 insertions, 52 deletions
diff --git a/lisp/mastodon.el b/lisp/mastodon.el
index a49d0cc..ae8a795 100644
--- a/lisp/mastodon.el
+++ b/lisp/mastodon.el
@@ -45,60 +45,57 @@
(declare-function discover-add-context-menu "discover")
(declare-function emojify-mode "emojify")
(declare-function request "request")
-(autoload 'special-mode "simple")
+
+(autoload 'mastodon-auth--get-account-name "mastodon-auth")
+(autoload 'mastodon-auth--user-acct "mastodon-auth")
+(autoload 'mastodon-discover "mastodon-discover")
+(autoload 'mastodon-notifications--follow-request-accept "mastodon-notifications")
+(autoload 'mastodon-notifications--follow-request-reject "mastodon-notifications")
+(autoload 'mastodon-notifications--get-mentions "mastodon-notifications")
+(autoload 'mastodon-notifications--timeline "mastodon-notifications")
+(autoload 'mastodon-profile--fetch-server-account-settings "mastodon-profile")
+(autoload 'mastodon-profile--get-toot-author "mastodon-profile")
+(autoload 'mastodon-profile--make-author-buffer "mastodon-profile")
+(autoload 'mastodon-profile--my-profile "mastodon-profile")
+(autoload 'mastodon-profile--show-user "mastodon-profile")
+(autoload 'mastodon-profile--update-user-profile-note "mastodon-profile")
+(autoload 'mastodon-profile--view-bookmarks "mastodon-profile")
+(autoload 'mastodon-profile--view-favourites "mastodon-profile")
+(autoload 'mastodon-search--search-query "mastodon-search")
+(autoload 'mastodon-search--trending-tags "mastodon-search")
+(autoload 'mastodon-search--trending-tags "mastodon-search")
+(autoload 'mastodon-tl--block-user "mastodon-tl")
+(autoload 'mastodon-tl--follow-user "mastodon-tl")
+(autoload 'mastodon-tl--get-buffer-type "mastodon-tl")
(autoload 'mastodon-tl--get-federated-timeline "mastodon-tl")
(autoload 'mastodon-tl--get-home-timeline "mastodon-tl")
(autoload 'mastodon-tl--get-local-timeline "mastodon-tl")
(autoload 'mastodon-tl--get-tag-timeline "mastodon-tl")
(autoload 'mastodon-tl--goto-next-toot "mastodon-tl")
(autoload 'mastodon-tl--goto-prev-toot "mastodon-tl")
+(autoload 'mastodon-tl--init-sync "mastodon-tl")
+(autoload 'mastodon-tl--list-followed-tags "mastodon-tl")
+(autoload 'mastodon-tl--mute-user "mastodon-tl")
(autoload 'mastodon-tl--next-tab-item "mastodon-tl")
+(autoload 'mastodon-tl--poll-vote "mastodon-http")
(autoload 'mastodon-tl--previous-tab-item "mastodon-tl")
(autoload 'mastodon-tl--thread "mastodon-tl")
(autoload 'mastodon-tl--toggle-spoiler-text-in-toot "mastodon-tl")
-(autoload 'mastodon-tl--update "mastodon-tl")
-(autoload 'mastodon-profile--get-toot-author "mastodon-profile")
-(autoload 'mastodon-profile--make-author-buffer "mastodon-profile")
-(autoload 'mastodon-profile--show-user "mastodon-profile")
-(autoload 'mastodon-discover "mastodon-discover")
-(autoload 'mastodon-tl--block-user "mastodon-tl")
(autoload 'mastodon-tl--unblock-user "mastodon-tl")
-(autoload 'mastodon-tl--mute-user "mastodon-tl")
-(autoload 'mastodon-tl--unmute-user "mastodon-tl")
-(autoload 'mastodon-tl--follow-user "mastodon-tl")
(autoload 'mastodon-tl--unfollow-user "mastodon-tl")
-(autoload 'mastodon-profile--my-profile "mastodon-profile")
-(autoload 'mastodon-profile--view-favourites "mastodon-profile")
-(autoload 'mastodon-profile--view-follow-requests "mastodon-profile")
-(autoload 'mastodon-notifications--follow-request-accept "mastodon-notifications")
-(autoload 'mastodon-notifications--follow-request-reject "mastodon-notifications")
-(autoload 'mastodon-search--search-query "mastodon-search")
-(autoload 'mastodon-auth--get-account-name "mastodon-auth")
-;; (autoload 'mastodon-async--stream-federated "mastodon-async")
-;; (autoload 'mastodon-async--stream-local "mastodon-async")
-;; (autoload 'mastodon-async--stream-home "mastodon-async")
-;; (autoload 'mastodon-async--stream-notifications "mastodon-async")
-;; (autoload 'mastodon-async-mode "mastodon-async")
-(autoload 'mastodon-profile--update-user-profile-note "mastodon-profile")
-(autoload 'mastodon-auth--user-acct "mastodon-auth")
-(autoload 'mastodon-tl--poll-vote "mastodon-http")
-(autoload 'mastodon-profile--view-bookmarks "mastodon-profile")
-(autoload 'mastoton-tl--view-filters "mastodon-tl")
-(autoload 'mastodon-tl--view-filters "mastodon-tl")
-(autoload 'mastodon-tl--get-follow-suggestions "mastodon-tl")
+(autoload 'mastodon-tl--unmute-user "mastodon-tl")
+(autoload 'mastodon-tl--update "mastodon-tl")
+(autoload 'mastodon-toot--edit-toot-at-point "mastodon-toot")
(when (require 'lingva nil :no-error)
(autoload 'mastodon-toot--translate-toot-text "mastodon-toot"))
-(autoload 'mastodon-search--trending-tags "mastodon-search")
-(autoload 'mastodon-profile--fetch-server-account-settings "mastodon-profile")
-(autoload 'mastodon-notifications--get-mentions "mastodon-notifications")
-(autoload 'mastodon-tl--view-lists "mastodon-tl")
-(autoload 'mastodon-toot--edit-toot-at-point "mastodon-toot")
(autoload 'mastodon-toot--view-toot-history "mastodon-tl")
-(autoload 'mastodon-tl--init-sync "mastodon-tl")
-(autoload 'mastodon-notifications--timeline "mastodon-notifications")
-(autoload 'mastodon-search--trending-tags "mastodon-search")
-(autoload 'mastodon-tl--view-instance-description "mastodon-tl")
-(autoload 'mastodon-tl--get-buffer-type "mastodon-tl")
+(autoload 'mastodon-views--get-follow-suggestions "mastodon-views")
+(autoload 'mastodon-views--view-filters "mastodon-views")
+(autoload 'mastodon-views--view-follow-requests "mastodon-views")
+(autoload 'mastodon-views--view-instance-description "mastodon-views")
+(autoload 'mastodon-views--view-lists "mastodon-views")
+(autoload 'mastodon-views--view-scheduled-toots "mastodon-views")
+(autoload 'special-mode "simple")
(defvar mastodon-notifications--map)
@@ -194,23 +191,24 @@ Use. e.g. \"%c\" for your locale's date and time format."
(define-key map (kbd "C") #'mastodon-toot--copy-toot-url)
(define-key map (kbd "i") #'mastodon-toot--pin-toot-toggle)
(define-key map (kbd "V") #'mastodon-profile--view-favourites)
- (define-key map (kbd "R") #'mastodon-profile--view-follow-requests)
+ (define-key map (kbd "R") #'mastodon-views--view-follow-requests)
(define-key map (kbd "U") #'mastodon-profile--update-user-profile-note)
(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)
- (define-key map (kbd "X") #'mastodon-tl--view-lists)
+ (define-key map (kbd "I") #'mastodon-views--view-filters)
+ (define-key map (kbd "G") #'mastodon-views--get-follow-suggestions)
+ (define-key map (kbd "X") #'mastodon-views--view-lists)
(define-key map (kbd "@") #'mastodon-notifications--get-mentions)
(define-key map (kbd "e") #'mastodon-toot--edit-toot-at-point)
(define-key map (kbd "E") #'mastodon-toot--view-toot-edits)
(define-key map (kbd "l") #'recenter-top-bottom)
(when (require 'lingva nil :no-error)
(define-key map (kbd "a") #'mastodon-toot--translate-toot-text))
- (define-key map (kbd "s") #'mastodon-tl--view-scheduled-toots)
+ (define-key map (kbd "s") #'mastodon-views--view-scheduled-toots)
(define-key map (kbd "M-C-q") #'mastodon-kill-all-buffers)
- (define-key map (kbd ";") #'mastodon-tl--view-instance-description)
+ (define-key map (kbd ";") #'mastodon-views--view-instance-description)
+ (define-key map (kbd ":") #'mastodon-tl--list-followed-tags)
(define-key map (kbd ",") #'mastodon-toot--list-toot-favouriters)
(define-key map (kbd ".") #'mastodon-toot--list-toot-boosters)
map)
@@ -282,8 +280,9 @@ If REPLY-JSON is the json of the toot being replied to."
Optionally only print notifications of type TYPE, a string.
BUFFER-NAME is added to \"*mastodon-\" to create the buffer name."
(interactive)
- (let ((buffer (or (concat "*mastodon-" buffer-name "*")
- "*mastodon-notifications*")))
+ (let ((buffer (if buffer-name
+ (concat "*mastodon-" buffer-name "*")
+ "*mastodon-notifications*")))
(if (get-buffer buffer)
(progn (switch-to-buffer buffer)
(mastodon-tl--update))
@@ -293,7 +292,8 @@ BUFFER-NAME is added to \"*mastodon-\" to create the buffer name."
"notifications"
'mastodon-notifications--timeline
type)
- (use-local-map mastodon-notifications--map))))
+ (with-current-buffer buffer
+ (use-local-map mastodon-notifications--map)))))
;; URL lookup: should be available even if `mastodon.el' not loaded:
@@ -344,7 +344,7 @@ not, just browse the URL in the normal fashion."
(save-match-data
(or (string-match "^/@[^/]+$" query)
(string-match "^/@[^/]+/[[:digit:]]+$" query)
- (string-match "^/users/[[:alnum:]]+$" query)
+ (string-match "^/user[s]?/[[:alnum:]]+$" query)
(string-match "^/notice/[[:alnum:]]+$" query)
(string-match "^/objects/[-a-f0-9]+$" query)
(string-match "^/notes/[a-z0-9]+$" query)
@@ -372,9 +372,7 @@ Calls `mastodon-tl--get-buffer-type', which see."
"Switch to a live mastodon buffer."
(interactive)
(let* ((bufs (mastodon-live-buffers))
- (buf-names (mapcar (lambda (buf)
- (buffer-name buf))
- bufs))
+ (buf-names (mapcar #'buffer-name bufs))
(choice (completing-read "Switch to mastodon buffer: "
buf-names)))
(switch-to-buffer choice)))