From 781a0f97e318e6d0e2e0c9a5bf355b268a696348 Mon Sep 17 00:00:00 2001 From: David Masterson Date: Thu, 9 Mar 2023 12:48:32 -0800 Subject: Add Makefile, update README.org, rm mastodon.info --- README.org | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'README.org') diff --git a/README.org b/README.org index 71eb52c..d26b6f8 100644 --- a/README.org +++ b/README.org @@ -1,3 +1,7 @@ +#+TEXINFO_DIR_CATEGORY: Emacs +#+TEXINFO_DIR_TITLE: Mastodon: (mastodon). +#+TEXINFO_DIR_DESC: Client for Mastodon on ActivityPub networks. + @@html: MELPA@@ @@html: Build Status@@ -- cgit v1.2.3 From 3256115d3cf48c778dd8feb5ed5319d0aa1d4071 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Thu, 16 Mar 2023 15:10:40 +0100 Subject: readme: add --dm-user --- README.org | 3 +++ 1 file changed, 3 insertions(+) (limited to 'README.org') diff --git a/README.org b/README.org index 0e99564..59cc72c 100644 --- a/README.org +++ b/README.org @@ -259,6 +259,9 @@ work without first loading =mastodon.el=: - =mastodon-tl--add-toot-account-at-point-to-list=: Add the account of the toot at point to a list. +- =mastodon-tl--dm-user=: Send a direct message to one of the users at point. + + - =mastodon-tl--follow-tag=: Follow a tag (works like following a user) - =mastodon-tl--unfollow-tag=: Unfollow a tag - =mastodon-tl--list-followed-tags=: View a list of tags you're following. -- cgit v1.2.3 From bfa6ec8b67394b05de70c490a016b9bd9dfc1a8c Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Thu, 16 Mar 2023 19:34:20 +0100 Subject: readme re private notes --- README.org | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'README.org') diff --git a/README.org b/README.org index 59cc72c..f5ee0b5 100644 --- a/README.org +++ b/README.org @@ -262,6 +262,10 @@ work without first loading =mastodon.el=: - =mastodon-tl--dm-user=: Send a direct message to one of the users at point. +- =mastodon-profile--add-private-note-to-account=: Add a private note to another user’s account. +- =mastodon-profile--view-account-private-note=: View a private note on a user’s account. + + - =mastodon-tl--follow-tag=: Follow a tag (works like following a user) - =mastodon-tl--unfollow-tag=: Unfollow a tag - =mastodon-tl--list-followed-tags=: View a list of tags you're following. -- cgit v1.2.3 From e0ee8cbfa8e0e883f800ea09dbcff844f988fffb Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Sat, 18 Mar 2023 21:33:45 +0100 Subject: factor grab-profile-json, and handle familiar followers. FIX #404 --- README.org | 3 +++ lisp/mastodon-profile.el | 42 +++++++++++++++++++++++++++++++++++++----- 2 files changed, 40 insertions(+), 5 deletions(-) (limited to 'README.org') diff --git a/README.org b/README.org index f5ee0b5..4a9be3d 100644 --- a/README.org +++ b/README.org @@ -266,6 +266,9 @@ work without first loading =mastodon.el=: - =mastodon-profile--view-account-private-note=: View a private note on a user’s account. +- =mastodon-profile--show-familiar-followers=: Show a list of “familiar followers” for a given account. Familiar followers are accounts that you follow, and that follow the account. + + - =mastodon-tl--follow-tag=: Follow a tag (works like following a user) - =mastodon-tl--unfollow-tag=: Unfollow a tag - =mastodon-tl--list-followed-tags=: View a list of tags you're following. diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index e6f5853..3661615 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -938,15 +938,19 @@ NOTE-OLD is the text of any existing note." (let ((inhibit-read-only t)) (princ note)))) +(defun mastodon-profile--grab-profile-json () + "Return the profile-json property if we are in a profile buffer." + (when (mastodon-tl--profile-buffer-p) + (save-excursion + (goto-char (point-min)) + (or (mastodon-tl--property 'profile-json) + (error "No profile data found"))))) + (defun mastodon-profile--add-or-view-private-note (action-fun &optional message view) "Add or view a private note for an account. ACTION-FUN does the adding or viewing, MESSAGE is a prompt for `mastodon-tl--interactive-user-handles-get', VIEW is a flag." - (let* ((profile-json (when (mastodon-tl--profile-buffer-p) - (save-excursion - (goto-char (point-min)) - (or (mastodon-tl--property 'profile-json) - (error "No profile data found"))))) + (let* ((profile-json (mastodon-profile--grab-profile-json)) (handle (if (mastodon-tl--profile-buffer-p) (alist-get 'acct profile-json) (mastodon-tl--interactive-user-handles-get message))) @@ -962,5 +966,33 @@ ACTION-FUN does the adding or viewing, MESSAGE is a prompt for (funcall action-fun note)) (funcall action-fun id handle note)))) +(defun mastodon-profile--show-familiar-followers () + "Show a list of familiar followers. +Familiar followers are accounts that you follow, and that follow +the given account." + (interactive) + (let* ((profile-json (mastodon-profile--grab-profile-json)) + (handle + (if (mastodon-tl--profile-buffer-p) + (alist-get 'acct profile-json) + (mastodon-tl--interactive-user-handles-get "show familiar followers of"))) + (account (if (mastodon-tl--profile-buffer-p) + profile-json + (mastodon-profile--search-account-by-handle handle))) + (id (alist-get 'id account))) + (mastodon-profile--get-familiar-followers id))) + +(defun mastodon-profile--get-familiar-followers (id) + "Return JSON data of familiar followers for account ID." + ;; the server can handle multiple IDs, but for now we just handle one. + (let* ((params `(("id" . ,id))) + (url (mastodon-http--api "accounts/familiar_followers")) + (json (mastodon-http--get-json url params)) + (accounts (alist-get 'accounts (car json))) ; first id result + (handles (mastodon-tl--map-get-accts accounts)) + (choice (completing-read "Show profile of user: " + handles))) + (mastodon-profile--show-user choice))) + (provide 'mastodon-profile) ;;; mastodon-profile.el ends here -- cgit v1.2.3 From 4c1ba801c2f72b1f58e084ba3e68ec498a7fb62c Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Tue, 21 Mar 2023 11:50:43 +0100 Subject: readme re toot stats customize --- README.org | 1 + 1 file changed, 1 insertion(+) (limited to 'README.org') diff --git a/README.org b/README.org index a1cbc4d..dfbf452 100644 --- a/README.org +++ b/README.org @@ -310,6 +310,7 @@ See =M-x customize-group RET mastodon= to view all customize options. - Avatar image height - Enable image caching - Hide replies in timelines + - Show toot stats in byline - Compose options: - Completion style for mentions and tags -- cgit v1.2.3 From 5e2eaa095226df7ce8c05d1d77e3ec1671a768cf Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Tue, 21 Mar 2023 11:54:47 +0100 Subject: readme re bookmarks / bookmark+.el --- README.org | 3 +++ 1 file changed, 3 insertions(+) (limited to 'README.org') diff --git a/README.org b/README.org index dfbf452..3ed0ab0 100644 --- a/README.org +++ b/README.org @@ -360,6 +360,9 @@ to your translator function as its text argument. Here's what (message "No toot to translate?")))) #+end_src +*** bookmarks and =mastodon.el= +=mastodon.el= doesn’t currently implement its own bookmark record and handler, which means that emacs bookmarks will not work as is. Until we implement them, you can get bookmarks going immediately by using [[https://github.com/emacsmirror/emacswiki.org/blob/master/bookmark%2b.el][bookmark+.el]]. + ** Dependencies Hard dependencies (should all install with =mastodon.el=): -- cgit v1.2.3 From 8e0444beab82a839e2fabec659e81f11a76c37e3 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Tue, 21 Mar 2023 16:17:22 +0100 Subject: bindings in readme and discover.el --- README.org | 12 ++-- lisp/mastodon-discover.el | 144 ++++++++++++++++++++++++---------------------- 2 files changed, 81 insertions(+), 75 deletions(-) (limited to 'README.org') diff --git a/README.org b/README.org index 3ed0ab0..24e14e1 100644 --- a/README.org +++ b/README.org @@ -118,8 +118,8 @@ not contain =:client_id= and =:client_secret=. | =?= | Show discover menu of all bindings, if =discover= is available | |----------------+---------------------------------------------------------------------------| | | *Timeline actions* | -| =n= | Go to next item (toot, notification) | -| =p= | Go to previous item (toot, notification) | +| =n= | Go to next item (toot, notification, user) | +| =p= | Go to previous item (toot, notification, user) | | =M-n=/== | Go to the next interesting thing that has an action | | =M-p=/== | Go to the previous interesting thing that has an action | | =F= | Open federated timeline | @@ -135,18 +135,20 @@ not contain =:client_id= and =:client_secret=. | =O= | View own profile | | =U= | update your profile bio note | | =;= | view instance description for toot at point | +| =:= | view your list of followed tags and load its timeline | | =,= | view favouriters of toot at point | | =.= | view boosters of toot at point | +| =/= | switch between mastodon buffers | |----------------+---------------------------------------------------------------------------| | | *Other views* | -| =S= | search (posts, users, tags) (NB: only posts you have interacted with) | +| =s= | search (posts, users, tags) (NB: only posts you have interacted with) | | =I=, =c=, =d= | view, create, and delete filters | | =R=, =a=, =j= | view/accept/reject follow requests | | =G= | view follow suggestions | | =V= | view your favourited toots | | =K= | view bookmarked toots | | =X= | view/edit/create/delete lists | -| =s= | view your scheduled toots | +| =S= | view your scheduled toots | |----------------+---------------------------------------------------------------------------| | | *Toot actions* | | =t= | Compose a new toot | @@ -166,7 +168,7 @@ not contain =:client_id= and =:client_secret=. | (=S-C-=) =W=, =M=, =B= | (un)follow, (un)mute, (un)block author of toot at point | |----------------+---------------------------------------------------------------------------| | | *Profile view* | -| =C-c C-c= | cycle between statuses, followers, following, and statuses without boosts | +| =C-c C-c= | cycle between statuses, statuses without boosts, followers, and following | | | =mastodon-profile--account-account-to-list= (see lists view) | |----------------+---------------------------------------------------------------------------| | | *Notifications view* | diff --git a/lisp/mastodon-discover.el b/lisp/mastodon-discover.el index b549ce1..958df92 100644 --- a/lisp/mastodon-discover.el +++ b/lisp/mastodon-discover.el @@ -45,75 +45,79 @@ :bind "?" :mode 'mastodon-mode :mode-hook 'mastodon-mode-hook - :context-menu '(mastodon - (description "Mastodon feed viewer") - (actions - ("Toots" - ("A" "View profile of author" mastodon-profile--get-toot-author) - ("b" "Boost" mastodon-toot--boost) - ("f" "Favourite" mastodon-toot--favourite) - ("c" "Toggle hidden text (CW)" mastodon-tl--toggle-spoiler-text-in-toot) - ("k" "Bookmark toot" mastodon-toot--toggle-bookmark) - ("v" "Vote on poll" mastodon-tl--poll-vote) - ("n" "Next" mastodon-tl--goto-next-toot) - ("p" "Prev" mastodon-tl--goto-prev-toot) - ("TAB" "Next link item" mastodon-tl--next-tab-item) - ("S-TAB" "Prev link item" mastodon-tl--previous-tab-item) - ;; NB: (when (require 'mpv etc. calls don't work here - ("C-RET" "Play media" mastodon-tl--mpv-play-video-at-point) - ("t" "New toot" mastodon-toot) - ("r" "Reply" mastodon-toot--reply) - ("C" "Copy toot URL" mastodon-toot--copy-toot-url) - ("d" "Delete (your) toot" mastodon-toot--delete-toot) - ("D" "Delete and redraft (your) toot" mastodon-toot--delete-toot) - ("e" "Edit (your) toot" mastodon-toot--edit-toot-at-point) - ("E" "View edits of (your) toot" mastodon-toot--view-toot-edits) - ("i" "Pin/Unpin (your) toot" mastodon-toot--pin-toot-toggle) - ("P" "View user profile" mastodon-profile--show-user) - ("a" "Translate toot at point" mastodon-toot--translate-toot-text) - ("T" "View thread" mastodon-tl--thread) - ("v" "Vote on poll" mastodon-tl--poll-vote) - ("," "View toot's favouriters" mastodon-toot--list-toot-favouriters) - ("." "View toot's boosters" mastodon-toot--list-toot-boosters)) - ("Views" - ("h/?" "View mode help/keybindings" describe-mode) - ("#" "Tag search" mastodon-tl--get-tag-timeline) - ("F" "Federated" mastodon-tl--get-federated-timeline) - ("H" "Home" mastodon-tl--get-home-timeline) - ("L" "Local" mastodon-tl--get-local-timeline) - ("N" "Notifications" mastodon-notifications-get) - ("@" "Notifications with mentions" mastodon-notifications--get-mentions) - ("u" "Update timeline" mastodon-tl--update) - ("S" "Search" mastodon-search--search-query) - ("O" "Jump to your profile" mastodon-profile--my-profile) - ("U" "Update your profile note" mastodon-profile--update-user-profile-note) - ("K" "View bookmarks" mastodon-profile--view-bookmarks) - ("V" "View favourites" mastodon-profile--view-favourites) - ("R" "View follow requests" mastodon-profile--view-follow-requests) - ("G" "View follow suggestions" mastodon-tl--get-follow-suggestions) - ("I" "View filters" mastodon-tl--view-filters) - ("X" "View lists" mastodon-tl--view-lists) - ("s" "View scheduled toots" mastodon-tl--view-scheduled-toots) - (";" "View instance description" mastodon-tl--view-instance-description)) - ("Users" - ("W" "Follow" mastodon-tl--follow-user) - ("C-S-W" "Unfollow" mastodon-tl--unfollow-user) - ("M" "Mute" mastodon-tl--mute-user) - ("C-S-M" "Unmute" mastodon-tl--unmute-user) - ("B" "Block" mastodon-tl--block-user) - ("C-S-B" "Unblock" mastodon-tl--unblock-user)) - ("Images" - ;; RET errors here also :/ - ("/i" "Load full image in browser" 'shr-browse-image) - ("r" "rotate" 'image-rotate) - ("+" "zoom in" 'image-increase-size) - ("-" "zoom out" 'image-decrease-size) - ("u" "copy URL" 'shr-maybe-probe-and-copy-url)) - ("Profile view" - ("C-c C-c" "Cycle profile views" mastodon-profile--account-view-cycle)) - ("Quit" - ("q" "Quit mastodon and bury buffer." kill-this-buffer) - ("Q" "Quit mastodon buffer and kill window." kill-buffer-and-window))))))) + :context-menu + '(mastodon + (description "Mastodon feed viewer") + (actions + ("Toots" + ("A" "View profile of author" mastodon-profile--get-toot-author) + ("b" "Boost" mastodon-toot--boost) + ("f" "Favourite" mastodon-toot--favourite) + ("c" "Toggle hidden text (CW)" mastodon-tl--toggle-spoiler-text-in-toot) + ("k" "Bookmark toot" mastodon-toot--toggle-bookmark) + ("v" "Vote on poll" mastodon-tl--poll-vote) + ("n" "Next" mastodon-tl--goto-next-toot) + ("p" "Prev" mastodon-tl--goto-prev-toot) + ("TAB" "Next link item" mastodon-tl--next-tab-item) + ("S-TAB" "Prev link item" mastodon-tl--previous-tab-item) + ;; NB: (when (require 'mpv etc. calls don't work here + ("C-RET" "Play media" mastodon-tl--mpv-play-video-at-point) + ("t" "New toot" mastodon-toot) + ("r" "Reply" mastodon-toot--reply) + ("C" "Copy toot URL" mastodon-toot--copy-toot-url) + ("d" "Delete (your) toot" mastodon-toot--delete-toot) + ("D" "Delete and redraft (your) toot" mastodon-toot--delete-toot) + ("e" "Edit (your) toot" mastodon-toot--edit-toot-at-point) + ("E" "View edits of (your) toot" mastodon-toot--view-toot-edits) + ("i" "Pin/Unpin (your) toot" mastodon-toot--pin-toot-toggle) + ("P" "View user profile" mastodon-profile--show-user) + ("a" "Translate toot at point" mastodon-toot--translate-toot-text) + ("T" "View thread" mastodon-tl--thread) + ("v" "Vote on poll" mastodon-tl--poll-vote) + ("," "View toot's favouriters" mastodon-toot--list-toot-favouriters) + ("." "View toot's boosters" mastodon-toot--list-toot-boosters) + ("/" "Switch buffers" mastodon-switch-to-buffer)) + ("Views" + ("h/?" "View mode help/keybindings" describe-mode) + ("#" "Tag search" mastodon-tl--get-tag-timeline) + (";" "List followed tags" mastodon-tl--list-followed-tags) + ("F" "Federated" mastodon-tl--get-federated-timeline) + ("H" "Home" mastodon-tl--get-home-timeline) + ("L" "Local" mastodon-tl--get-local-timeline) + ("N" "Notifications" mastodon-notifications-get) + ("@" "Notifications with mentions" mastodon-notifications--get-mentions) + ("g/u" "Update timeline" mastodon-tl--update) + ("s" "Search" mastodon-search--search-query) + ("O" "Jump to your profile" mastodon-profile--my-profile) + ("U" "Update your profile note" mastodon-profile--update-user-profile-note) + ("K" "View bookmarks" mastodon-profile--view-bookmarks) + ("V" "View favourites" mastodon-profile--view-favourites) + ("R" "View follow requests" mastodon-profile--view-follow-requests) + ("G" "View follow suggestions" mastodon-tl--get-follow-suggestions) + ("I" "View filters" mastodon-tl--view-filters) + ("X" "View lists" mastodon-tl--view-lists) + ("S" "View scheduled toots" mastodon-tl--view-scheduled-toots) + (";" "View instance description" mastodon-tl--view-instance-description)) + ("Users" + ("W" "Follow" mastodon-tl--follow-user) + ("C-S-W" "Unfollow" mastodon-tl--unfollow-user) + ("M" "Mute" mastodon-tl--mute-user) + ("C-S-M" "Unmute" mastodon-tl--unmute-user) + ("B" "Block" mastodon-tl--block-user) + ("C-S-B" "Unblock" mastodon-tl--unblock-user)) + ("Images" + ;; RET errors here also :/ + ("/i" "Load full image in browser" 'shr-browse-image) + ("r" "rotate" 'image-rotate) + ("+" "zoom in" 'image-increase-size) + ("-" "zoom out" 'image-decrease-size) + ("u" "copy URL" 'shr-maybe-probe-and-copy-url)) + ("Profile view" + ("C-c C-c" "Cycle profile views" mastodon-profile--account-view-cycle)) + ("Quit" + ("q" "Quit mastodon and bury buffer." kill-this-buffer) + ("Q" "Quit mastodon buffer and kill window." kill-buffer-and-window) + ("M-C-q" "Quit mastodon and kill all buffers." mastodon-kill-all-buffers))))))) - (provide 'mastodon-discover) +(provide 'mastodon-discover) ;;; mastodon-discover.el ends here -- cgit v1.2.3 From 52a53c30360e89af9476a0d580d61bd0e08f67df Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Thu, 23 Mar 2023 10:42:07 +0100 Subject: read me re followed tags --- README.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.org') diff --git a/README.org b/README.org index 24e14e1..405eb20 100644 --- a/README.org +++ b/README.org @@ -135,7 +135,7 @@ not contain =:client_id= and =:client_secret=. | =O= | View own profile | | =U= | update your profile bio note | | =;= | view instance description for toot at point | -| =:= | view your list of followed tags and load its timeline | +| =:= | view followed tags and load a tag timeline | | =,= | view favouriters of toot at point | | =.= | view boosters of toot at point | | =/= | switch between mastodon buffers | -- cgit v1.2.3