From 00ec168eafb1233b0164611e622f018a3c362ea3 Mon Sep 17 00:00:00 2001 From: mousebot Date: Sun, 30 May 2021 14:08:17 +0200 Subject: update readme --- README.org | 70 +++++++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 46 insertions(+), 24 deletions(-) (limited to 'README.org') diff --git a/README.org b/README.org index baa627e..214d3d0 100644 --- a/README.org +++ b/README.org @@ -1,15 +1,37 @@ -* mastodon.el +* mastodon.el fork -[[https://melpa.org/#/mastodon][file:https://melpa.org/packages/mastodon-badge.svg]] +This is a fork of of the great but seemingly dormant https://github.com/jdenen/mastodon.el. -[[https://travis-ci.org/jdenen/mastodon.el][https://travis-ci.org/jdenen/mastodon.el.svg?branch=master]] -[[http://waffle.io/jdenen/mastodon.el][https://badge.waffle.io/jdenen/mastodon.el.png?label=in%20progress&title=In%20Progress]] +It adds the following features: -Emacs client for [[https://github.com/tootsuite/mastodon][Mastodon]] +| | display profile metadata fields | +| =i= | (un)pin toots, display pinned toots on profiles, | +| | display relationship (follows you/followed by you) on profiles | +| | links and tags in profiles are tab stops like in posts | +| =S= | search (posts, users, tags) (improved!) | +| =C-c C-a= (=C-c C-n=) | media uploads (including sensitive/nsfw flag) | +| =RET= | images are links to the full-sized image, can be zoomed | +| | mention booster in replies by default | +| =W=, =M=, =B= | (un)follow, (un)mute, (un)block users | +| =R=, =a=, =r= | view/accept/reject follow requests | +| =v= | view your favorited toots | +| =S-M-P= | jump to your profile | +| =C= | copy toot url | +| =d= | delete your toot | -[[http://spacemacs.org][https://cdn.rawgit.com/syl20bnr/spacemacs/442d025779da2f62fc86c2082703697714db6514/assets/spacemacs-badge.svg]] +It also makes some small cosmetic changes to make timelines easier to read, and makes some functions asynchronous, based on https://github.com/ieure/mastodon.el. -** Installation +This updated version is not on MELPA, to use it you need to clone and require it as per the installation instructions below. + +I did this for my own use and to learn more Elisp. If the code is terrible, feel free to improve or replace it. + +** bugs + +As it stands the client still has some bugs. In particular, when composing a toot, you may have to hit =C-g= before sending your toot. You may also see a related error when you try to add a media attachment. You should be able to run the command again and it should work. See the issues on the original repo. + +** Original README + +*** Installation Clone this repository and add the lisp directory to your load path. Then, require it and go. @@ -26,7 +48,7 @@ Or, with =use-package=: :ensure t) #+END_SRC -*** MELPA +**** MELPA Add =MELPA= to your archives: @@ -42,12 +64,12 @@ Update and install: =M-x package-install RET mastodon RET= -*** Emoji +**** Emoji =mastodon-mode= will enable [[https://github.com/iqbalansari/emacs-emojify][Emojify]] if it is loaded in your Emacs environment, so there's no need to write your own hook anymore. =emojify-mode= is not required. -*** Discover +**** Discover =mastodon-mode= can provide a context menu for its keybindings if [[https://github.com/mickeynp/discover.el][Discover]] is installed. It is not required. @@ -68,12 +90,12 @@ Or, with =use-package=: (mastodon-discover)) #+END_SRC -** Usage -*** 2 Factor Auth +*** Usage +**** 2 Factor Auth 2FA is not supported yet. It is in the [[https://github.com/jdenen/mastodon.el/milestone/2][plans]] for the =1.0.0= release. If you have 2FA enabled and try to use mastodon.el, your Emacs client will hang until you `C-g` your way out. -*** Instance +**** Instance Set =mastodon-instance-url= in your =.emacs= or =customize=. Defaults to the [[https://mastodon.social][flagship]]. @@ -85,13 +107,13 @@ There is an option to have your user credentials (email address and password) sa The default is not to do this because if not properly configured it would save these unencrypted which is not a good default to have. Customize the variable =mastodon-auth-source-file= if you want to enable this feature. -*** Timelines +**** Timelines =M-x mastodon= Opens a =*mastodon-home*= buffer in the major mode so you can see toots. You will be prompted for email and password. The app registration process will take place if your =mastodon-token-file= does not contain =:client_id= and =:client_secret=. -**** Keybindings +***** Keybindings |-----------------+---------------------------------------------------------| | Key | Action | @@ -124,7 +146,7 @@ Opens a =*mastodon-home*= buffer in the major mode so you can see toots. You wil | =Q= | Quit mastodon buffer and kill window | |-----------------+---------------------------------------------------------| -**** Legend +***** Legend |--------+-------------------------| | Marker | Meaning | @@ -133,7 +155,7 @@ Opens a =*mastodon-home*= buffer in the major mode so you can see toots. You wil | =(F)= | I favourited this toot. | |--------+-------------------------| -*** Toot toot +**** Toot toot =M-x mastodon-toot= @@ -148,12 +170,12 @@ Authentication stores your access token in the =mastodon-auth--token= variable. It is not stored on your filesystem, so you will have to re-authenticate when you close/reopen Emacs. -**** Customization +***** Customization The default toot visibility can be changed by setting or customizing the =mastodon-toot--default-visibility= variable. Valid values are ="public"=, ="unlisted"=, ="private"=, or =direct=. Toot visibility can also be changed on a per-toot basis from the new toot buffer. -**** Keybindings +***** Keybindings |-----------+------------------------| | Key | Action | @@ -164,28 +186,28 @@ Toot visibility can also be changed on a per-toot basis from the new toot buffer | =C-c C-v= | Change toot visibility | |-----------+------------------------| -** Roadmap +*** Roadmap [[https://github.com/jdenen/mastodon.el/milestone/1][Here]] are the features I plan to implement before putting mastodon.el on MELPA. [[https://github.com/jdenen/mastodon.el/milestone/2][Here]] are the plans I have for the =1.0.0= release. -** Contributing +*** Contributing PRs, issues, and feature requests are very welcome! -*** Features +**** Features 1. Create an [[https://github.com/jdenen/mastodon.el/issues][issue]] detailing the feature you'd like to add. 2. Fork the repository and create a branch off of =develop=. 3. Create a pull request referencing the issue created in step 1. -*** Fixes +**** Fixes 1. In an [[https://github.com/jdenen/mastodon.el/issues][issue]], let me know that you're working to fix it. 2. Fork the repository and create a branch off of =develop=. 3. Create a pull request referencing the issue from step 1. -** Connect +*** Connect If you want to get in touch with me, give me a [[https://mastodon.social/@johnson][toot]] or leave an [[https://github.com/jdenen/mastodon.el/issues][issue]]. -- cgit v1.2.3 From 1ff6d8ef35f83ada24fafd3656dde0a1da57922a Mon Sep 17 00:00:00 2001 From: mousebot Date: Mon, 31 May 2021 09:58:01 +0200 Subject: bump masto version, bump emacs version to 25.1, dependency in readme --- README.org | 3 +++ lisp/mastodon-auth--test.el | 4 ++-- lisp/mastodon-auth.el | 4 ++-- lisp/mastodon-client.el | 4 ++-- lisp/mastodon-discover.el | 4 ++-- lisp/mastodon-http.el | 4 ++-- lisp/mastodon-inspect.el | 4 ++-- lisp/mastodon-media.el | 4 ++-- lisp/mastodon-notifications.el | 4 ++-- lisp/mastodon-profile.el | 4 ++-- lisp/mastodon-search.el | 4 ++-- lisp/mastodon-tl.el | 4 ++-- lisp/mastodon-toot.el | 4 ++-- lisp/mastodon.el | 4 ++-- 14 files changed, 29 insertions(+), 26 deletions(-) (limited to 'README.org') diff --git a/README.org b/README.org index 214d3d0..d06c93a 100644 --- a/README.org +++ b/README.org @@ -25,6 +25,9 @@ This updated version is not on MELPA, to use it you need to clone and require it I did this for my own use and to learn more Elisp. If the code is terrible, feel free to improve or replace it. +** dependency: +This version depends on the library =request= (for uploading attachments). You can install it from melpa. + ** bugs As it stands the client still has some bugs. In particular, when composing a toot, you may have to hit =C-g= before sending your toot. You may also see a related error when you try to add a media attachment. You should be able to run the command again and it should work. See the issues on the original repo. diff --git a/lisp/mastodon-auth--test.el b/lisp/mastodon-auth--test.el index 8082536..b8705f5 100644 --- a/lisp/mastodon-auth--test.el +++ b/lisp/mastodon-auth--test.el @@ -3,9 +3,9 @@ ;; Copyright (C) 2020 Ian Eure ;; Author: Ian Eure -;; Version: 0.9.0 +;; Version: 0.9.1 ;; Homepage: https://github.com/jdenen/mastodon.el -;; Package-Requires: ((emacs "24.4")) +;; Package-Requires: ((emacs "25.1")) ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-auth.el b/lisp/mastodon-auth.el index cfe89b5..3c61848 100644 --- a/lisp/mastodon-auth.el +++ b/lisp/mastodon-auth.el @@ -2,9 +2,9 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Author: Johnson Denen -;; Version: 0.9.0 +;; Version: 0.9.1 ;; Homepage: https://github.com/jdenen/mastodon.el -;; Package-Requires: ((emacs "24.4")) +;; Package-Requires: ((emacs "25.1")) ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-client.el b/lisp/mastodon-client.el index da70dea..90f1375 100644 --- a/lisp/mastodon-client.el +++ b/lisp/mastodon-client.el @@ -2,9 +2,9 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Author: Johnson Denen -;; Version: 0.9.0 +;; Version: 0.9.1 ;; Homepage: https://github.com/jdenen/mastodon.el -;; Package-Requires: ((emacs "24.4")) +;; Package-Requires: ((emacs "25.1")) ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-discover.el b/lisp/mastodon-discover.el index 1f063b3..2387feb 100644 --- a/lisp/mastodon-discover.el +++ b/lisp/mastodon-discover.el @@ -2,8 +2,8 @@ ;; Copyright (C) 2019 Johnson Denen ;; Author: Johnson Denen -;; Version: 0.9.0 -;; Package-Requires: ((emacs "24.4")) +;; Version: 0.9.1 +;; Package-Requires: ((emacs "25.1")) ;; Homepage: https://github.com/jdenen/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-http.el b/lisp/mastodon-http.el index 462b5c6..e85429f 100644 --- a/lisp/mastodon-http.el +++ b/lisp/mastodon-http.el @@ -2,8 +2,8 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Author: Johnson Denen -;; Version: 0.9.0 -;; Package-Requires: ((emacs "24.4") (request "0.2.0")) +;; Version: 0.9.1 +;; Package-Requires: ((emacs "25.1") (request "0.2.0")) ;; Homepage: https://github.com/jdenen/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-inspect.el b/lisp/mastodon-inspect.el index 44b9344..c5a8d5d 100644 --- a/lisp/mastodon-inspect.el +++ b/lisp/mastodon-inspect.el @@ -2,8 +2,8 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Author: Johnson Denen -;; Version: 0.9.0 -;; Package-Requires: ((emacs "24.4")) +;; Version: 0.9.1 +;; Package-Requires: ((emacs "25.1")) ;; Homepage: https://github.com/jdenen/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-media.el b/lisp/mastodon-media.el index da99007..6c17ae0 100644 --- a/lisp/mastodon-media.el +++ b/lisp/mastodon-media.el @@ -2,9 +2,9 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Author: Johnson Denen -;; Version: 0.9.0 +;; Version: 0.9.1 ;; Homepage: https://github.com/jdenen/mastodon.el -;; Package-Requires: ((emacs "24.4")) +;; Package-Requires: ((emacs "25.1")) ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el index d6fa78f..d40815a 100644 --- a/lisp/mastodon-notifications.el +++ b/lisp/mastodon-notifications.el @@ -2,9 +2,9 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Author: Johnson Denen -;; Version: 0.7.2 +;; Version: 0.9.1 ;; Homepage: https://github.com/jdenen/mastodon.el -;; Package-Requires: ((emacs "24.4")) +;; Package-Requires: ((emacs "25.1")) ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index 17b480d..bf1a3a9 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -2,8 +2,8 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Author: Johnson Denen -;; Version: 0.7.2 -;; Package-Requires: ((emacs "24.4") (seq "1.8")) +;; Version: 0.9.1 +;; Package-Requires: ((emacs "25.1") (seq "1.8")) ;; Homepage: https://github.com/jdenen/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-search.el b/lisp/mastodon-search.el index 90158a1..5e8253f 100644 --- a/lisp/mastodon-search.el +++ b/lisp/mastodon-search.el @@ -2,9 +2,9 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Author: Johnson Denen , martyhiatt -;; Version: 0.9.0 +;; Version: 0.9.1 ;; Homepage: https://github.com/jdenen/mastodon.el -;; Package-Requires: ((emacs "24.4")) +;; Package-Requires: ((emacs "25.1")) ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index 7b0afeb..ecaeff4 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -2,9 +2,9 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Author: Johnson Denen -;; Version: 0.9.0 +;; Version: 0.9.1 ;; Homepage: https://github.com/jdenen/mastodon.el -;; Package-Requires: ((emacs "24.4")) +;; Package-Requires: ((emacs "25.1")) ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index 8328bb9..a0f886c 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -2,9 +2,9 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Author: Johnson Denen -;; Version: 0.9.0 +;; Version: 0.9.1 ;; Homepage: https://github.com/jdenen/mastodon.el -;; Package-Requires: ((emacs "24.4")) +;; Package-Requires: ((emacs "25.1")) ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon.el b/lisp/mastodon.el index 37876f6..b703b30 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -2,8 +2,8 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Author: Johnson Denen -;; Version: 0.9.0 -;; Package-Requires: ((emacs "24.4") (request "0.2.0") (seq "1.8")) +;; Version: 0.9.1 +;; Package-Requires: ((emacs "25.1") (request "0.2.0") (seq "1.8")) ;; Homepage: https://github.com/jdenen/mastodon.el ;; This file is not part of GNU Emacs. -- cgit v1.2.3 From 35d7133bfc5060e76dfe91526da399ddb8559600 Mon Sep 17 00:00:00 2001 From: mousebot Date: Mon, 31 May 2021 11:51:23 +0200 Subject: foll reqs/faves bindings global, autoloads and declarations, readme --- README.org | 62 +++++++++++++++++++++++++++++++++--------------- lisp/mastodon-auth.el | 1 + lisp/mastodon-media.el | 7 +++--- lisp/mastodon-profile.el | 10 ++++---- lisp/mastodon-tl.el | 16 ++++++------- lisp/mastodon.el | 2 ++ 6 files changed, 64 insertions(+), 34 deletions(-) (limited to 'README.org') diff --git a/README.org b/README.org index d06c93a..af2c46c 100644 --- a/README.org +++ b/README.org @@ -4,33 +4,57 @@ This is a fork of of the great but seemingly dormant https://github.com/jdenen/m It adds the following features: -| | display profile metadata fields | -| =i= | (un)pin toots, display pinned toots on profiles, | -| | display relationship (follows you/followed by you) on profiles | -| | links and tags in profiles are tab stops like in posts | -| =S= | search (posts, users, tags) (improved!) | -| =C-c C-a= (=C-c C-n=) | media uploads (including sensitive/nsfw flag) | -| =RET= | images are links to the full-sized image, can be zoomed | -| | mention booster in replies by default | -| =W=, =M=, =B= | (un)follow, (un)mute, (un)block users | -| =R=, =a=, =r= | view/accept/reject follow requests | -| =v= | view your favorited toots | -| =S-M-P= | jump to your profile | -| =C= | copy toot url | -| =d= | delete your toot | +| Profiles: | | +| | display profile metadata fields | +| | display relationship (follows you/followed by you) on profiles | +| | display toots/follows/followers counts on profiles | +| | links and tags in profiles are tab stops like in posts | +| =R=, =a=, =r= | view/accept/reject follow requests | +| =v= | view your favorited toots | +| =i= | (un)pin toots, display pinned toots on profiles | +| =S-C-P= | jump to your profile | +| Timelines: | | +| =W=, =M=, =B= | (un)follow, (un)mute, (un)block users | +| | images are links to the full image, can be zoomed/rotated/saved (see their keymap) | +| =C= | copy url of toot at point | +| =d= | delete your toot at point | +| | display polls (very basic for now) | +| Toots: | | +| =C-c C-a= (=C-c C-n=) | media uploads (and sensitive/nsfw flag) | +| | mention booster in replies by default | +| Search: | | +| =S= | search (posts, users, tags) (improved! but still pretty basic!) | It also makes some small cosmetic changes to make timelines easier to read, and makes some functions asynchronous, based on https://github.com/ieure/mastodon.el. This updated version is not on MELPA, to use it you need to clone and require it as per the installation instructions below. -I did this for my own use and to learn more Elisp. If the code is terrible, feel free to improve or replace it. +The minimum Emacs version is now 25.1. But if you are running an older version it shouldn't be very hard to get it working. -** dependency: -This version depends on the library =request= (for uploading attachments). You can install it from melpa. +I did this for my own use and to learn more Elisp. If the code is terrible, feel free to improve or replace it. It surely still contains errors, I'm only weeding them out as I find them. -** bugs +** NB: dependency: -As it stands the client still has some bugs. In particular, when composing a toot, you may have to hit =C-g= before sending your toot. You may also see a related error when you try to add a media attachment. You should be able to run the command again and it should work. See the issues on the original repo. +This version depends on the library =request= (for uploading attachments). You can install it from MELPA, or https://github.com/tkf/emacs-request. + +** NB: bugs + +As it stands the client still has some bugs. In particular, when composing a toot, hit =C-g= before sending your toot. If you don't, your draft may disappear. You may also see a related error when you try to add a media attachment. You should be able to run the command again and it should work. See the issues on the original repo. + +Some people have also had niggling troubles with initial auth and set-up, but I couldn't reproduce. + +** roadmap-ish + +I might add a few more features if the ones I added turn out to work ok. Possible additions/amendments: + +- voting on polls +- better display of polls +- mention all thread participants in replies +- handle newlines in toots better, for poetry, etc. +- improve async. +- perhaps integrate live timeline updates from https://github.com/alexjgriffith/mastodon-future.el, and add live updates for notifcations and home timeline. + +It looks like 2-factor auth was never completed in the original repo. It's not a priority for me, auth ain't my thing. If you want to hack on it, its on the develop branch in the original repo. ** Original README diff --git a/lisp/mastodon-auth.el b/lisp/mastodon-auth.el index 3c61848..4bd1cce 100644 --- a/lisp/mastodon-auth.el +++ b/lisp/mastodon-auth.el @@ -32,6 +32,7 @@ (require 'plstore) (require 'auth-source) (require 'json) +(eval-when-compile (require 'subr-x)) ; for if-let (autoload 'mastodon-client "mastodon-client") (autoload 'mastodon-http--api "mastodon-http") diff --git a/lisp/mastodon-media.el b/lisp/mastodon-media.el index 6c17ae0..381d994 100644 --- a/lisp/mastodon-media.el +++ b/lisp/mastodon-media.el @@ -34,6 +34,8 @@ ;;; Code: (defvar url-show-status) +(defvar mastodon-tl--shr-image-map-replacement) + (defgroup mastodon-media nil "Inline Mastadon media." :prefix "mastodon-media-" @@ -125,7 +127,7 @@ CAQgEIBAAAIBFiNOFMaY6V1tnFhkDQIQCEAgAIEABAKAQAACAQgEIBCAQAACAQgEIBCAQABIXO4e c1y+zhoEIBCAQAAQCEAgAIEABAIQCEAgAIEABAIQCEAgAAgEIBCAQAACAQgEIBCAQAACAQgEAIEA BAIQCEAgAIEABAIsJVH58WqHw8FIgjUIQCAACAQgEIBAAAIBCAQgEIBAAAIBCAQgEAAEAhAIQCBA fKRJkmVZjAQwh78A6vCRWJE8K+8AAAAASUVORK5CYII=") - "The PNG data for a generic 200x200 'broken image' view") + "The PNG data for a generic 200x200 'broken image' view.") (defun mastodon-media--process-image-response (status-plist marker image-options region-length) @@ -134,8 +136,7 @@ fKRJkmVZjAQwh78A6vCRWJE8K+8AAAAASUVORK5CYII=") STATUS-PLIST is the usual plist of status events as per `url-retrieve'. IMAGE-OPTIONS are the precomputed options to apply to the image. MARKER is the marker to where the response should be visible. -REGION-LENGTH is the length of the region that should be replaced with the image. -" +REGION-LENGTH is the length of the region that should be replaced with the image." (when (marker-buffer marker) ; only if the buffer hasn't been kill in the meantime (let ((url-buffer (current-buffer)) (is-error-response-p (eq :error (car status-plist)))) diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index bf1a3a9..84664c0 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -36,6 +36,8 @@ (autoload 'mastodon-http--api "mastodon-http.el") (autoload 'mastodon-http--get-json "mastodon-http.el") +(autoload 'mastodon-http--post "mastodon-http.el") +(autoload 'mastodon-http--triage "mastodon-http.el") (autoload 'mastodon-auth--get-account-name "mastodon-auth.el") (autoload 'mastodon-http--get-json-async "mastodon-http.el") (autoload 'mastodon-media--get-media-link-rendering "mastodon-media.el") @@ -50,6 +52,7 @@ (autoload 'mastodon-tl--as-string "mastodon-tl.el") (autoload 'mastodon-tl--toot-id "mastodon-tl") (autoload 'mastodon-tl--toot "mastodon-tl") +(autoload 'mastodon-tl--init "mastodon-tl.el") (defvar mastodon-instance-url) (defvar mastodon-tl--buffer-spec) @@ -70,11 +73,9 @@ extra keybindings." ;; The key bindings :keymap '(((kbd "O") . mastodon-profile--open-followers) ((kbd "o") . mastodon-profile--open-following) - ((kbd "v") . mastodon-profile--view-favourites) - ((kbd "R") . mastodon-profile--view-follow-requests) ((kbd "a") . mastodon-profile--follow-request-accept) ((kbd "r") . mastodon-profile--follow-request-reject)) -:group 'mastodon) + :group 'mastodon) (defun mastodon-profile--toot-json () "Get the next toot-json." @@ -214,7 +215,7 @@ Returns a list of lists." (mastodon-http--get-json url))) (defun mastodon-profile--insert-statuses-pinned (pinned-statuses) - "Insert each of the PINNED_STATUSES for a given account." + "Insert each of the PINNED-STATUSES for a given account." (mapc (lambda (pinned-status) (insert (mastodon-tl--set-face " :pinned: " 'success)) @@ -222,6 +223,7 @@ Returns a list of lists." pinned-statuses)) (defun mastodon-profile--make-profile-buffer-for (account endpoint-type update-function) + "Display profile of ACCOUNT, using ENDPOINT-TYPE and UPDATE-FUNCTION." (let* ((id (mastodon-profile--account-field account 'id)) (url (mastodon-http--api (format "accounts/%s/%s" id endpoint-type))) (acct (mastodon-profile--account-field account 'acct)) diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index ecaeff4..d90a759 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -39,14 +39,14 @@ (autoload 'mastodon-media--get-media-link-rendering "mastodon-media") (autoload 'mastodon-media--inline-images "mastodon-media") (autoload 'mastodon-mode "mastodon") -(autoload 'mastodon-profile--account-from-id "mastodon.el-profile.el") -(autoload 'mastodon-profile--make-author-buffer "mastodon-profile.el") -(autoload 'mastodon-profile--search-account-by-handle "mastodon.el-profile.el") +(autoload 'mastodon-profile--account-from-id "mastodon-profile") +(autoload 'mastodon-profile--make-author-buffer "mastodon-profile") +(autoload 'mastodon-profile--search-account-by-handle "mastodon-profile") ;; mousebot adds -(autoload 'mastodon-profile--toot-json "mastodon-profile.el") -(autoload 'mastodon-profile--account-field "mastodon-profile.el") -(autoload 'mastodon-profile--extract-users-handles "mastodon-profile.el") -(autoload 'mastodon-profile--my-profile "mastodon-profile.el") +(autoload 'mastodon-profile--toot-json "mastodon-profile") +(autoload 'mastodon-profile--account-field "mastodon-profile") +(autoload 'mastodon-profile--extract-users-handles "mastodon-profile") +(autoload 'mastodon-profile--my-profile "mastodon-profile") (autoload 'mastodon-toot--delete-toot "mastodon-toot") (autoload 'mastodon-http--post "mastodon-http") (autoload 'mastodon-http--triage "mastodon-http") @@ -55,7 +55,7 @@ (defvar mastodon-instance-url) (defvar mastodon-toot-timestamp-format) -(defvar shr-use-fonts) ;; need to declare it since Emacs24 didn't have this +(defvar shr-use-fonts) ;; declare it since Emacs24 didn't have this (defgroup mastodon-tl nil "Timelines in Mastodon." diff --git a/lisp/mastodon.el b/lisp/mastodon.el index b703b30..d3477cb 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -131,6 +131,8 @@ Use. e.g. \"%c\" for your locale's date and time format." (define-key map (kbd "d") #'mastodon-toot--delete-toot) (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) map) "Keymap for `mastodon-mode'.") -- cgit v1.2.3 From db26f1b4bc8a62e472ed7c7191a67ddbc2c65c69 Mon Sep 17 00:00:00 2001 From: mousebot Date: Tue, 1 Jun 2021 14:20:28 +0200 Subject: add basic live updates of home/local/federated timelines. the code, mastodon-async.el is taken from https://github.com/alexjgriffith/mastodon-future.el and only slightly modified to make the home stream work. --- README.org | 1 + lisp/mastodon-async.el | 332 +++++++++++++++++++++++++++++++++++++++++++++++++ lisp/mastodon.el | 6 + 3 files changed, 339 insertions(+) create mode 100644 lisp/mastodon-async.el (limited to 'README.org') diff --git a/README.org b/README.org index af2c46c..b51644b 100644 --- a/README.org +++ b/README.org @@ -47,6 +47,7 @@ Some people have also had niggling troubles with initial auth and set-up, but I I might add a few more features if the ones I added turn out to work ok. Possible additions/amendments: +- update profile note. - voting on polls - better display of polls - mention all thread participants in replies diff --git a/lisp/mastodon-async.el b/lisp/mastodon-async.el new file mode 100644 index 0000000..ffd8ab6 --- /dev/null +++ b/lisp/mastodon-async.el @@ -0,0 +1,332 @@ +;;; mastodon-async.el --- Client for Mastodon -*- lexical-binding: t -*- + +;; Copyright (C) 2017 Johnson Denen +;; Author: Johnson Denen +;; Version: 0.7.1 +;; Package-Requires: ((emacs "25.1")) +;; Homepage: https://github.com/jdenen/mastodon.el + +;; This file is not part of GNU Emacs. + +;; This file is part of mastodon.el. + +;; mastodon.el is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; mastodon.el is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with mastodon.el. If not, see . + +;;; Commentary: + +;; Rework sync code so it does not mess up the async-buffer + +;;; Code: + +(require 'json) + +(defgroup mastodon-async nil + "An async module for mastodon streams." + :prefix "mastodon-async-" + :group 'external) + +;;;###autoload +(define-minor-mode mastodon-async-mode + "Async Mastodon." + :lighter " MasA") + +(defvar mastodon-instance-url) + +(defvar mastodon-tl--enable-relative-timestamps) +(defvar mastodon-tl--display-media-p) +(defvar mastodon-tl--buffer-spec) + +(make-variable-buffer-local + (defvar mastodon-async--queue "" ;;"*mastodon-async-queue*" + "The intermediate queue buffer name.")) + +(make-variable-buffer-local + (defvar mastodon-async--buffer "" ;;"*mastodon-async-buffer*" + "User facing output buffer name.")) + +(make-variable-buffer-local + (defvar mastodon-async--http-buffer "" ;;"" + "Buffer variable bound to http output.")) + +(defun mastodon-async--display-http () + "Display the async HTTP input buffer." + (display-buffer mastodon-async--http-buffer)) + +(defun mastodon-async--display-buffer () + "Display the async user facing buffer." + (interactive) + (display-buffer mastodon-async--buffer)) + +(defun mastodon-async--display-queue () + "Display the async queue buffer." + (display-buffer mastodon-async--queue)) + +(defun mastodon-async--stop-http () + "Stop the http processs and close the async and http buffer." + (interactive) + (let ((inhibit-read-only t)) + (stop-process (get-buffer-process mastodon-async--http-buffer)) + (delete-process (get-buffer-process mastodon-async--http-buffer)) + (kill-buffer mastodon-async--http-buffer) + (setq mastodon-async--http-buffer "") + (kill-buffer mastodon-async--queue))) + +;; Need to handle the notification event +;; The output can be passed to notifications +;; need an alternate process-queue-string function +(defun mastodon-async--stream-notifications () + "Open a stream of Home." + (interactive) + (mastodon-async--mastodon + "user" + "home" + "notifications" + 'mastodon-async--process-queue-string)) + +;; this will stream both home AND notifications. +;; need to workout how to filter "user" stream +;; and split it +(defun mastodon-async--stream-home () + "Open a stream of Home." + (interactive) + (mastodon-async--mastodon + "user" + "home" + "home" + 'mastodon-async--process-queue-string)) + +(defun mastodon-async--stream-federated () + "Open a stream of Federated." + (interactive) + (mastodon-async--mastodon + "public" + "public" + "federated" + 'mastodon-async--process-queue-string)) + +(defun mastodon-async--stream-local () + "Open a stream of Local." + (interactive) + ;; Need to add another layer of filtering for this to work + ;; apparently it the local flag does not work + (mastodon-async--mastodon + "public" + "local" ;"public?local=true" + "local" + 'mastodon-async--process-queue-local-string)) + +(defun mastodon-async--mastodon (endpoint timeline name filter) + "Make sure that the previous async process has been closed. + +Then Start an async mastodon stream at ENDPOINT filtering toots +using FILTER. +Argument TIMELINE a specific target, such as federated or home. +Argument NAME the center portion of the buffer name for *mastodon-async-buffer and *mastodon-async-queueu." + (let ((buffer (mastodon-async--start-process + endpoint filter name))) + (with-current-buffer buffer + (mastodon-async--display-buffer) + (goto-char (point-max)) + (goto-char 1)))) + +(defun mastodon-async--get (url callback) + "An async get targeted at URL with a CALLBACK." + (let ((url-request-method "GET") + (url-request-extra-headers + `(("Authorization" . + ,(concat + "Bearer " + (mastodon-auth--access-token)))))) + (url-retrieve url callback))) + +(defun mastodon-async--set-http-buffer (buffer http-buffer) + "Initializes for BUFFER a local variable `mastodon-async--http-buffer'. + +HTTP-BUFFER is the initializing value. Use this funcion if HTTP-BUFFER +is not known when `mastodon-async--setup-buffer' is called." + (with-current-buffer (get-buffer-create buffer) + (setq mastodon-async--http-buffer http-buffer))) + +(defun mastodon-async--set-local-variables (buffer + http-buffer + buffer-name + queue-name) + (with-current-buffer (get-buffer-create buffer) + (let ((value mastodon-instance-url)) + (make-local-variable 'mastodon-instance-url) + (setq-local mastodon-instance-url value)) + (setq mastodon-async--http-buffer http-buffer) + (setq mastodon-async--buffer buffer-name) + (setq mastodon-async--queue queue-name))) + +(defun mastodon-async--setup-http (http-buffer name) + "Adds local variables to HTTP-BUFFER. + +NAME is used to generate the display buffer and the queue." + (let ((queue-name(concat " *mastodon-async-queue-" name "-" + mastodon-instance-url "*")) + (buffer-name(concat "*mastodon-async-display-" name "-" + mastodon-instance-url "*"))) + (mastodon-async--set-local-variables http-buffer http-buffer + buffer-name queue-name))) + +(defun mastodon-async--setup-queue (http-buffer name) + "Sets up the buffer for the async queue." + (let ((queue-name(concat " *mastodon-async-queue-" name "-" + mastodon-instance-url "*")) + (buffer-name(concat "*mastodon-async-display-" name "-" + mastodon-instance-url "*"))) + (mastodon-async--set-local-variables queue-name http-buffer + buffer-name queue-name) + queue-name)) + +(defun mastodon-async--setup-buffer (http-buffer name endpoint) + "Sets up the buffer timeline like `mastodon-tl--init'. + +HTTP-BUFFER the name of the http-buffer, if unknow set to +NAME is the given name of the stream, like local for public?local +ENPOINT is the specific endpoint for a stream and timeline" + (let ((queue-name (concat " *mastodon-async-queue-" name "-" + mastodon-instance-url "*")) + (buffer-name (concat "*mastodon-async-display-" name "-" + mastodon-instance-url "*")) + ;; if user stream, we need "timelines/home" not "timelines/user" + (endpoint (if (equal endpoint "user") "home" endpoint))) + (mastodon-async--set-local-variables buffer-name http-buffer + buffer-name queue-name) + ;; Similar to timeline init. + (with-current-buffer (get-buffer-create buffer-name) + (setq inhibit-read-only t) ; for home timeline? + (make-local-variable 'mastodon-tl--enable-relative-timestamps) + (make-local-variable 'mastodon-tl--display-media-p) + (message (mastodon-http--api (format "timelines/%s" endpoint))) + (mastodon-tl--timeline (mastodon-http--get-json + (mastodon-http--api + (format "timelines/%s" endpoint)))) + (mastodon-mode) + (setq mastodon-tl--buffer-spec + `(buffer-name ,buffer-name + endpoint ,(format "timelines/%s" endpoint) + update-function + ,'mastodon-tl--timeline)) + (setq-local mastodon-tl--enable-relative-timestamps nil) + (setq-local mastodon-tl--display-media-p t) + (current-buffer)))) + +(defun mastodon-async--start-process (endpoint filter &optional name) + "Start an async mastodon stream at ENDPOINT. +Filter the toots using FILTER." + (let* ((stream (concat "streaming/" endpoint)) + (async-queue (mastodon-async--setup-queue "" (or name stream))) + (async-buffer (mastodon-async--setup-buffer "" (or name stream) endpoint)) + (http-buffer (mastodon-async--get + (mastodon-http--api stream) + (lambda (status) (message "HTTP SOURCE CLOSED"))))) + (mastodon-async--setup-http http-buffer (or name stream)) + (mastodon-async--set-http-buffer async-buffer http-buffer) + (mastodon-async--set-http-buffer async-queue http-buffer) + (set-process-filter (get-buffer-process http-buffer) + (mastodon-async--http-hook filter)) + http-buffer)) + +(defun mastodon-async--http-hook (filter) + "Return a lambda with a custom FILTER for processing toots." + (let ((filter filter)) + (lambda (proc data) + (with-current-buffer (process-buffer proc) + (let* ((string + (mastodon-async--stream-filter + (mastodon-async--http-layer proc data))) + (queue-string (mastodon-async--cycle-queue string))) + (when queue-string + (mastodon-async--output-toot + (funcall filter queue-string)))))))) + +(defun mastodon-async--process-queue-string (string) + "Parse the output STRING of the queue buffer." + (let* ((split-strings (split-string string "\n" t)) + (event-type (replace-regexp-in-string + "^event: " "" + (car split-strings))) + (data (replace-regexp-in-string + "^data: " "" (cadr split-strings)))) + (when (equal "update" event-type) + ;; in some casses the data is not fully formed + ;; for now return nil if malformed using `ignore-errors' + (ignore-errors (json-read-from-string data))))) + +(defun mastodon-async--process-queue-local-string (string) + "Use STRING to limit the public endpoint to displaying local steams only." + (let ((json (mastodon-async--process-queue-string string))) + (when json + (when (mastodon-async--account-local-p json) + json)))) + +(defun mastodon-async--account-local-p (json) + "Test JSON to see if account is local." + (not (string-match-p + "@" + (cdr (assoc 'acct (cdr (assoc 'account json))))))) + +(defun mastodon-async--output-toot (toot) + "Process TOOT and prepend it to the async user facing buffer." + (if (not(bufferp (get-buffer mastodon-async--buffer))) + (mastodon-async--stop-http) + (when toot + (with-current-buffer mastodon-async--buffer + (let* ((inhibit-read-only t) + (old-max (point-max)) + (previous (point)) + (mastodon-tl--enable-relative-timestamps t) + (mastodon-tl--display-media-p t)) + (goto-char (point-min)) + (mastodon-tl--timeline (list toot)) + (if (equal previous 1) + (goto-char 1) + (goto-char (+ previous (- (point-max) old-max))))))))) + +(defun mastodon-async--cycle-queue (string) + "Append the most recent STRING from http buffer to queue buffer. + +Then determine if a full message has been recived. If so return it. +Full messages are seperated by two newlines" + (with-current-buffer mastodon-async--queue + (goto-char (max-char)) + (insert (decode-coding-string string 'utf-8)) + (goto-char 0) + (let((next(re-search-forward "\n\n" nil t))) + (when next + (let ((return-string (buffer-substring 1 next)) + (inhibit-read-only t)) + (delete-region 1 next) + return-string))))) + +(defun mastodon-async--http-layer (proc data) + "Passes PROC and DATA to ‘url-http-generic-filter’. + +It then processes its output." + (with-current-buffer (process-buffer proc) + (let ((start (max 1 ( - (point-max) 2)))) + (url-http-generic-filter proc data) + (when (> url-http-end-of-headers start) + (setq start url-http-end-of-headers)) + (let ((end (- (point-max) 2))) + (buffer-substring start end))))) + +(defun mastodon-async--stream-filter (string) + "Remove comments from STRING." + (replace-regexp-in-string "^:.*\n" "" string)) + +(provide 'mastodon-async) +;;; mastodon-async.el ends here diff --git a/lisp/mastodon.el b/lisp/mastodon.el index d3477cb..6096c55 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -54,6 +54,7 @@ (autoload 'mastodon-toot--toggle-boost "mastodon-toot") (autoload 'mastodon-toot--toggle-favourite "mastodon-toot") (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") @@ -61,11 +62,16 @@ (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-search--search-query "mastodon-search") (autoload 'mastodon-toot--delete-toot "mastodon-toot") (autoload 'mastodon-toot--copy-toot-url "mastodon-toot") (autoload 'mastodon-toot--pin-toot-toggle "mastodon-toot") (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") (defgroup mastodon nil "Interface with Mastodon." -- cgit v1.2.3 From 9f532060927265717b7c71f5b77f6c650e72a34d Mon Sep 17 00:00:00 2001 From: mousebot Date: Thu, 3 Jun 2021 10:02:57 +0200 Subject: enable async stream for user notifications. creates a notifications filter for the 'user' stream, then handles display of notifications, which have their own timeline funs. --- README.org | 13 +++++-- lisp/mastodon-async.el | 83 ++++++++++++++++++++++++++++-------------- lisp/mastodon-notifications.el | 6 +-- lisp/mastodon.el | 5 +++ 4 files changed, 73 insertions(+), 34 deletions(-) (limited to 'README.org') diff --git a/README.org b/README.org index b51644b..6da0f4b 100644 --- a/README.org +++ b/README.org @@ -9,8 +9,8 @@ It adds the following features: | | display relationship (follows you/followed by you) on profiles | | | display toots/follows/followers counts on profiles | | | links and tags in profiles are tab stops like in posts | -| =R=, =a=, =r= | view/accept/reject follow requests | -| =v= | view your favorited toots | +| =R=, =a=, =r= | view/accept/reject follow requests | +| =v= | view your favorited toots | | =i= | (un)pin toots, display pinned toots on profiles | | =S-C-P= | jump to your profile | | Timelines: | | @@ -33,7 +33,13 @@ The minimum Emacs version is now 25.1. But if you are running an older version i I did this for my own use and to learn more Elisp. If the code is terrible, feel free to improve or replace it. It surely still contains errors, I'm only weeding them out as I find them. -** NB: dependency: +** live-updating timelines + +(code adapted from https://github.com/alexjgriffith/mastodon-future.el). + +Works for federated, local, and home timelines and for notifications. It's pretty necro, so use at your own risk. Not a super high priority for me, but some people dig it. The command prefix is =mastodon-async--stream= + +** NB: dependency This version depends on the library =request= (for uploading attachments). You can install it from MELPA, or https://github.com/tkf/emacs-request. @@ -53,7 +59,6 @@ I might add a few more features if the ones I added turn out to work ok. Possibl - mention all thread participants in replies - handle newlines in toots better, for poetry, etc. - improve async. -- perhaps integrate live timeline updates from https://github.com/alexjgriffith/mastodon-future.el, and add live updates for notifcations and home timeline. It looks like 2-factor auth was never completed in the original repo. It's not a priority for me, auth ain't my thing. If you want to hack on it, its on the develop branch in the original repo. diff --git a/lisp/mastodon-async.el b/lisp/mastodon-async.el index ffd8ab6..1be88ae 100644 --- a/lisp/mastodon-async.el +++ b/lisp/mastodon-async.el @@ -31,6 +31,8 @@ (require 'json) +(autoload 'mastodon-notifications--timeline "mastodon-notifications") + (defgroup mastodon-async nil "An async module for mastodon streams." :prefix "mastodon-async-" @@ -86,19 +88,19 @@ ;; The output can be passed to notifications ;; need an alternate process-queue-string function (defun mastodon-async--stream-notifications () - "Open a stream of Home." + "Open a stream of user notifications." (interactive) (mastodon-async--mastodon "user" "home" "notifications" - 'mastodon-async--process-queue-string)) + 'mastodon-async--process-queue-string-notifications)) ;; this will stream both home AND notifications. ;; need to workout how to filter "user" stream ;; and split it (defun mastodon-async--stream-home () - "Open a stream of Home." + "Open a stream of the home timeline." (interactive) (mastodon-async--mastodon "user" @@ -132,7 +134,7 @@ Then Start an async mastodon stream at ENDPOINT filtering toots using FILTER. Argument TIMELINE a specific target, such as federated or home. -Argument NAME the center portion of the buffer name for *mastodon-async-buffer and *mastodon-async-queueu." +Argument NAME the center portion of the buffer name for *mastodon-async-buffer and *mastodon-async-queue." (let ((buffer (mastodon-async--start-process endpoint filter name))) (with-current-buffer buffer @@ -141,7 +143,7 @@ Argument NAME the center portion of the buffer name for *mastodon-async-buffer a (goto-char 1)))) (defun mastodon-async--get (url callback) - "An async get targeted at URL with a CALLBACK." + "An async GET request to URL with CALLBACK." (let ((url-request-method "GET") (url-request-extra-headers `(("Authorization" . @@ -174,16 +176,16 @@ is not known when `mastodon-async--setup-buffer' is called." "Adds local variables to HTTP-BUFFER. NAME is used to generate the display buffer and the queue." - (let ((queue-name(concat " *mastodon-async-queue-" name "-" + (let ((queue-name (concat " *mastodon-async-queue-" name "-" mastodon-instance-url "*")) - (buffer-name(concat "*mastodon-async-display-" name "-" + (buffer-name (concat "*mastodon-async-display-" name "-" mastodon-instance-url "*"))) (mastodon-async--set-local-variables http-buffer http-buffer buffer-name queue-name))) (defun mastodon-async--setup-queue (http-buffer name) "Sets up the buffer for the async queue." - (let ((queue-name(concat " *mastodon-async-queue-" name "-" + (let ((queue-name (concat " *mastodon-async-queue-" name "-" mastodon-instance-url "*")) (buffer-name(concat "*mastodon-async-display-" name "-" mastodon-instance-url "*"))) @@ -194,15 +196,18 @@ NAME is used to generate the display buffer and the queue." (defun mastodon-async--setup-buffer (http-buffer name endpoint) "Sets up the buffer timeline like `mastodon-tl--init'. -HTTP-BUFFER the name of the http-buffer, if unknow set to -NAME is the given name of the stream, like local for public?local -ENPOINT is the specific endpoint for a stream and timeline" +HTTP-BUFFER the name of the http-buffer, if unknown, set to... +NAME is the name of the stream for the buffer name. +ENPOINT is the endpoint for the stream and timeline." (let ((queue-name (concat " *mastodon-async-queue-" name "-" mastodon-instance-url "*")) (buffer-name (concat "*mastodon-async-display-" name "-" mastodon-instance-url "*")) - ;; if user stream, we need "timelines/home" not "timelines/user" - (endpoint (if (equal endpoint "user") "home" endpoint))) + ;; if user stream, we need "timelines/home" not "timelines/user" + ;; if notifs, we need "notifications" not "timelines/notifications" + (endpoint (if (equal name "notifications") "notifications" + (if (equal name "home") "timelines/home" + (format "timelines/%s" endpoint))))) (mastodon-async--set-local-variables buffer-name http-buffer buffer-name queue-name) ;; Similar to timeline init. @@ -210,16 +215,22 @@ ENPOINT is the specific endpoint for a stream and timeline" (setq inhibit-read-only t) ; for home timeline? (make-local-variable 'mastodon-tl--enable-relative-timestamps) (make-local-variable 'mastodon-tl--display-media-p) - (message (mastodon-http--api (format "timelines/%s" endpoint))) - (mastodon-tl--timeline (mastodon-http--get-json - (mastodon-http--api - (format "timelines/%s" endpoint)))) + (message (mastodon-http--api endpoint)) + (if (equal name "notifications") + (mastodon-notifications--timeline + (mastodon-http--get-json + (mastodon-http--api "notifications"))) + (mastodon-tl--timeline (mastodon-http--get-json + (mastodon-http--api endpoint)))) (mastodon-mode) (setq mastodon-tl--buffer-spec - `(buffer-name ,buffer-name - endpoint ,(format "timelines/%s" endpoint) - update-function - ,'mastodon-tl--timeline)) + `(buffer-name + ,buffer-name + endpoint ,endpoint + update-function + ,(if (equal name "notifications") + 'mastodon-notifications--timeline + 'mastodon-tl--timeline))) (setq-local mastodon-tl--enable-relative-timestamps nil) (setq-local mastodon-tl--display-media-p t) (current-buffer)))) @@ -254,7 +265,7 @@ Filter the toots using FILTER." (funcall filter queue-string)))))))) (defun mastodon-async--process-queue-string (string) - "Parse the output STRING of the queue buffer." + "Parse the output STRING of the queue buffer, returning only update events." (let* ((split-strings (split-string string "\n" t)) (event-type (replace-regexp-in-string "^event: " "" @@ -266,6 +277,20 @@ Filter the toots using FILTER." ;; for now return nil if malformed using `ignore-errors' (ignore-errors (json-read-from-string data))))) +(defun mastodon-async--process-queue-string-notifications (string) + "Parse the output STRING of the queue buffer, returning only notification events." + ;; NB notification events in screams include follow requests + (let* ((split-strings (split-string string "\n" t)) + (event-type (replace-regexp-in-string + "^event: " "" + (car split-strings))) + (data (replace-regexp-in-string + "^data: " "" (cadr split-strings)))) + (when (equal "notification" event-type) + ;; in some casses the data is not fully formed + ;; for now return nil if malformed using `ignore-errors' + (ignore-errors (json-read-from-string data))))) + (defun mastodon-async--process-queue-local-string (string) "Use STRING to limit the public endpoint to displaying local steams only." (let ((json (mastodon-async--process-queue-string string))) @@ -280,8 +305,8 @@ Filter the toots using FILTER." (cdr (assoc 'acct (cdr (assoc 'account json))))))) (defun mastodon-async--output-toot (toot) - "Process TOOT and prepend it to the async user facing buffer." - (if (not(bufferp (get-buffer mastodon-async--buffer))) + "Process TOOT and prepend it to the async user-facing buffer." + (if (not (bufferp (get-buffer mastodon-async--buffer))) (mastodon-async--stop-http) (when toot (with-current-buffer mastodon-async--buffer @@ -290,8 +315,12 @@ Filter the toots using FILTER." (previous (point)) (mastodon-tl--enable-relative-timestamps t) (mastodon-tl--display-media-p t)) - (goto-char (point-min)) - (mastodon-tl--timeline (list toot)) + (goto-char (point-min)) + (if (equal (buffer-name) + (concat "*mastodon-async-display-notifications-" + mastodon-instance-url "*")) + (mastodon-notifications--timeline (list toot)) + (mastodon-tl--timeline (list toot))) (if (equal previous 1) (goto-char 1) (goto-char (+ previous (- (point-max) old-max))))))))) @@ -305,7 +334,7 @@ Full messages are seperated by two newlines" (goto-char (max-char)) (insert (decode-coding-string string 'utf-8)) (goto-char 0) - (let((next(re-search-forward "\n\n" nil t))) + (let ((next (re-search-forward "\n\n" nil t))) (when next (let ((return-string (buffer-substring 1 next)) (inhibit-read-only t)) diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el index d40815a..4bf30f1 100644 --- a/lisp/mastodon-notifications.el +++ b/lisp/mastodon-notifications.el @@ -140,11 +140,11 @@ (defun mastodon-notifications--get () "Display NOTIFICATIONS in buffer." (interactive) + (message "Loading your nofications...") (mastodon-tl--init - "*mastodon-notifications*" "notifications" - 'mastodon-notifications--timeline) - (message "Loading your nofications...")) + "notifications" + 'mastodon-notifications--timeline)) (provide 'mastodon-notifications) ;;; mastodon-notifications.el ends here diff --git a/lisp/mastodon.el b/lisp/mastodon.el index 6096c55..4d0b940 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -72,6 +72,7 @@ (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") (defgroup mastodon nil "Interface with Mastodon." @@ -139,6 +140,10 @@ Use. e.g. \"%c\" for your locale's date and time format." (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 "C-c h") #'mastodon-async--stream-home) + (define-key map (kbd "C-c f") #'mastodon-async--stream-federated) + (define-key map (kbd "C-c l") #'mastodon-async--stream-local) + (define-key map (kbd "C-c n") #'mastodon-async--stream-notifications) map) "Keymap for `mastodon-mode'.") -- cgit v1.2.3 From a32a239d7e64d46df8e76c712a2335cecf8776e9 Mon Sep 17 00:00:00 2001 From: mousebot Date: Sat, 5 Jun 2021 12:43:19 +0200 Subject: implement updating user profile note uses a tiny minor mode 'profile-update', with bindings. U is a general binding for it. --- README.org | 8 +++--- lisp/mastodon-http.el | 25 +++++++++++++++++- lisp/mastodon-profile.el | 69 +++++++++++++++++++++++++++++++++++++++++++----- lisp/mastodon.el | 4 ++- 4 files changed, 94 insertions(+), 12 deletions(-) (limited to 'README.org') diff --git a/README.org b/README.org index 6da0f4b..c6eab5a 100644 --- a/README.org +++ b/README.org @@ -6,13 +6,15 @@ It adds the following features: | Profiles: | | | | display profile metadata fields | +| | display pinned toots on profiles | | | display relationship (follows you/followed by you) on profiles | | | display toots/follows/followers counts on profiles | -| | links and tags in profiles are tab stops like in posts | +| | links and tags in profiles and metadata fields are tab stops like in posts | | =R=, =a=, =r= | view/accept/reject follow requests | | =v= | view your favorited toots | -| =i= | (un)pin toots, display pinned toots on profiles | +| =i= | (un)pin toots | | =S-C-P= | jump to your profile | +| =U= | update your profile bio note | | Timelines: | | | =W=, =M=, =B= | (un)follow, (un)mute, (un)block users | | | images are links to the full image, can be zoomed/rotated/saved (see their keymap) | @@ -37,7 +39,7 @@ I did this for my own use and to learn more Elisp. If the code is terrible, feel (code adapted from https://github.com/alexjgriffith/mastodon-future.el). -Works for federated, local, and home timelines and for notifications. It's pretty necro, so use at your own risk. Not a super high priority for me, but some people dig it. The command prefix is =mastodon-async--stream= +Works for federated, local, and home timelines and for notifications. It's pretty necro, so use at your own risk. Not a super high priority for me, but some people dig it. The command prefix is =mastodon-async--stream=. ** NB: dependency diff --git a/lisp/mastodon-http.el b/lisp/mastodon-http.el index e85429f..678e628 100644 --- a/lisp/mastodon-http.el +++ b/lisp/mastodon-http.el @@ -137,7 +137,7 @@ Pass response buffer to CALLBACK function." (with-temp-buffer (url-retrieve-synchronously url)))) -;; http functions for search: +;; search functions: (defun mastodon-http--process-json-search () "Process JSON returned by a search query to the server." (goto-char (point-min)) @@ -168,6 +168,29 @@ Pass response buffer to CALLBACK function." (url-retrieve-synchronously url) (url-retrieve-synchronously url nil nil mastodon-http--timeout)))) +;; profile update functions + +(defun mastodon-http--patch-json (url) + "Make synchronous PATCH request to URL. Return JSON response." + (with-current-buffer (mastodon-http--patch url) + (mastodon-http--process-json))) + +;; hard coded just for bio note for now: +(defun mastodon-http--patch (base-url &optional note) + "Make synchronous PATCH request to URL. + +Pass response buffer to CALLBACK function." + (let ((url-request-method "PATCH") + (url (if note + (concat base-url "?note=" (url-hexify-string note)) + base-url)) + (url-request-extra-headers + `(("Authorization" . ,(concat "Bearer " + (mastodon-auth--access-token)))))) + (if (< (cdr (func-arity 'url-retrieve-synchronously)) 4) + (url-retrieve-synchronously url) + (url-retrieve-synchronously url nil nil mastodon-http--timeout)))) + ;; Asynchronous functions (defun mastodon-http--get-async (url &optional callback &rest cbargs) diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index 84664c0..0b7ecc4 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -53,15 +53,28 @@ (autoload 'mastodon-tl--toot-id "mastodon-tl") (autoload 'mastodon-tl--toot "mastodon-tl") (autoload 'mastodon-tl--init "mastodon-tl.el") +(autoload 'mastodon-http--patch "mastodon-http") +(autoload 'mastodon-http--patch-json "mastodon-http") (defvar mastodon-instance-url) (defvar mastodon-tl--buffer-spec) (defvar mastodon-tl--update-point) + (defvar mastodon-profile--account nil "The data for the account being described in the current profile buffer.") (make-variable-buffer-local 'mastodon-profile--account) +;; this way you can update it with C-M-x: +(defvar mastodon-profile-mode-map + (let ((map (make-sparse-keymap))) + (define-key map (kbd "O") #'mastodon-profile--open-followers) + (define-key map (kbd "o") #'mastodon-profile--open-following) + (define-key map (kbd "a") #'mastodon-profile--follow-request-accept) + (define-key map (kbd "r") #'mastodon-profile--follow-request-reject) + map) + "Keymap for `mastodon-profile-mode'.") + (define-minor-mode mastodon-profile-mode "Toggle mastodon profile minor mode. @@ -70,12 +83,26 @@ extra keybindings." :init-value nil ;; The mode line indicator. :lighter " Profile" - ;; The key bindings - :keymap '(((kbd "O") . mastodon-profile--open-followers) - ((kbd "o") . mastodon-profile--open-following) - ((kbd "a") . mastodon-profile--follow-request-accept) - ((kbd "r") . mastodon-profile--follow-request-reject)) - :group 'mastodon) + :keymap mastodon-profile-mode-map + ;; :keymap '(((kbd "O") . mastodon-profile--open-followers) + ;; ((kbd "o") . mastodon-profile--open-following) + ;; ((kbd "a") . mastodon-profile--follow-request-accept) + ;; ((kbd "r") . mastodon-profile--follow-request-reject) + :group 'mastodon + :global nil) + +(defvar mastodon-profile-update-mode-map + (let ((map (make-sparse-keymap))) + (define-key map (kbd "C-c C-c") #'mastodon-profile--user-profile-send-updated) + (define-key map (kbd "C-c C-k") #'kill-buffer-and-window) + map) + "Keymap for `mastodon-profile-update-mode'.") + +(define-minor-mode mastodon-profile-update-mode + "Minor mode to update Mastodon user profile." + :group 'mastodon-profile + :keymap mastodon-profile-update-mode-map + :global nil) (defun mastodon-profile--toot-json () "Get the next toot-json." @@ -112,6 +139,7 @@ following the current profile." (defun mastodon-profile--view-favourites () "Open a new buffer displaying the user's favourites." (interactive) + (message "Loading your favourited toots...") (mastodon-tl--init "favourites" "favourites" 'mastodon-tl--timeline)) @@ -164,6 +192,33 @@ following the current profile." name handle)))) (message "No account result at point?")))) +(defun mastodon-profile--update-user-profile-note () + "Fetch user's profile note and display for editing." + (interactive) + (let* ((url (concat mastodon-instance-url + "/api/v1/accounts/update_credentials")) + ;; (buffer (mastodon-http--patch url)) + (json (mastodon-http--patch-json url)) + (source (cdr (assoc 'source json))) + (note (cdr (assoc 'note source))) + (buffer (get-buffer-create "*mastodon-update-profile*")) + (inhibit-read-only t)) + (switch-to-buffer-other-window buffer) + (mastodon-profile-update-mode t) + (insert note) + (goto-char (point-min)) + (message "Edit your profile note. C-c C-c to send, C-c C-k to cancel."))) + +(defun mastodon-profile--user-profile-send-updated () + "Send PATCH request with the updated profile note." + (interactive) + (let* ((note (buffer-substring-no-properties (point-min) (point-max))) + (url (concat mastodon-instance-url + "/api/v1/accounts/update_credentials"))) + (kill-buffer-and-window) + (let ((response (mastodon-http--patch url note))) + (mastodon-http--triage response + (lambda () (message "Profile note updated!")))))) (defun mastodon-profile--relationships-get (id) "Fetch info about logged-in user's relationship to user with id ID." @@ -205,7 +260,7 @@ Returns a list of lists." (format " :: %s" (cadr field))) ;; (make-string (- (+ 1 right-width) (length (cdr field))) ?_) ;; " |") - nil)) + field)) ; nil)) ; hack to make links tabstops fields ""))) (defun mastodon-profile--get-statuses-pinned (account) diff --git a/lisp/mastodon.el b/lisp/mastodon.el index 4d0b940..c1c4360 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -73,6 +73,7 @@ (autoload 'mastodon-async--stream-local "mastodon-async") (autoload 'mastodon-async--stream-home "mastodon-async") (autoload 'mastodon-async--stream-notifications "mastodon-async") +(autoload 'mastodon-profile--update-user-profile-note "mastodon-profile") (defgroup mastodon nil "Interface with Mastodon." @@ -143,7 +144,8 @@ Use. e.g. \"%c\" for your locale's date and time format." (define-key map (kbd "C-c h") #'mastodon-async--stream-home) (define-key map (kbd "C-c f") #'mastodon-async--stream-federated) (define-key map (kbd "C-c l") #'mastodon-async--stream-local) - (define-key map (kbd "C-c n") #'mastodon-async--stream-notifications) + (define-key map (kbd "C-c n") #'mastodon-async--stream-notifications) + (define-key map (kbd "U") #'mastodon-profile--update-user-profile-note) map) "Keymap for `mastodon-mode'.") -- cgit v1.2.3 From c9a80513b451ebab95eca3b4dda7e2ece6bcbbd2 Mon Sep 17 00:00:00 2001 From: mousebot Date: Mon, 14 Jun 2021 14:29:42 +0200 Subject: typos and readme --- README.org | 44 +++++++++++++++++++++++------------------- lisp/mastodon-notifications.el | 2 +- lisp/mastodon.el | 2 +- 3 files changed, 26 insertions(+), 22 deletions(-) (limited to 'README.org') diff --git a/README.org b/README.org index c6eab5a..21ae34a 100644 --- a/README.org +++ b/README.org @@ -39,7 +39,11 @@ I did this for my own use and to learn more Elisp. If the code is terrible, feel (code adapted from https://github.com/alexjgriffith/mastodon-future.el). -Works for federated, local, and home timelines and for notifications. It's pretty necro, so use at your own risk. Not a super high priority for me, but some people dig it. The command prefix is =mastodon-async--stream=. +Works for federated, local, and home timelines and for notifications. It's pretty necro, so use at your own risk. Not a super high priority for me, but some people dig it. The command prefix is =mastodon-async--stream=, and you can load various timelines from within a mastodon session like so: +- =C-c h= (home) +- =C-c f= (federated) +- =C-c l= (local) +- =C-c n= (notifications). ** NB: dependency @@ -64,9 +68,9 @@ I might add a few more features if the ones I added turn out to work ok. Possibl It looks like 2-factor auth was never completed in the original repo. It's not a priority for me, auth ain't my thing. If you want to hack on it, its on the develop branch in the original repo. -** Original README +* Original README -*** Installation +** Installation Clone this repository and add the lisp directory to your load path. Then, require it and go. @@ -83,7 +87,7 @@ Or, with =use-package=: :ensure t) #+END_SRC -**** MELPA +*** MELPA Add =MELPA= to your archives: @@ -99,12 +103,12 @@ Update and install: =M-x package-install RET mastodon RET= -**** Emoji +*** Emoji =mastodon-mode= will enable [[https://github.com/iqbalansari/emacs-emojify][Emojify]] if it is loaded in your Emacs environment, so there's no need to write your own hook anymore. =emojify-mode= is not required. -**** Discover +*** Discover =mastodon-mode= can provide a context menu for its keybindings if [[https://github.com/mickeynp/discover.el][Discover]] is installed. It is not required. @@ -125,12 +129,12 @@ Or, with =use-package=: (mastodon-discover)) #+END_SRC -*** Usage -**** 2 Factor Auth +** Usage +*** 2 Factor Auth 2FA is not supported yet. It is in the [[https://github.com/jdenen/mastodon.el/milestone/2][plans]] for the =1.0.0= release. If you have 2FA enabled and try to use mastodon.el, your Emacs client will hang until you `C-g` your way out. -**** Instance +*** Instance Set =mastodon-instance-url= in your =.emacs= or =customize=. Defaults to the [[https://mastodon.social][flagship]]. @@ -142,13 +146,13 @@ There is an option to have your user credentials (email address and password) sa The default is not to do this because if not properly configured it would save these unencrypted which is not a good default to have. Customize the variable =mastodon-auth-source-file= if you want to enable this feature. -**** Timelines +*** Timelines =M-x mastodon= Opens a =*mastodon-home*= buffer in the major mode so you can see toots. You will be prompted for email and password. The app registration process will take place if your =mastodon-token-file= does not contain =:client_id= and =:client_secret=. -***** Keybindings +**** Keybindings |-----------------+---------------------------------------------------------| | Key | Action | @@ -181,7 +185,7 @@ Opens a =*mastodon-home*= buffer in the major mode so you can see toots. You wil | =Q= | Quit mastodon buffer and kill window | |-----------------+---------------------------------------------------------| -***** Legend +**** Legend |--------+-------------------------| | Marker | Meaning | @@ -190,7 +194,7 @@ Opens a =*mastodon-home*= buffer in the major mode so you can see toots. You wil | =(F)= | I favourited this toot. | |--------+-------------------------| -**** Toot toot +*** Toot toot =M-x mastodon-toot= @@ -205,12 +209,12 @@ Authentication stores your access token in the =mastodon-auth--token= variable. It is not stored on your filesystem, so you will have to re-authenticate when you close/reopen Emacs. -***** Customization +**** Customization The default toot visibility can be changed by setting or customizing the =mastodon-toot--default-visibility= variable. Valid values are ="public"=, ="unlisted"=, ="private"=, or =direct=. Toot visibility can also be changed on a per-toot basis from the new toot buffer. -***** Keybindings +**** Keybindings |-----------+------------------------| | Key | Action | @@ -221,28 +225,28 @@ Toot visibility can also be changed on a per-toot basis from the new toot buffer | =C-c C-v= | Change toot visibility | |-----------+------------------------| -*** Roadmap +** Roadmap [[https://github.com/jdenen/mastodon.el/milestone/1][Here]] are the features I plan to implement before putting mastodon.el on MELPA. [[https://github.com/jdenen/mastodon.el/milestone/2][Here]] are the plans I have for the =1.0.0= release. -*** Contributing +** Contributing PRs, issues, and feature requests are very welcome! -**** Features +*** Features 1. Create an [[https://github.com/jdenen/mastodon.el/issues][issue]] detailing the feature you'd like to add. 2. Fork the repository and create a branch off of =develop=. 3. Create a pull request referencing the issue created in step 1. -**** Fixes +*** Fixes 1. In an [[https://github.com/jdenen/mastodon.el/issues][issue]], let me know that you're working to fix it. 2. Fork the repository and create a branch off of =develop=. 3. Create a pull request referencing the issue from step 1. -*** Connect +** Connect If you want to get in touch with me, give me a [[https://mastodon.social/@johnson][toot]] or leave an [[https://github.com/jdenen/mastodon.el/issues][issue]]. diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el index 4bf30f1..51806a3 100644 --- a/lisp/mastodon-notifications.el +++ b/lisp/mastodon-notifications.el @@ -140,7 +140,7 @@ (defun mastodon-notifications--get () "Display NOTIFICATIONS in buffer." (interactive) - (message "Loading your nofications...") + (message "Loading your notifications...") (mastodon-tl--init "notifications" "notifications" diff --git a/lisp/mastodon.el b/lisp/mastodon.el index e166671..430362d 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -30,7 +30,7 @@ ;; it is a labor of love. ;;; Code: -(require 'cl-lib) ; for some call in mastodon +(require 'cl-lib) ; for `some' call in mastodon (declare-function discover-add-context-menu "discover") (declare-function emojify-mode "emojify") -- cgit v1.2.3 From 7afc5a08e35c86acc9f009404045a787ef61b77b Mon Sep 17 00:00:00 2001 From: mousebot Date: Mon, 21 Jun 2021 11:33:40 +0200 Subject: typo in async http-layer, unless in http process-json, typo in readm --- README.org | 2 +- lisp/mastodon-async.el | 2 +- lisp/mastodon-http.el | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) (limited to 'README.org') diff --git a/README.org b/README.org index 21ae34a..5adab37 100644 --- a/README.org +++ b/README.org @@ -37,7 +37,7 @@ I did this for my own use and to learn more Elisp. If the code is terrible, feel ** live-updating timelines -(code adapted from https://github.com/alexjgriffith/mastodon-future.el). +(code adapted from https://github.com/alexjgriffith/mastodon-future.el.) Works for federated, local, and home timelines and for notifications. It's pretty necro, so use at your own risk. Not a super high priority for me, but some people dig it. The command prefix is =mastodon-async--stream=, and you can load various timelines from within a mastodon session like so: - =C-c h= (home) diff --git a/lisp/mastodon-async.el b/lisp/mastodon-async.el index 1690615..4367cc9 100644 --- a/lisp/mastodon-async.el +++ b/lisp/mastodon-async.el @@ -342,7 +342,7 @@ Full messages are seperated by two newlines" It then processes its output." (with-current-buffer (process-buffer proc) - (let ((start (max 1 ( - (point-max) 2)))) + (let ((start (max 1 (- (point-max) 2)))) (url-http-generic-filter proc data) (when (> url-http-end-of-headers start) (setq start url-http-end-of-headers)) diff --git a/lisp/mastodon-http.el b/lisp/mastodon-http.el index 144b446..e8fd4d3 100644 --- a/lisp/mastodon-http.el +++ b/lisp/mastodon-http.el @@ -126,9 +126,8 @@ Pass response buffer to CALLBACK function." (buffer-substring-no-properties (point) (point-max)) 'utf-8))) (kill-buffer) - (if (not (or (string= "" json-string) (equal nil json-string))) - (json-read-from-string json-string) - (message "Looks like we got no JSON from the server.")))) + (unless (or (string= "" json-string) (equal nil json-string))) + (json-read-from-string json-string))) (defun mastodon-http--delete (url) "Make DELETE request to URL." -- cgit v1.2.3 From f919763630dbc0fbc5ed86666bce380aa09562e6 Mon Sep 17 00:00:00 2001 From: mousebot Date: Wed, 28 Jul 2021 14:38:37 +0200 Subject: readme mastodon-toot bugs --- README.org | 2 ++ 1 file changed, 2 insertions(+) (limited to 'README.org') diff --git a/README.org b/README.org index 5adab37..2eec284 100644 --- a/README.org +++ b/README.org @@ -53,6 +53,8 @@ This version depends on the library =request= (for uploading attachments). You c As it stands the client still has some bugs. In particular, when composing a toot, hit =C-g= before sending your toot. If you don't, your draft may disappear. You may also see a related error when you try to add a media attachment. You should be able to run the command again and it should work. See the issues on the original repo. +In addition, if you create and send a toot with =mastodon-toot= / =C-c t= before otherwise opening the client, various little things break. + Some people have also had niggling troubles with initial auth and set-up, but I couldn't reproduce. ** roadmap-ish -- cgit v1.2.3 From cef6093d477323635e553655498703c480bf00aa Mon Sep 17 00:00:00 2001 From: mousebot Date: Mon, 9 Aug 2021 13:00:04 +0200 Subject: readme update --- README.org | 57 +++++++++++++++++++++++++++++---------------------------- 1 file changed, 29 insertions(+), 28 deletions(-) (limited to 'README.org') diff --git a/README.org b/README.org index 2eec284..cb4a37a 100644 --- a/README.org +++ b/README.org @@ -4,28 +4,29 @@ This is a fork of of the great but seemingly dormant https://github.com/jdenen/m It adds the following features: -| Profiles: | | -| | display profile metadata fields | -| | display pinned toots on profiles | -| | display relationship (follows you/followed by you) on profiles | -| | display toots/follows/followers counts on profiles | -| | links and tags in profiles and metadata fields are tab stops like in posts | -| =R=, =a=, =r= | view/accept/reject follow requests | -| =v= | view your favorited toots | -| =i= | (un)pin toots | -| =S-C-P= | jump to your profile | -| =U= | update your profile bio note | -| Timelines: | | -| =W=, =M=, =B= | (un)follow, (un)mute, (un)block users | -| | images are links to the full image, can be zoomed/rotated/saved (see their keymap) | -| =C= | copy url of toot at point | -| =d= | delete your toot at point | -| | display polls (very basic for now) | -| Toots: | | -| =C-c C-a= (=C-c C-n=) | media uploads (and sensitive/nsfw flag) | -| | mention booster in replies by default | -| Search: | | -| =S= | search (posts, users, tags) (improved! but still pretty basic!) | +| Profiles: | | +| | display profile metadata fields | +| | display pinned toots on profiles | +| | display relationship (follows you/followed by you) on profiles | +| | display toots/follows/followers counts on profiles | +| | links/tags/mentions in profiles are active links | +| =R=, =C-c a=, =C-c r= | view/accept/reject follow requests | +| =v= | view your favorited toots | +| =i= | toggle pinning of toots | +| =S-C-P= | jump to your profile | +| =U= | update your profile bio note | +| Timelines: | | +| =C= | copy url of toot at point | +| =d= | delete your toot at point | +| =W=, =M=, =B= | (un)follow, (un)mute, (un)block author of toot at point | +| | display polls (very basic for now) | +| | images are links to the full image, can be zoomed/rotated/saved (see their keymap) | +| Toots: | | +| | mention booster in replies by default | +| =C-c C-a= | media uploads | +| =C-c C-n= | and sensitive media/nsfw flag | +| Search: | | +| =S= | search (posts, users, tags) (improved! but still rly basic!) (NB: by default, posts searched will only be those you have interacted with in some way; your instance can optionally enable full search) | It also makes some small cosmetic changes to make timelines easier to read, and makes some functions asynchronous, based on https://github.com/ieure/mastodon.el. @@ -33,17 +34,17 @@ This updated version is not on MELPA, to use it you need to clone and require it The minimum Emacs version is now 25.1. But if you are running an older version it shouldn't be very hard to get it working. -I did this for my own use and to learn more Elisp. If the code is terrible, feel free to improve or replace it. It surely still contains errors, I'm only weeding them out as I find them. +I did this for my own use and to learn more Elisp. Feel free to improve it. ** live-updating timelines (code adapted from https://github.com/alexjgriffith/mastodon-future.el.) -Works for federated, local, and home timelines and for notifications. It's pretty necro, so use at your own risk. Not a super high priority for me, but some people dig it. The command prefix is =mastodon-async--stream=, and you can load various timelines from within a mastodon session like so: +Works for federated, local, and home timelines and for notifications. It's pretty necro, sometimes it goes off the rails, so use at your own risk. Not a super high priority for me, but some people dig it. The command prefix is =mastodon-async--stream=, and you can load various timelines from within a mastodon session like so: - =C-c h= (home) - =C-c f= (federated) - =C-c l= (local) -- =C-c n= (notifications). +- =C-c n= (notifications) ** NB: dependency @@ -53,17 +54,17 @@ This version depends on the library =request= (for uploading attachments). You c As it stands the client still has some bugs. In particular, when composing a toot, hit =C-g= before sending your toot. If you don't, your draft may disappear. You may also see a related error when you try to add a media attachment. You should be able to run the command again and it should work. See the issues on the original repo. -In addition, if you create and send a toot with =mastodon-toot= / =C-c t= before otherwise opening the client, various little things break. - Some people have also had niggling troubles with initial auth and set-up, but I couldn't reproduce. ** roadmap-ish I might add a few more features if the ones I added turn out to work ok. Possible additions/amendments: -- update profile note. +- [X] update profile note. +- [X] fix loading more notifications re-loads the same ones - voting on polls - better display of polls +- display number of boosts/faves in toot byline - mention all thread participants in replies - handle newlines in toots better, for poetry, etc. - improve async. -- cgit v1.2.3 From 2efdb5eb4ddc824ad269af096cb508b8f6867077 Mon Sep 17 00:00:00 2001 From: mousebot Date: Mon, 9 Aug 2021 17:46:19 +0200 Subject: follow requests accept/reject from notifications + - new bindings for f-req accept/reject (in both notifs and in f-req views) - check if we are at an f-req before accept/rejecting - flycheck / docstrings - fix notifs byline formatting for f-reqs --- README.org | 1 + lisp/mastodon-notifications.el | 77 ++++++++++++++++++++++++++++++++------- lisp/mastodon-profile.el | 81 ++++++++++++++++++++++-------------------- lisp/mastodon.el | 4 +++ 4 files changed, 111 insertions(+), 52 deletions(-) (limited to 'README.org') diff --git a/README.org b/README.org index cb4a37a..5969950 100644 --- a/README.org +++ b/README.org @@ -62,6 +62,7 @@ I might add a few more features if the ones I added turn out to work ok. Possibl - [X] update profile note. - [X] fix loading more notifications re-loads the same ones +- [X] view/accept/reject follow requests in notifications view. - voting on polls - better display of polls - display number of boosts/faves in toot byline diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el index 676b4a8..caeb9cd 100644 --- a/lisp/mastodon-notifications.el +++ b/lisp/mastodon-notifications.el @@ -54,7 +54,7 @@ ("Followed" . "you") ("Favourited" . "your status from") ("Boosted" . "your status from") - ("Follow request" . "requested to follow you")) + ("Requested to follow" . "you")) "Alist of subjects for notification types.") (defun mastodon-notifications--byline-concat (message) @@ -65,6 +65,59 @@ " " (cdr (assoc message mastodon-notifications--response-alist)))) + +(defun mastodon-notifications--follow-request-accept-notifs () + "Accept the follow request of user at point, in notifications view." + (interactive) + (when (mastodon-tl--find-property-range 'toot-json (point)) + (let* ((toot-json (mastodon-tl--property 'toot-json)) + (f-req-p (string= "follow_request" (cdr (assoc 'type toot-json))))) + (if f-req-p + (let* ((account (cdr (assoc 'account toot-json))) + (id (cdr (assoc 'id account))) + (handle (cdr (assoc 'acct account))) + (name (cdr (assoc 'username account)))) + (if id + (let ((response + (mastodon-http--post + (concat + (mastodon-http--api "follow_requests") + (format "/%s/authorize" id)) + nil nil))) + (mastodon-http--triage response + (lambda () + (mastodon-notifications--get) + (message "Follow request of %s (@%s) accepted!" + name handle)))) + (message "No account result at point?"))) + (message "No follow request at point?"))))) + +(defun mastodon-notifications--follow-request-reject-notifs () + "Reject the follow request of user at point, in notifications view." + (interactive) + (when (mastodon-tl--find-property-range 'toot-json (point)) + (let* ((toot-json (mastodon-tl--property 'toot-json)) + (f-req-p (string= "follow_request" (cdr (assoc 'type toot-json))))) + (if f-req-p + (let* ((account (cdr (assoc 'account toot-json))) + (id (cdr (assoc 'id account))) + (handle (cdr (assoc 'acct account))) + (name (cdr (assoc 'username account)))) + (if id + (let ((response + (mastodon-http--post + (concat + (mastodon-http--api "follow_requests") + (format "/%s/reject" id)) + nil nil))) + (mastodon-http--triage response + (lambda () + (mastodon-notifications--get) + (message "Follow request of %s (@%s) rejected!" + name handle)))) + (message "No account result at point?"))) + (message "No follow request at point?"))))) + (defun mastodon-notifications--mention (note) "Format for a `mention' NOTE." (let ((id (cdr (assoc 'id note))) @@ -97,19 +150,16 @@ (defun mastodon-notifications--follow-request (note) "Format for a `follow-request' NOTE." (let ((id (cdr (assoc 'id note))) - (status (mastodon-tl--field 'status note)) (follower (cdr (assoc 'username (cdr (assoc 'account note)))))) (mastodon-notifications--insert-status - ;; Using reblog with an empty id will mark this as something - ;; non-boostable/non-favable. - (cons '(reblog (id . nil)) note) - (propertize (format "You have a follow request from... %s" follower) - 'face 'default) - 'mastodon-tl--byline-author - (lambda (_status) - (mastodon-notifications--byline-concat - "Requested to follow you")) - id))) + (cons '(reblog (id . nil)) note) + (propertize (format "You have a follow request from... %s" follower) + 'face 'default) + 'mastodon-tl--byline-author + (lambda (_status) + (mastodon-notifications--byline-concat + "Requested to follow")) + id))) (defun mastodon-notifications--favourite (note) "Format for a `favourite' NOTE." @@ -155,7 +205,8 @@ AUTHOR-BYLINE is an optional function for adding the author portion of the byline that takes one variable. By default it is `mastodon-tl--byline-author' ACTION-BYLINE is also an optional function for adding an action, such as boosting favouriting and following to the byline. It also takes a single function. By default -it is `mastodon-tl--byline-boosted'" +it is `mastodon-tl--byline-boosted'. +ID is the notification's own id, which is attached as a property." (let ((start-pos (point))) (insert (propertize diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index 0c1ec91..82eb4db 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -46,6 +46,7 @@ (autoload 'mastodon-tl--byline-author "mastodon-tl.el") (autoload 'mastodon-tl--goto-next-toot "mastodon-tl.el") (autoload 'mastodon-tl--property "mastodon-tl.el") +(autoload 'mastodon-tl--find-property-range "mastodon-tl.el") (autoload 'mastodon-tl--render-text "mastodon-tl.el") (autoload 'mastodon-tl--set-face "mastodon-tl.el") (autoload 'mastodon-tl--timeline "mastodon-tl.el") @@ -70,8 +71,8 @@ (let ((map (make-sparse-keymap))) (define-key map (kbd "O") #'mastodon-profile--open-followers) (define-key map (kbd "o") #'mastodon-profile--open-following) - (define-key map (kbd "C-c a") #'mastodon-profile--follow-request-accept) - (define-key map (kbd "C-c r") #'mastodon-profile--follow-request-reject) + (define-key map (kbd "a") #'mastodon-profile--follow-request-accept) + (define-key map (kbd "j") #'mastodon-profile--follow-request-reject) map) "Keymap for `mastodon-profile-mode'.") @@ -110,13 +111,12 @@ extra keybindings." (mastodon-tl--property 'toot-json)) (defun mastodon-profile--make-author-buffer (account) - "Take a ACCOUNT and inserts a user account into a new buffer." + "Take a ACCOUNT and insert a user account into a new buffer." (mastodon-profile--make-profile-buffer-for account "statuses" #'mastodon-tl--timeline)) (defun mastodon-profile--open-following () - "Open a profile buffer for the current profile showing the accounts -that current profile follows." + "Open a profile buffer showing the accounts that current profile follows." (interactive) (if mastodon-profile--account (mastodon-profile--make-profile-buffer-for @@ -126,8 +126,7 @@ that current profile follows." (error "Not in a mastodon profile"))) (defun mastodon-profile--open-followers () - "Open a profile buffer for the current profile showing the accounts -following the current profile." + "Open a profile buffer showing the accounts following the current profile." (interactive) (if mastodon-profile--account (mastodon-profile--make-profile-buffer-for @@ -155,42 +154,46 @@ following the current profile." (defun mastodon-profile--follow-request-accept () "Accept the follow request of user at point." (interactive) - (let* ((acct-json (mastodon-profile--toot-json)) - (id (cdr (assoc 'id acct-json))) - (handle (cdr (assoc 'acct acct-json))) - (name (cdr (assoc 'username acct-json)))) - (if id - (let ((response - (mastodon-http--post - (concat - (mastodon-http--api "follow_requests") - (format "/%s/authorize" id)) - nil nil))) - (mastodon-http--triage response - (lambda () - (message "Follow request of %s (@%s) accepted!" - name handle)))) - (message "No account result at point?")))) + (if (mastodon-tl--find-property-range 'toot-json (point)) + (let* ((acct-json (mastodon-profile--toot-json)) + (id (cdr (assoc 'id acct-json))) + (handle (cdr (assoc 'acct acct-json))) + (name (cdr (assoc 'username acct-json)))) + (if id + (let ((response + (mastodon-http--post + (concat + (mastodon-http--api "follow_requests") + (format "/%s/authorize" id)) + nil nil))) + (mastodon-http--triage response + (lambda () + (message "Follow request of %s (@%s) accepted!" + name handle)))) + (message "No account result at point?"))) + (message "No follow request at point?"))) (defun mastodon-profile--follow-request-reject () "Reject the follow request of user at point." (interactive) - (let* ((acct-json (mastodon-profile--toot-json)) - (id (cdr (assoc 'id acct-json))) - (handle (cdr (assoc 'acct acct-json))) - (name (cdr (assoc 'username acct-json)))) - (if id - (let ((response - (mastodon-http--post - (concat - (mastodon-http--api "follow_requests") - (format "/%s/reject" id)) - nil nil))) - (mastodon-http--triage response - (lambda () - (message "Follow request of %s (@%s) rejected!" - name handle)))) - (message "No account result at point?")))) + (if (mastodon-tl--find-property-range 'toot-json (point)) + (let* ((acct-json (mastodon-profile--toot-json)) + (id (cdr (assoc 'id acct-json))) + (handle (cdr (assoc 'acct acct-json))) + (name (cdr (assoc 'username acct-json)))) + (if id + (let ((response + (mastodon-http--post + (concat + (mastodon-http--api "follow_requests") + (format "/%s/reject" id)) + nil nil))) + (mastodon-http--triage response + (lambda () + (message "Follow request of %s (@%s) rejected!" + name handle)))) + (message "No account result at point?"))) + (message "No follow request at point?"))) (defun mastodon-profile--update-user-profile-note () "Fetch user's profile note and display for editing." diff --git a/lisp/mastodon.el b/lisp/mastodon.el index 96a092f..a918b44 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -66,6 +66,8 @@ (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-notifs "mastodon-profile") +(autoload 'mastodon-notifications--follow-request-reject-notifs "mastodon-profile") (autoload 'mastodon-search--search-query "mastodon-search") (autoload 'mastodon-toot--delete-toot "mastodon-toot") (autoload 'mastodon-toot--copy-toot-url "mastodon-toot") @@ -149,6 +151,8 @@ Use. e.g. \"%c\" for your locale's date and time format." (define-key map (kbd "C-c l") #'mastodon-async--stream-local) (define-key map (kbd "C-c n") #'mastodon-async--stream-notifications) (define-key map (kbd "U") #'mastodon-profile--update-user-profile-note) + (define-key map (kbd "a") #'mastodon-notifications--follow-request-accept-notifs) + (define-key map (kbd "j") #'mastodon-notifications--follow-request-reject-notifs) map) "Keymap for `mastodon-mode'.") -- cgit v1.2.3 From d91d881a634f84e50c70e8be882bcfb278c64823 Mon Sep 17 00:00:00 2001 From: mousebot Date: Mon, 9 Aug 2021 23:14:44 +0200 Subject: functions to vote on polls in timelines, bound to "v" - masto view favorites binding moved to "V", in line with other separate views being in capitals --- README.org | 5 +++-- lisp/mastodon-tl.el | 46 ++++++++++++++++++++++++++++++++++++++++++---- lisp/mastodon.el | 4 +++- 3 files changed, 48 insertions(+), 7 deletions(-) (limited to 'README.org') diff --git a/README.org b/README.org index 5969950..6cf318e 100644 --- a/README.org +++ b/README.org @@ -63,12 +63,13 @@ I might add a few more features if the ones I added turn out to work ok. Possibl - [X] update profile note. - [X] fix loading more notifications re-loads the same ones - [X] view/accept/reject follow requests in notifications view. -- voting on polls +- [X] fix sometimes usernames don't appear in timelines +- [X] voting on polls - better display of polls - display number of boosts/faves in toot byline - mention all thread participants in replies - handle newlines in toots better, for poetry, etc. -- improve async. +- improve (or even partially disable) async. It looks like 2-factor auth was never completed in the original repo. It's not a priority for me, auth ain't my thing. If you want to hack on it, its on the develop branch in the original repo. diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index 8f368a3..107f7eb 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -52,7 +52,7 @@ (autoload 'mastodon-http--triage "mastodon-http") (autoload 'mastodon-http--get-json-async "mastodon-http") (autoload 'mastodon-profile--lookup-account-in-status "mastodon-profile") - +(autoload 'mastodon-profile-mode "mastodon-profile") (defvar mastodon-instance-url) (defvar mastodon-toot-timestamp-format) (defvar shr-use-fonts) ;; declare it since Emacs24 didn't have this @@ -691,15 +691,53 @@ it is `mastodon-tl--byline-boosted'" (defun mastodon-tl--get-poll (toot) "If post TOOT is a poll, return a formatted string of poll." (let* ((poll (mastodon-tl--field 'poll toot)) - (options (mastodon-tl--field 'options poll))) + (options (mastodon-tl--field 'options poll)) + (option-counter 0)) (concat "Poll: \n\n" (mapconcat (lambda (option) - (format "Option: %s, %s votes.\n" + (progn + (format "Option %s: %s, %s votes.\n" + (setq option-counter (1+ option-counter)) (cdr (assoc 'title option)) - (cdr (assoc 'votes_count option)))) + (cdr (assoc 'votes_count option))))) options "\n") "\n"))) +(defun mastodon-tl--poll-vote () + "If toot at point is poll, call `mastodon-tl--poll-vote-yes'." + (interactive) + ;; hack coz i don't know how to put this if test before my interactive + (if (null (mastodon-tl--field 'poll (mastodon-tl--property 'toot-json))) + (message "No poll here.") + (call-interactively 'mastodon-tl--poll-vote-yes))) + +(defun mastodon-tl--poll-vote-yes (option) + "Prompt user for OPTION to vote on poll at point." + (interactive + (list + (let* ((toot (mastodon-tl--property 'toot-json)) + (poll (mastodon-tl--field 'poll toot)) + (options (mastodon-tl--field 'options poll)) + (options-number-seq (number-sequence 1 (length options))) + (options-numbers (mapcar (lambda(x) + (number-to-string x)) + options-number-seq))) + (completing-read "Poll option to vote for: " + options-numbers + nil ;predicate + t)))) ;require match + (if (null (mastodon-tl--field 'poll (mastodon-tl--property 'toot-json))) + (message "No poll here.") + (let* ((toot (mastodon-tl--property 'toot-json)) + (poll (mastodon-tl--field 'poll toot)) + (poll-id (cdr (assoc 'id poll))) + (url (mastodon-http--api (format "polls/%s/votes" poll-id))) + (arg `(("choices[]" . ,option))) + (response (mastodon-http--post url arg nil))) + (mastodon-http--triage response + (lambda () + (message "You voted for option %s!" option)))))) + (defun mastodon-tl--toot (toot) "Formats TOOT and insertes it into the buffer." (mastodon-tl--insert-status diff --git a/lisp/mastodon.el b/lisp/mastodon.el index a918b44..fd00ee9 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -79,6 +79,7 @@ (autoload 'mastodon-async--stream-notifications "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") (defgroup mastodon nil "Interface with Mastodon." @@ -144,7 +145,7 @@ Use. e.g. \"%c\" for your locale's date and time format." (define-key map (kbd "d") #'mastodon-toot--delete-toot) (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 "V") #'mastodon-profile--view-favourites) (define-key map (kbd "R") #'mastodon-profile--view-follow-requests) (define-key map (kbd "C-c h") #'mastodon-async--stream-home) (define-key map (kbd "C-c f") #'mastodon-async--stream-federated) @@ -153,6 +154,7 @@ Use. e.g. \"%c\" for your locale's date and time format." (define-key map (kbd "U") #'mastodon-profile--update-user-profile-note) (define-key map (kbd "a") #'mastodon-notifications--follow-request-accept-notifs) (define-key map (kbd "j") #'mastodon-notifications--follow-request-reject-notifs) + (define-key map (kbd "v") #'mastodon-tl--poll-vote) map) "Keymap for `mastodon-mode'.") -- cgit v1.2.3 From 838c75295301e3154c4029792565d661e67e0672 Mon Sep 17 00:00:00 2001 From: mousebot Date: Tue, 10 Aug 2021 00:46:05 +0200 Subject: try to handle reblogged polls --- README.org | 2 +- lisp/mastodon-tl.el | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'README.org') diff --git a/README.org b/README.org index 6cf318e..e7960bf 100644 --- a/README.org +++ b/README.org @@ -19,7 +19,7 @@ It adds the following features: | =C= | copy url of toot at point | | =d= | delete your toot at point | | =W=, =M=, =B= | (un)follow, (un)mute, (un)block author of toot at point | -| | display polls (very basic for now) | +| | display polls and vote on polls (very basic for now) | | | images are links to the full image, can be zoomed/rotated/saved (see their keymap) | | Toots: | | | | mention booster in replies by default | diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index bacbebf..cf87c0a 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -708,7 +708,9 @@ it is `mastodon-tl--byline-boosted'" (interactive (list (let* ((toot (mastodon-tl--property 'toot-json)) - (poll (mastodon-tl--field 'poll toot)) + (reblog (cdr (assoc 'reblog toot))) + (poll (or (cdr (assoc 'poll reblog)) + (mastodon-tl--field 'poll toot))) (options (mastodon-tl--field 'options poll)) (options-titles (mapcar (lambda (x) (cdr (assoc 'title x))) @@ -735,6 +737,8 @@ it is `mastodon-tl--byline-boosted'" candidates)))))) (if (null (mastodon-tl--field 'poll (mastodon-tl--property 'toot-json))) (message "No poll here.") + ;; TODO: match option number up to option titles so we can message + ;; the full option description, not just the number (let* ((toot (mastodon-tl--property 'toot-json)) (poll (mastodon-tl--field 'poll toot)) (poll-id (cdr (assoc 'id poll))) -- cgit v1.2.3 From 53616d194cfcab743558f91e88526e83204ee704 Mon Sep 17 00:00:00 2001 From: mousebot Date: Wed, 22 Sep 2021 17:48:10 +0200 Subject: package-lint: bump to emacs 26.1, disable stream keybindings --- README.org | 10 +++------- lisp/mastodon-async.el | 2 +- lisp/mastodon-auth--test.el | 2 +- lisp/mastodon-auth.el | 2 +- lisp/mastodon-client.el | 2 +- lisp/mastodon-discover.el | 2 +- lisp/mastodon-http.el | 2 +- lisp/mastodon-inspect.el | 2 +- lisp/mastodon-media.el | 2 +- lisp/mastodon-notifications.el | 2 +- lisp/mastodon-profile.el | 2 +- lisp/mastodon-search.el | 2 +- lisp/mastodon-tl.el | 2 +- lisp/mastodon-toot.el | 2 +- lisp/mastodon.el | 18 +++++++++--------- 15 files changed, 25 insertions(+), 29 deletions(-) (limited to 'README.org') diff --git a/README.org b/README.org index e7960bf..4be82c6 100644 --- a/README.org +++ b/README.org @@ -32,19 +32,15 @@ It also makes some small cosmetic changes to make timelines easier to read, and This updated version is not on MELPA, to use it you need to clone and require it as per the installation instructions below. -The minimum Emacs version is now 25.1. But if you are running an older version it shouldn't be very hard to get it working. +The minimum Emacs version is now 26.1. But if you are running an older version it shouldn't be very hard to get it working. I did this for my own use and to learn more Elisp. Feel free to improve it. ** live-updating timelines -(code adapted from https://github.com/alexjgriffith/mastodon-future.el.) +(code taken from https://github.com/alexjgriffith/mastodon-future.el.) -Works for federated, local, and home timelines and for notifications. It's pretty necro, sometimes it goes off the rails, so use at your own risk. Not a super high priority for me, but some people dig it. The command prefix is =mastodon-async--stream=, and you can load various timelines from within a mastodon session like so: -- =C-c h= (home) -- =C-c f= (federated) -- =C-c l= (local) -- =C-c n= (notifications) +Works for federated, local, and home timelines and for notifications. It's pretty necro, sometimes it goes off the rails, so use at your own risk. Not a super high priority for me, but some people dig it. The command prefix is =mastodon-async--stream=. ** NB: dependency diff --git a/lisp/mastodon-async.el b/lisp/mastodon-async.el index 4367cc9..6a421d1 100644 --- a/lisp/mastodon-async.el +++ b/lisp/mastodon-async.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2017 Johnson Denen ;; Author: Johnson Denen ;; Version: 0.7.1 -;; Package-Requires: ((emacs "25.1")) +;; Package-Requires: ((emacs "26.1")) ;; Homepage: https://github.com/jdenen/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-auth--test.el b/lisp/mastodon-auth--test.el index b8705f5..9a765b9 100644 --- a/lisp/mastodon-auth--test.el +++ b/lisp/mastodon-auth--test.el @@ -5,7 +5,7 @@ ;; Author: Ian Eure ;; Version: 0.9.1 ;; Homepage: https://github.com/jdenen/mastodon.el -;; Package-Requires: ((emacs "25.1")) +;; Package-Requires: ((emacs "26.1")) ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-auth.el b/lisp/mastodon-auth.el index 4628e74..3f4ee7d 100644 --- a/lisp/mastodon-auth.el +++ b/lisp/mastodon-auth.el @@ -4,7 +4,7 @@ ;; Author: Johnson Denen ;; Version: 0.9.1 ;; Homepage: https://github.com/jdenen/mastodon.el -;; Package-Requires: ((emacs "25.1")) +;; Package-Requires: ((emacs "26.1")) ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-client.el b/lisp/mastodon-client.el index 90f1375..6439c0a 100644 --- a/lisp/mastodon-client.el +++ b/lisp/mastodon-client.el @@ -4,7 +4,7 @@ ;; Author: Johnson Denen ;; Version: 0.9.1 ;; Homepage: https://github.com/jdenen/mastodon.el -;; Package-Requires: ((emacs "25.1")) +;; Package-Requires: ((emacs "26.1")) ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-discover.el b/lisp/mastodon-discover.el index 2387feb..9c946be 100644 --- a/lisp/mastodon-discover.el +++ b/lisp/mastodon-discover.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2019 Johnson Denen ;; Author: Johnson Denen ;; Version: 0.9.1 -;; Package-Requires: ((emacs "25.1")) +;; Package-Requires: ((emacs "26.1")) ;; Homepage: https://github.com/jdenen/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-http.el b/lisp/mastodon-http.el index 94aa85d..31ea483 100644 --- a/lisp/mastodon-http.el +++ b/lisp/mastodon-http.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Author: Johnson Denen ;; Version: 0.9.1 -;; Package-Requires: ((emacs "25.1") (request "0.2.0")) +;; Package-Requires: ((emacs "26.1") (request "0.2.0")) ;; Homepage: https://github.com/jdenen/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-inspect.el b/lisp/mastodon-inspect.el index c5a8d5d..9559b21 100644 --- a/lisp/mastodon-inspect.el +++ b/lisp/mastodon-inspect.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Author: Johnson Denen ;; Version: 0.9.1 -;; Package-Requires: ((emacs "25.1")) +;; Package-Requires: ((emacs "26.1")) ;; Homepage: https://github.com/jdenen/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-media.el b/lisp/mastodon-media.el index 2100553..c3873df 100644 --- a/lisp/mastodon-media.el +++ b/lisp/mastodon-media.el @@ -4,7 +4,7 @@ ;; Author: Johnson Denen ;; Version: 0.9.1 ;; Homepage: https://github.com/jdenen/mastodon.el -;; Package-Requires: ((emacs "25.1")) +;; Package-Requires: ((emacs "26.1")) ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el index caeb9cd..7524038 100644 --- a/lisp/mastodon-notifications.el +++ b/lisp/mastodon-notifications.el @@ -4,7 +4,7 @@ ;; Author: Johnson Denen ;; Version: 0.9.1 ;; Homepage: https://github.com/jdenen/mastodon.el -;; Package-Requires: ((emacs "25.1")) +;; Package-Requires: ((emacs "26.1")) ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index eb75247..98d11f7 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Author: Johnson Denen ;; Version: 0.9.1 -;; Package-Requires: ((emacs "25.1") (seq "1.8")) +;; Package-Requires: ((emacs "26.1") (seq "1.8")) ;; Homepage: https://github.com/jdenen/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-search.el b/lisp/mastodon-search.el index 5e8253f..3b7e399 100644 --- a/lisp/mastodon-search.el +++ b/lisp/mastodon-search.el @@ -4,7 +4,7 @@ ;; Author: Johnson Denen , martyhiatt ;; Version: 0.9.1 ;; Homepage: https://github.com/jdenen/mastodon.el -;; Package-Requires: ((emacs "25.1")) +;; Package-Requires: ((emacs "26.1")) ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index c5240db..af6f0a2 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -4,7 +4,7 @@ ;; Author: Johnson Denen ;; Version: 0.9.1 ;; Homepage: https://github.com/jdenen/mastodon.el -;; Package-Requires: ((emacs "25.1")) +;; Package-Requires: ((emacs "26.1")) ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index d9f895c..c9184fc 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -4,7 +4,7 @@ ;; Author: Johnson Denen ;; Version: 0.9.1 ;; Homepage: https://github.com/jdenen/mastodon.el -;; Package-Requires: ((emacs "25.1")) +;; Package-Requires: ((emacs "26.1")) ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon.el b/lisp/mastodon.el index fd00ee9..460fe29 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Author: Johnson Denen ;; Version: 0.9.1 -;; Package-Requires: ((emacs "25.1") (request "0.2.0") (seq "1.8")) +;; Package-Requires: ((emacs "26.1") (request "0.2.0") (seq "1.8")) ;; Homepage: https://github.com/jdenen/mastodon.el ;; This file is not part of GNU Emacs. @@ -73,10 +73,10 @@ (autoload 'mastodon-toot--copy-toot-url "mastodon-toot") (autoload 'mastodon-toot--pin-toot-toggle "mastodon-toot") (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--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-profile--update-user-profile-note "mastodon-profile") (autoload 'mastodon-auth--user-acct "mastodon-auth") (autoload 'mastodon-tl--poll-vote "mastodon-http") @@ -147,10 +147,10 @@ Use. e.g. \"%c\" for your locale's date and time format." (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 "C-c h") #'mastodon-async--stream-home) - (define-key map (kbd "C-c f") #'mastodon-async--stream-federated) - (define-key map (kbd "C-c l") #'mastodon-async--stream-local) - (define-key map (kbd "C-c n") #'mastodon-async--stream-notifications) + ;; (define-key map (kbd "C-c h") #'mastodon-async--stream-home) + ;; (define-key map (kbd "C-c f") #'mastodon-async--stream-federated) + ;; (define-key map (kbd "C-c l") #'mastodon-async--stream-local) + ;; (define-key map (kbd "C-c n") #'mastodon-async--stream-notifications) (define-key map (kbd "U") #'mastodon-profile--update-user-profile-note) (define-key map (kbd "a") #'mastodon-notifications--follow-request-accept-notifs) (define-key map (kbd "j") #'mastodon-notifications--follow-request-reject-notifs) -- cgit v1.2.3 From bdf9661de4a67a45cd41f3312c96b26c30396c80 Mon Sep 17 00:00:00 2001 From: mousebot Date: Thu, 23 Sep 2021 16:58:45 +0200 Subject: readme update --- README.org | 55 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 30 insertions(+), 25 deletions(-) (limited to 'README.org') diff --git a/README.org b/README.org index 4be82c6..b8fe9d2 100644 --- a/README.org +++ b/README.org @@ -4,29 +4,32 @@ This is a fork of of the great but seemingly dormant https://github.com/jdenen/m It adds the following features: -| Profiles: | | -| | display profile metadata fields | -| | display pinned toots on profiles | -| | display relationship (follows you/followed by you) on profiles | -| | display toots/follows/followers counts on profiles | -| | links/tags/mentions in profiles are active links | -| =R=, =C-c a=, =C-c r= | view/accept/reject follow requests | -| =v= | view your favorited toots | -| =i= | toggle pinning of toots | -| =S-C-P= | jump to your profile | -| =U= | update your profile bio note | -| Timelines: | | -| =C= | copy url of toot at point | -| =d= | delete your toot at point | -| =W=, =M=, =B= | (un)follow, (un)mute, (un)block author of toot at point | -| | display polls and vote on polls (very basic for now) | -| | images are links to the full image, can be zoomed/rotated/saved (see their keymap) | -| Toots: | | -| | mention booster in replies by default | -| =C-c C-a= | media uploads | -| =C-c C-n= | and sensitive media/nsfw flag | -| Search: | | -| =S= | search (posts, users, tags) (improved! but still rly basic!) (NB: by default, posts searched will only be those you have interacted with in some way; your instance can optionally enable full search) | +| Profiles: | | +| | display profile metadata fields | +| | display pinned toots on profiles | +| | display relationship (follows you/followed by you) on profiles | +| | display toots/follows/followers counts on profiles | +| | links/tags/mentions in profiles are active links | +| =R=, =C-c a=, =C-c r= | view/accept/reject follow requests | +| =v= | view your favorited toots | +| =i= | toggle pinning of toots | +| =S-C-P= | jump to your profile | +| =U= | update your profile bio note | +| Timelines: | | +| =C= | copy url of toot at point | +| =d= | delete your toot at point, and reload current timeline | +| =D= | delete and redraft toot at point | +| =W=, =M=, =B= | (un)follow, (un)mute, (un)block author of toot at point | +| | display polls and vote on polls (pretty basic for now) | +| | images are links to the full image, can be zoomed/rotated/saved (see image keymap) | +| Toots: | | +| | mention booster in replies by default | +| =C-c C-a= | media uploads | +| =C-c C-n= | and sensitive media/nsfw flag | +| | | +| Search: | | +| =S= | search (posts, users, tags) (NB: only posts you have interacted with are searched) | +| | | It also makes some small cosmetic changes to make timelines easier to read, and makes some functions asynchronous, based on https://github.com/ieure/mastodon.el. @@ -48,9 +51,9 @@ This version depends on the library =request= (for uploading attachments). You c ** NB: bugs -As it stands the client still has some bugs. In particular, when composing a toot, hit =C-g= before sending your toot. If you don't, your draft may disappear. You may also see a related error when you try to add a media attachment. You should be able to run the command again and it should work. See the issues on the original repo. +As it stands the client still has some bugs. In particular, when composing a toot, there is a bug in the live character counting. For the moment, you'll likely need to hit =C-c C-c= twice rather than once to send a post. In case your toot buffed disappears and your toot does not post, the toot contents are also copied to the kill ring. You may also see a related error when you try to add a media attachment. You should be able to run the command again and it should work. See the issues on the original repo. -Some people have also had niggling troubles with initial auth and set-up, but I couldn't reproduce. +Some people have also had trouble with initial auth and set-up, but these should be fixed by =50062c5=, by Ian Eure. ** roadmap-ish @@ -61,6 +64,8 @@ I might add a few more features if the ones I added turn out to work ok. Possibl - [X] view/accept/reject follow requests in notifications view. - [X] fix sometimes usernames don't appear in timelines - [X] voting on polls +- [X] delete and redraft toots +- [X] prevent loss of draft toots by the toot-send bug - better display of polls - display number of boosts/faves in toot byline - mention all thread participants in replies -- cgit v1.2.3 From 23c61a59242fcf68ab1cc2b7fcc620b59fe11704 Mon Sep 17 00:00:00 2001 From: mousebot Date: Sun, 3 Oct 2021 20:48:12 +0200 Subject: readme re bugs --- README.org | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'README.org') diff --git a/README.org b/README.org index b8fe9d2..ed080da 100644 --- a/README.org +++ b/README.org @@ -26,6 +26,7 @@ It adds the following features: | | mention booster in replies by default | | =C-c C-a= | media uploads | | =C-c C-n= | and sensitive media/nsfw flag | +| =C-c C-e= | add emoji (if =emojify= installed) | | | | | Search: | | | =S= | search (posts, users, tags) (NB: only posts you have interacted with are searched) | @@ -49,12 +50,6 @@ Works for federated, local, and home timelines and for notifications. It's prett This version depends on the library =request= (for uploading attachments). You can install it from MELPA, or https://github.com/tkf/emacs-request. -** NB: bugs - -As it stands the client still has some bugs. In particular, when composing a toot, there is a bug in the live character counting. For the moment, you'll likely need to hit =C-c C-c= twice rather than once to send a post. In case your toot buffed disappears and your toot does not post, the toot contents are also copied to the kill ring. You may also see a related error when you try to add a media attachment. You should be able to run the command again and it should work. See the issues on the original repo. - -Some people have also had trouble with initial auth and set-up, but these should be fixed by =50062c5=, by Ian Eure. - ** roadmap-ish I might add a few more features if the ones I added turn out to work ok. Possible additions/amendments: @@ -66,6 +61,7 @@ I might add a few more features if the ones I added turn out to work ok. Possibl - [X] voting on polls - [X] delete and redraft toots - [X] prevent loss of draft toots by the toot-send bug +- [ ] display post visibility status - better display of polls - display number of boosts/faves in toot byline - mention all thread participants in replies -- cgit v1.2.3 From 7b2dd904c73b75f3c653db193c85ba61ff9642ca Mon Sep 17 00:00:00 2001 From: mousebot Date: Sun, 3 Oct 2021 21:40:39 +0200 Subject: flycheck: docstrings, autoloads, etc --- README.org | 3 ++- lisp/mastodon-auth.el | 8 +++++--- lisp/mastodon-client.el | 2 +- lisp/mastodon-discover.el | 2 ++ lisp/mastodon-media.el | 21 ++++++++++++--------- lisp/mastodon-notifications.el | 22 +++++++++++++++++----- 6 files changed, 39 insertions(+), 19 deletions(-) (limited to 'README.org') diff --git a/README.org b/README.org index ed080da..1dc23e1 100644 --- a/README.org +++ b/README.org @@ -61,7 +61,8 @@ I might add a few more features if the ones I added turn out to work ok. Possibl - [X] voting on polls - [X] delete and redraft toots - [X] prevent loss of draft toots by the toot-send bug -- [ ] display post visibility status +- [X] fix scaling of images +- [ ] display post visibility status in timelines - better display of polls - display number of boosts/faves in toot byline - mention all thread participants in replies diff --git a/lisp/mastodon-auth.el b/lisp/mastodon-auth.el index 3f4ee7d..0b0c703 100644 --- a/lisp/mastodon-auth.el +++ b/lisp/mastodon-auth.el @@ -124,7 +124,7 @@ Reads and/or stores secrets in `MASTODON-AUTH-SOURCE-FILE'." (json-read-from-string json-string)))) (defun mastodon-auth--access-token () - "If an access token for the current `mastodon-instance-url' exists in `mastodon-auth--token-alist', return it. + "If an access token for `mastodon-instance-url' is in `mastodon-auth--token-alist', return it. Otherwise, generate a token and pass it to `mastodon-auth--handle-token-reponse'." (if-let ((token (cdr (assoc mastodon-instance-url mastodon-auth--token-alist)))) @@ -133,7 +133,9 @@ Otherwise, generate a token and pass it to `mastodon-auth--handle-token-reponse' (mastodon-auth--handle-token-response (mastodon-auth--get-token)))) (defun mastodon-auth--handle-token-response (response) - "Add the token in RESPONSE returned by `mastodon-auth--get-token' in `mastodon-auth--token-alist'. + "Add token RESPONSE to `mastodon-auth--token-alist'. + +The token is returned by `mastodon-auth--get-token'. Handle any errors from the server." (pcase response @@ -143,7 +145,7 @@ Handle any errors from the server." mastodon-auth--token-alist))) (`(:error ,class :error_description ,error) - (error "mastodon-auth--access-token: %s: %s" class error)) + (error "Mastodon-auth--access-token: %s: %s" class error)) (_ (error "Unknown response from mastodon-auth--get-token!")))) diff --git a/lisp/mastodon-client.el b/lisp/mastodon-client.el index 6439c0a..bdfbca9 100644 --- a/lisp/mastodon-client.el +++ b/lisp/mastodon-client.el @@ -94,7 +94,7 @@ Make `mastodon-client--fetch' call to determine client values." (cdr mastodon))) (defun mastodon-client () - "Return variable client secrets to use for the current `mastodon-instance-url'.. + "Return variable client secrets to use for `mastodon-instance-url'. Read plist from `mastodon-client--token-file' if variable is nil. Fetch and store plist if `mastodon-client--read' returns nil." diff --git a/lisp/mastodon-discover.el b/lisp/mastodon-discover.el index 9c946be..8c47fbd 100644 --- a/lisp/mastodon-discover.el +++ b/lisp/mastodon-discover.el @@ -32,6 +32,8 @@ ;;; Code: +(declare-function discover-add-context-menu "discover") + (defun mastodon-discover () "Plug Mastodon functionality into `discover'." (interactive) diff --git a/lisp/mastodon-media.el b/lisp/mastodon-media.el index c3873df..b58eab6 100644 --- a/lisp/mastodon-media.el +++ b/lisp/mastodon-media.el @@ -87,7 +87,7 @@ m836fL6tra0jYkUiEb/fz8k3waLhikQiXq+3/NtiSayNjY1fv35BbVP5fN7pdG5tbR0Fy+12c360 Hxzz5a8KI6V6EMMwzo/2fZ2YTqej0WgqlSoVLqRUDwYCAajNiqKoYDBYphOLY8ViscItVG1VJEmu r6+XeU8sjhWPxzc3N9sNiyAIDMOqS1YbDqwKx1YRrFQqxc7HJDRnpdPpUuEqgoVhWL0+i6hFz6tL ja3iM4u1zw1qwhlfJihI0bfCNhxYe4NSqg3/A862hQAbrdtHAAAAAElFTkSuQmCC") - "The PNG data for a generic 100x100 avatar") + "The PNG data for a generic 100x100 avatar.") (defvar mastodon-media--generic-broken-image-data (base64-decode-string @@ -169,9 +169,11 @@ REGION-LENGTH is the length of the region that should be replaced with the image (kill-buffer url-buffer))))))) (defun mastodon-media--load-image-from-url (url media-type start region-length) - "Takes a URL and MEDIA-TYPE and load the image asynchronously. + "Take a URL and MEDIA-TYPE and load the image asynchronously. -MEDIA-TYPE is a symbol and either 'avatar or 'media-link." +MEDIA-TYPE is a symbol and either 'avatar or 'media-link. +START is the position where we start loading the image. +REGION-LENGTH is the range from start to propertize." ;; TODO: Cache the avatars (let ((image-options (when (or (image-type-available-p 'imagemagick) (image-transforms-p)) ; inbuilt scaling in 27.1 @@ -222,17 +224,17 @@ found." (list next-pos (+ next-pos 5) 'media-link))))))) (defun mastodon-media--valid-link-p (link) - "Checks to make sure that the missing string has + "Check if LINK is valid. -not been returned." +Checks to make sure the missing string has not been returned." (and link (> (length link) 8) (or (string= "http://" (substring link 0 7)) (string= "https://" (substring link 0 8))))) (defun mastodon-media--inline-images (search-start search-end) - "Find all `Media_Links:' in the range from SEARCH-START to SEARCH-END -replacing them with the referenced image." + "Find all `Media_Links:' in the range from SEARCH-START to SEARCH-END. +Replace them with the referenced image." (save-excursion (goto-char search-start) (let (line-details) @@ -251,7 +253,7 @@ replacing them with the referenced image." image-url media-type start (- end start)))))))) (defun mastodon-media--get-avatar-rendering (avatar-url) - "Returns the string to be written that renders the avatar at AVATAR-URL." + "Return the string to be written that renders the avatar at AVATAR-URL." ;; We use just an empty space as the textual representation. ;; This is what a user will see on a non-graphical display ;; where not showing an avatar at all is preferable. @@ -271,7 +273,8 @@ replacing them with the referenced image." " "))) (defun mastodon-media--get-media-link-rendering (media-url &optional full-remote-url) - "Returns the string to be written that renders the image at MEDIA-URL." + "Return the string to be written that renders the image at MEDIA-URL. +FULL-REMOTE-URL is used for `shr-browse-image'." (concat (propertize "[img]" 'media-url media-url diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el index 7524038..c917124 100644 --- a/lisp/mastodon-notifications.el +++ b/lisp/mastodon-notifications.el @@ -33,11 +33,18 @@ (autoload 'mastodon-tl--byline-author "mastodon-tl.el") (autoload 'mastodon-tl--clean-tabs-and-nl "mastodon-tl.el") (autoload 'mastodon-tl--content "mastodon-tl.el") +(autoload 'mastodon-tl--byline "mastodon-tl.el") +(autoload 'mastodon-tl--toot-id "mastodon-tl.el") (autoload 'mastodon-tl--field "mastodon-tl.el") (autoload 'mastodon-tl--has-spoiler "mastodon-tl.el") (autoload 'mastodon-tl--init "mastodon-tl.el") (autoload 'mastodon-tl--insert-status "mastodon-tl.el") (autoload 'mastodon-tl--spoiler "mastodon-tl.el") +(autoload 'mastodon-tl--property "mastodon-tl.el") +(autoload 'mastodon-tl--find-property-range "mastodon-tl.el") +(autoload 'mastodon-http--triage "mastodon-http.el") +(autoload 'mastodon-http--post "mastodon-http.el") +(autoload 'mastodon-http--api "mastodon-http.el") (defvar mastodon-tl--display-media-p) @@ -201,11 +208,16 @@ "Display the content and byline of timeline element TOOT. BODY will form the section of the toot above the byline. -AUTHOR-BYLINE is an optional function for adding the author portion of -the byline that takes one variable. By default it is `mastodon-tl--byline-author' -ACTION-BYLINE is also an optional function for adding an action, such as boosting -favouriting and following to the byline. It also takes a single function. By default -it is `mastodon-tl--byline-boosted'. + +AUTHOR-BYLINE is an optional function for adding the author +portion of the byline that takes one variable. By default it is +`mastodon-tl--byline-author'. + +ACTION-BYLINE is also an optional function for adding an action, +such as boosting favouriting and following to the byline. It also +takes a single function. By default it is +`mastodon-tl--byline-boosted'. + ID is the notification's own id, which is attached as a property." (let ((start-pos (point))) (insert -- cgit v1.2.3 From 88bcf746aaa10f6e9dbefbd79594ef1def7f6a69 Mon Sep 17 00:00:00 2001 From: mousebot Date: Sun, 3 Oct 2021 22:01:08 +0200 Subject: readme --- README.org | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'README.org') diff --git a/README.org b/README.org index 1dc23e1..2f48aac 100644 --- a/README.org +++ b/README.org @@ -22,11 +22,12 @@ It adds the following features: | =W=, =M=, =B= | (un)follow, (un)mute, (un)block author of toot at point | | | display polls and vote on polls (pretty basic for now) | | | images are links to the full image, can be zoomed/rotated/saved (see image keymap) | +| | images scale properly | | Toots: | | | | mention booster in replies by default | | =C-c C-a= | media uploads | | =C-c C-n= | and sensitive media/nsfw flag | -| =C-c C-e= | add emoji (if =emojify= installed) | +| =C-c C-e= | add emoji (if =emojify= installed) | | | | | Search: | | | =S= | search (posts, users, tags) (NB: only posts you have interacted with are searched) | -- cgit v1.2.3 From b4dc8738efad0355ccfa3c1c89f81e4b4466eaa7 Mon Sep 17 00:00:00 2001 From: mousebot Date: Mon, 4 Oct 2021 14:08:39 +0200 Subject: readme re fixes --- README.org | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'README.org') diff --git a/README.org b/README.org index 2f48aac..60f04eb 100644 --- a/README.org +++ b/README.org @@ -51,6 +51,12 @@ Works for federated, local, and home timelines and for notifications. It's prett This version depends on the library =request= (for uploading attachments). You can install it from MELPA, or https://github.com/tkf/emacs-request. +** NB: bugs + +This repo also incorporates fixes for two bugs that were never merged into the upstream repo: +- https://github.com/jdenen/mastodon.el/issues/227 (and https://github.com/jdenen/mastodon.el/issues/234) +- https://github.com/jdenen/mastodon.el/issues/228 + ** roadmap-ish I might add a few more features if the ones I added turn out to work ok. Possible additions/amendments: -- cgit v1.2.3 From f0dbd664537bab060f2b4d8b7f1d6e439f6a2530 Mon Sep 17 00:00:00 2001 From: mousebot Date: Thu, 14 Oct 2021 12:34:17 +0200 Subject: readme --- README.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.org') diff --git a/README.org b/README.org index 60f04eb..dcccccf 100644 --- a/README.org +++ b/README.org @@ -70,10 +70,10 @@ I might add a few more features if the ones I added turn out to work ok. Possibl - [X] prevent loss of draft toots by the toot-send bug - [X] fix scaling of images - [ ] display post visibility status in timelines +- [ ] caching of images / avatars - better display of polls - display number of boosts/faves in toot byline - mention all thread participants in replies -- handle newlines in toots better, for poetry, etc. - improve (or even partially disable) async. It looks like 2-factor auth was never completed in the original repo. It's not a priority for me, auth ain't my thing. If you want to hack on it, its on the develop branch in the original repo. -- cgit v1.2.3 From 39bf919327a03b8e34ff28f08422b2cb6d3eab26 Mon Sep 17 00:00:00 2001 From: mousebot Date: Thu, 21 Oct 2021 21:29:46 +0200 Subject: readme --- README.org | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'README.org') diff --git a/README.org b/README.org index dcccccf..030821d 100644 --- a/README.org +++ b/README.org @@ -9,26 +9,32 @@ It adds the following features: | | display pinned toots on profiles | | | display relationship (follows you/followed by you) on profiles | | | display toots/follows/followers counts on profiles | -| | links/tags/mentions in profiles are active links | +| | links/tags/mentions in profile bios are active links | | =R=, =C-c a=, =C-c r= | view/accept/reject follow requests | | =v= | view your favorited toots | | =i= | toggle pinning of toots | | =S-C-P= | jump to your profile | | =U= | update your profile bio note | +| Notifications: | | +| | follow requests now also appear in notifications | +| =a=, =r= | accept/reject follow requests | | Timelines: | | | =C= | copy url of toot at point | | =d= | delete your toot at point, and reload current timeline | -| =D= | delete and redraft toot at point | +| =D= | delete and redraft toot at point, preserving reply/CW/visibility | | =W=, =M=, =B= | (un)follow, (un)mute, (un)block author of toot at point | | | display polls and vote on polls (pretty basic for now) | | | images are links to the full image, can be zoomed/rotated/saved (see image keymap) | | | images scale properly | +| | toot visibility (direct, followers only) icon appears in toot bylines | | Toots: | | | | mention booster in replies by default | +| | autocompletion of mentions, via company-mode (must be installed to work) | | =C-c C-a= | media uploads | +| | media uploads appear in toot compose buffer to preview | | =C-c C-n= | and sensitive media/nsfw flag | | =C-c C-e= | add emoji (if =emojify= installed) | -| | | +| | replies preserve visibility status/CW of original toot | | Search: | | | =S= | search (posts, users, tags) (NB: only posts you have interacted with are searched) | | | | @@ -69,8 +75,8 @@ I might add a few more features if the ones I added turn out to work ok. Possibl - [X] delete and redraft toots - [X] prevent loss of draft toots by the toot-send bug - [X] fix scaling of images -- [ ] display post visibility status in timelines -- [ ] caching of images / avatars +- [X] display post visibility status in timelines +- [X] caching of images / avatars - better display of polls - display number of boosts/faves in toot byline - mention all thread participants in replies -- cgit v1.2.3 From 6c53da8c494367bd1f36f1e28d75c209713a13dd Mon Sep 17 00:00:00 2001 From: mousebot Date: Fri, 22 Oct 2021 13:06:39 +0200 Subject: readme --- README.org | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'README.org') diff --git a/README.org b/README.org index 030821d..c4ca256 100644 --- a/README.org +++ b/README.org @@ -11,7 +11,8 @@ It adds the following features: | | display toots/follows/followers counts on profiles | | | links/tags/mentions in profile bios are active links | | =R=, =C-c a=, =C-c r= | view/accept/reject follow requests | -| =v= | view your favorited toots | +| =V= | view your favorited toots | +| =K= | view your bookmarked toots | | =i= | toggle pinning of toots | | =S-C-P= | jump to your profile | | =U= | update your profile bio note | -- cgit v1.2.3 From 24adbf94613d1cbeee08db896388e1d7f854a168 Mon Sep 17 00:00:00 2001 From: mousebot Date: Fri, 22 Oct 2021 15:18:05 +0200 Subject: readme --- README.org | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'README.org') diff --git a/README.org b/README.org index c4ca256..0d28585 100644 --- a/README.org +++ b/README.org @@ -32,10 +32,11 @@ It adds the following features: | | mention booster in replies by default | | | autocompletion of mentions, via company-mode (must be installed to work) | | =C-c C-a= | media uploads | -| | media uploads appear in toot compose buffer to preview | +| | media uploads previews in toot compose buffer | | =C-c C-n= | and sensitive media/nsfw flag | | =C-c C-e= | add emoji (if =emojify= installed) | | | replies preserve visibility status/CW of original toot | +| | server's maximum toot length shown | | Search: | | | =S= | search (posts, users, tags) (NB: only posts you have interacted with are searched) | | | | -- cgit v1.2.3 From f6d3b20540600892e30415c79dad23ae088140b9 Mon Sep 17 00:00:00 2001 From: mousebot Date: Mon, 25 Oct 2021 17:09:47 +0200 Subject: readme --- README.org | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'README.org') diff --git a/README.org b/README.org index 0d28585..756442d 100644 --- a/README.org +++ b/README.org @@ -1,3 +1,5 @@ +#+OPTIONS: toc:nil + * mastodon.el fork This is a fork of of the great but seemingly dormant https://github.com/jdenen/mastodon.el. @@ -24,10 +26,12 @@ It adds the following features: | =d= | delete your toot at point, and reload current timeline | | =D= | delete and redraft toot at point, preserving reply/CW/visibility | | =W=, =M=, =B= | (un)follow, (un)mute, (un)block author of toot at point | +| =k= | toggle bookmark of toot at point | | | display polls and vote on polls (pretty basic for now) | | | images are links to the full image, can be zoomed/rotated/saved (see image keymap) | | | images scale properly | | | toot visibility (direct, followers only) icon appears in toot bylines | +| | display a toot's favorites, boosts and replies count in thread view | | Toots: | | | | mention booster in replies by default | | | autocompletion of mentions, via company-mode (must be installed to work) | @@ -36,7 +40,7 @@ It adds the following features: | =C-c C-n= | and sensitive media/nsfw flag | | =C-c C-e= | add emoji (if =emojify= installed) | | | replies preserve visibility status/CW of original toot | -| | server's maximum toot length shown | +| | server's maximum toot length shown in toot compose buffer | | Search: | | | =S= | search (posts, users, tags) (NB: only posts you have interacted with are searched) | | | | @@ -53,7 +57,9 @@ I did this for my own use and to learn more Elisp. Feel free to improve it. (code taken from https://github.com/alexjgriffith/mastodon-future.el.) -Works for federated, local, and home timelines and for notifications. It's pretty necro, sometimes it goes off the rails, so use at your own risk. Not a super high priority for me, but some people dig it. The command prefix is =mastodon-async--stream=. +Works for federated, local, and home timelines and for notifications. It's pretty necro, sometimes it goes off the rails, so use at your own risk. Not a super high priority for me, but some people dig it. + +To enable, run =mastodon-async-mode=. Then view a timeline with one of the commands that begin with =mastodon-async--stream=. ** NB: dependency @@ -80,9 +86,9 @@ I might add a few more features if the ones I added turn out to work ok. Possibl - [X] display post visibility status in timelines - [X] caching of images / avatars - better display of polls -- display number of boosts/faves in toot byline +- [X] display number of boosts/faves in toot byline - mention all thread participants in replies -- improve (or even partially disable) async. +- [X] improve (or even partially disable) async. It looks like 2-factor auth was never completed in the original repo. It's not a priority for me, auth ain't my thing. If you want to hack on it, its on the develop branch in the original repo. -- cgit v1.2.3 From c82399d03e62bc258a7f9c89846f8552f2d2e52b Mon Sep 17 00:00:00 2001 From: mousebot Date: Tue, 26 Oct 2021 16:46:20 +0200 Subject: readme --- README.org | 1 + 1 file changed, 1 insertion(+) (limited to 'README.org') diff --git a/README.org b/README.org index 756442d..7c9b18e 100644 --- a/README.org +++ b/README.org @@ -12,6 +12,7 @@ It adds the following features: | | display relationship (follows you/followed by you) on profiles | | | display toots/follows/followers counts on profiles | | | links/tags/mentions in profile bios are active links | +| | show a lock icon for locked accounts | | =R=, =C-c a=, =C-c r= | view/accept/reject follow requests | | =V= | view your favorited toots | | =K= | view your bookmarked toots | -- cgit v1.2.3 From 998bfd60ed0ad1c4de161dd9a32c7786ee34b48a Mon Sep 17 00:00:00 2001 From: mousebot Date: Thu, 28 Oct 2021 17:50:19 +0200 Subject: mastodon-async readme --- README.org | 4 ++-- lisp/mastodon.el | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'README.org') diff --git a/README.org b/README.org index 7c9b18e..2455124 100644 --- a/README.org +++ b/README.org @@ -54,13 +54,13 @@ The minimum Emacs version is now 26.1. But if you are running an older version i I did this for my own use and to learn more Elisp. Feel free to improve it. -** live-updating timelines +** live-updating timelines: =mastodon-async-mode= (code taken from https://github.com/alexjgriffith/mastodon-future.el.) Works for federated, local, and home timelines and for notifications. It's pretty necro, sometimes it goes off the rails, so use at your own risk. Not a super high priority for me, but some people dig it. -To enable, run =mastodon-async-mode=. Then view a timeline with one of the commands that begin with =mastodon-async--stream=. +To enable, it, add =(require 'mastodon-async)= to your =init.el=. Then you can view a timeline with one of the commands that begin with =mastodon-async--stream-=. ** NB: dependency diff --git a/lisp/mastodon.el b/lisp/mastodon.el index 7f4b773..25fb829 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -77,6 +77,7 @@ ;; (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") -- cgit v1.2.3 From 48f1193558c9655e2215615b5f6d0cf6ea4d4e08 Mon Sep 17 00:00:00 2001 From: mousebot Date: Sat, 6 Nov 2021 15:50:40 +0100 Subject: tiny cleanup --- README.org | 1 + lisp/mastodon-notifications.el | 1 - lisp/mastodon-toot.el | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) (limited to 'README.org') diff --git a/README.org b/README.org index 2455124..3a7a06e 100644 --- a/README.org +++ b/README.org @@ -40,6 +40,7 @@ It adds the following features: | | media uploads previews in toot compose buffer | | =C-c C-n= | and sensitive media/nsfw flag | | =C-c C-e= | add emoji (if =emojify= installed) | +| | download and use your instance's custom emoji | | | replies preserve visibility status/CW of original toot | | | server's maximum toot length shown in toot compose buffer | | Search: | | diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el index ad3d7b4..36f9d4a 100644 --- a/lisp/mastodon-notifications.el +++ b/lisp/mastodon-notifications.el @@ -73,7 +73,6 @@ " " (cdr (assoc message mastodon-notifications--response-alist)))) - (defun mastodon-notifications--follow-request-accept-notifs () "Accept the follow request of user at point, in notifications view." (interactive) diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index d0d3dfa..deea2ef 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -159,7 +159,7 @@ Valid values are \"direct\", \"private\" (followers-only), \"unlisted\", and \"p (mastodon-http--api "instance") 'mastodon-toot--get-max-toot-chars-callback)) (defun mastodon-toot--get-max-toot-chars-callback (json-response) - "Set max_toot_chars returned in JSON-RESPONSE." + "Set max_toot_chars returned in JSON-RESPONSE and display in new toot buffer." (setq mastodon-toot--max-toot-chars (number-to-string (cdr (assoc 'max_toot_chars json-response)))) -- cgit v1.2.3 From 2cc25a13872581eea9fc36b1ddc809f34cd3747a Mon Sep 17 00:00:00 2001 From: mousebot Date: Thu, 16 Dec 2021 17:31:56 +0100 Subject: readme update --- README.org | 40 +++++++++++++++------------------------- 1 file changed, 15 insertions(+), 25 deletions(-) (limited to 'README.org') diff --git a/README.org b/README.org index 3a7a06e..ab2dbff 100644 --- a/README.org +++ b/README.org @@ -15,33 +15,34 @@ It adds the following features: | | show a lock icon for locked accounts | | =R=, =C-c a=, =C-c r= | view/accept/reject follow requests | | =V= | view your favorited toots | -| =K= | view your bookmarked toots | | =i= | toggle pinning of toots | | =S-C-P= | jump to your profile | | =U= | update your profile bio note | | Notifications: | | | | follow requests now also appear in notifications | | =a=, =r= | accept/reject follow requests | +| | notifications for when a user posts (optional) | | Timelines: | | | =C= | copy url of toot at point | | =d= | delete your toot at point, and reload current timeline | | =D= | delete and redraft toot at point, preserving reply/CW/visibility | | =W=, =M=, =B= | (un)follow, (un)mute, (un)block author of toot at point | -| =k= | toggle bookmark of toot at point | -| | display polls and vote on polls (pretty basic for now) | +| =k=, =K= | toggle bookmark of toot at point, view bookmarked toots | +| | display polls and vote on them | | | images are links to the full image, can be zoomed/rotated/saved (see image keymap) | | | images scale properly | | | toot visibility (direct, followers only) icon appears in toot bylines | | | display a toot's favorites, boosts and replies count in thread view | +| | customize option to cache images | | Toots: | | | | mention booster in replies by default | -| | autocompletion of mentions, via company-mode (must be installed to work) | -| =C-c C-a= | media uploads | -| | media uploads previews in toot compose buffer | +| | replies preserve visibility status/CW of original toot | +| | autocompletion of user mentions, via =company-mode= (must be installed to work) | +| =C-c C-a= | media uploads, asynchronous | +| | media upload previews displayed in toot compose buffer | | =C-c C-n= | and sensitive media/nsfw flag | | =C-c C-e= | add emoji (if =emojify= installed) | | | download and use your instance's custom emoji | -| | replies preserve visibility status/CW of original toot | | | server's maximum toot length shown in toot compose buffer | | Search: | | | =S= | search (posts, users, tags) (NB: only posts you have interacted with are searched) | @@ -73,27 +74,16 @@ This repo also incorporates fixes for two bugs that were never merged into the u - https://github.com/jdenen/mastodon.el/issues/227 (and https://github.com/jdenen/mastodon.el/issues/234) - https://github.com/jdenen/mastodon.el/issues/228 -** roadmap-ish - -I might add a few more features if the ones I added turn out to work ok. Possible additions/amendments: - -- [X] update profile note. -- [X] fix loading more notifications re-loads the same ones -- [X] view/accept/reject follow requests in notifications view. -- [X] fix sometimes usernames don't appear in timelines -- [X] voting on polls -- [X] delete and redraft toots -- [X] prevent loss of draft toots by the toot-send bug -- [X] fix scaling of images -- [X] display post visibility status in timelines -- [X] caching of images / avatars -- better display of polls -- [X] display number of boosts/faves in toot byline -- mention all thread participants in replies -- [X] improve (or even partially disable) async. +** 2FA It looks like 2-factor auth was never completed in the original repo. It's not a priority for me, auth ain't my thing. If you want to hack on it, its on the develop branch in the original repo. +** contributing + +Contributions are welcome. Registration is disabled by default on the gitea instance, but if you are interested, get in touch with me on mastodon: + +[[https://todon.nl/@mousebot][@mousebot@todon.nl]] + * Original README ** Installation -- cgit v1.2.3 From fc8005c8fe3c5466c7e2d2b510e24f6eba661431 Mon Sep 17 00:00:00 2001 From: mousebot Date: Fri, 17 Dec 2021 15:03:00 +0100 Subject: bump version, change homepage link, readme --- README.org | 2 +- lisp/mastodon-async.el | 4 ++-- lisp/mastodon-auth.el | 4 ++-- lisp/mastodon-client.el | 4 ++-- lisp/mastodon-discover.el | 4 ++-- lisp/mastodon-http.el | 4 ++-- lisp/mastodon-inspect.el | 4 ++-- lisp/mastodon-media.el | 4 ++-- lisp/mastodon-notifications.el | 4 ++-- lisp/mastodon-profile.el | 4 ++-- lisp/mastodon-search.el | 4 ++-- lisp/mastodon-tl.el | 4 ++-- lisp/mastodon-toot.el | 4 ++-- lisp/mastodon.el | 4 ++-- 14 files changed, 27 insertions(+), 27 deletions(-) (limited to 'README.org') diff --git a/README.org b/README.org index ab2dbff..fff4bc8 100644 --- a/README.org +++ b/README.org @@ -32,7 +32,7 @@ It adds the following features: | | images are links to the full image, can be zoomed/rotated/saved (see image keymap) | | | images scale properly | | | toot visibility (direct, followers only) icon appears in toot bylines | -| | display a toot's favorites, boosts and replies count in thread view | +| | display toot's number of favorites, boosts and replies | | | customize option to cache images | | Toots: | | | | mention booster in replies by default | diff --git a/lisp/mastodon-async.el b/lisp/mastodon-async.el index 524e13d..3651bd5 100644 --- a/lisp/mastodon-async.el +++ b/lisp/mastodon-async.el @@ -2,9 +2,9 @@ ;; Copyright (C) 2017 Johnson Denen ;; Author: Johnson Denen -;; Version: 0.7.1 +;; Version: 0.9.2 ;; Package-Requires: ((emacs "26.1")) -;; Homepage: https://github.com/jdenen/mastodon.el +;; Homepage: https://git.blast.noho.st/mouse/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-auth.el b/lisp/mastodon-auth.el index 8d0d7c6..8355200 100644 --- a/lisp/mastodon-auth.el +++ b/lisp/mastodon-auth.el @@ -2,9 +2,9 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Author: Johnson Denen -;; Version: 0.9.1 -;; Homepage: https://github.com/jdenen/mastodon.el +;; Version: 0.9.2 ;; Package-Requires: ((emacs "26.1")) +;; Homepage: https://git.blast.noho.st/mouse/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-client.el b/lisp/mastodon-client.el index bdfbca9..cb8eb26 100644 --- a/lisp/mastodon-client.el +++ b/lisp/mastodon-client.el @@ -2,9 +2,9 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Author: Johnson Denen -;; Version: 0.9.1 -;; Homepage: https://github.com/jdenen/mastodon.el +;; Version: 0.9.2 ;; Package-Requires: ((emacs "26.1")) +;; Homepage: https://git.blast.noho.st/mouse/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-discover.el b/lisp/mastodon-discover.el index 33ce3d5..6b2eadf 100644 --- a/lisp/mastodon-discover.el +++ b/lisp/mastodon-discover.el @@ -2,9 +2,9 @@ ;; Copyright (C) 2019 Johnson Denen ;; Author: Johnson Denen -;; Version: 0.9.1 +;; Version: 0.9.2 ;; Package-Requires: ((emacs "26.1")) -;; Homepage: https://github.com/jdenen/mastodon.el +;; Homepage: https://git.blast.noho.st/mouse/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-http.el b/lisp/mastodon-http.el index a4f126f..00a0718 100644 --- a/lisp/mastodon-http.el +++ b/lisp/mastodon-http.el @@ -2,9 +2,9 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Author: Johnson Denen -;; Version: 0.9.1 +;; Version: 0.9.2 ;; Package-Requires: ((emacs "27.1") (request "0.2.0")) -;; Homepage: https://github.com/jdenen/mastodon.el +;; Homepage: https://git.blast.noho.st/mouse/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-inspect.el b/lisp/mastodon-inspect.el index 57240f3..4d91948 100644 --- a/lisp/mastodon-inspect.el +++ b/lisp/mastodon-inspect.el @@ -2,9 +2,9 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Author: Johnson Denen -;; Version: 0.9.1 +;; Version: 0.9.2 ;; Package-Requires: ((emacs "26.1")) -;; Homepage: https://github.com/jdenen/mastodon.el +;; Homepage: https://git.blast.noho.st/mouse/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-media.el b/lisp/mastodon-media.el index 457628f..bbab816 100644 --- a/lisp/mastodon-media.el +++ b/lisp/mastodon-media.el @@ -2,9 +2,9 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Author: Johnson Denen -;; Version: 0.9.1 -;; Homepage: https://github.com/jdenen/mastodon.el +;; Version: 0.9.2 ;; Package-Requires: ((emacs "26.1")) +;; Homepage: https://git.blast.noho.st/mouse/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el index 15633be..5efb7d4 100644 --- a/lisp/mastodon-notifications.el +++ b/lisp/mastodon-notifications.el @@ -2,9 +2,9 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Author: Johnson Denen -;; Version: 0.9.1 -;; Homepage: https://github.com/jdenen/mastodon.el +;; Version: 0.9.2 ;; Package-Requires: ((emacs "26.1")) +;; Homepage: https://git.blast.noho.st/mouse/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index 7a9edc3..d21f5c0 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -2,9 +2,9 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Author: Johnson Denen -;; Version: 0.9.1 +;; Version: 0.9.2 ;; Package-Requires: ((emacs "26.1") (seq "1.0")) -;; Homepage: https://github.com/jdenen/mastodon.el +;; Homepage: https://git.blast.noho.st/mouse/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-search.el b/lisp/mastodon-search.el index fcfaec9..a7dcda9 100644 --- a/lisp/mastodon-search.el +++ b/lisp/mastodon-search.el @@ -2,9 +2,9 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Author: Johnson Denen , martyhiatt -;; Version: 0.9.1 -;; Homepage: https://github.com/jdenen/mastodon.el +;; Version: 0.9.2 ;; Package-Requires: ((emacs "26.1")) +;; Homepage: https://git.blast.noho.st/mouse/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index 9355480..89604b5 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -2,9 +2,9 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Author: Johnson Denen -;; Version: 0.9.1 -;; Homepage: https://github.com/jdenen/mastodon.el +;; Version: 0.9.2 ;; Package-Requires: ((emacs "26.1")) +;; Homepage: https://git.blast.noho.st/mouse/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index 2ff7f83..c89acc7 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -2,9 +2,9 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Author: Johnson Denen -;; Version: 0.9.1 -;; Homepage: https://github.com/jdenen/mastodon.el +;; Version: 0.9.2 ;; Package-Requires: ((emacs "26.1")) +;; Homepage: https://git.blast.noho.st/mouse/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon.el b/lisp/mastodon.el index 662b691..2411e20 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -2,9 +2,9 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Author: Johnson Denen -;; Version: 0.9.1 +;; Version: 0.9.2 ;; Package-Requires: ((emacs "26.1") (request "0.3.2") (seq "1.0")) -;; Homepage: https://github.com/jdenen/mastodon.el +;; Homepage: https://git.blast.noho.st/mouse/mastodon.el ;; This file is not part of GNU Emacs. -- cgit v1.2.3 From 9a44a97b751855529647ead629bc300bc7e045ce Mon Sep 17 00:00:00 2001 From: mousebot Date: Fri, 17 Dec 2021 19:30:12 +0100 Subject: readme --- README.org | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'README.org') diff --git a/README.org b/README.org index fff4bc8..88e8c41 100644 --- a/README.org +++ b/README.org @@ -8,9 +8,9 @@ It adds the following features: | Profiles: | | | | display profile metadata fields | -| | display pinned toots on profiles | -| | display relationship (follows you/followed by you) on profiles | -| | display toots/follows/followers counts on profiles | +| | display pinned toots first | +| | display relationship (follows you/followed by you) | +| | display toots/follows/followers counts | | | links/tags/mentions in profile bios are active links | | | show a lock icon for locked accounts | | =R=, =C-c a=, =C-c r= | view/accept/reject follow requests | @@ -18,10 +18,11 @@ It adds the following features: | =i= | toggle pinning of toots | | =S-C-P= | jump to your profile | | =U= | update your profile bio note | +| =O= | jump to own profile | | Notifications: | | | | follow requests now also appear in notifications | -| =a=, =r= | accept/reject follow requests | -| | notifications for when a user posts (optional) | +| =a=, =r= | accept/reject follow request | +| | notifications for when a user posts (=mastodon-tl--enable-notify-user-posts=) | | Timelines: | | | =C= | copy url of toot at point | | =d= | delete your toot at point, and reload current timeline | -- cgit v1.2.3