From 5a3a6dcbadb60e4794733f8e26dc3c8d1f5c187c Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Mon, 27 Mar 2023 12:17:35 +0200 Subject: add force arg to notifs-get, and use it in reload-timeline- --- lisp/mastodon.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lisp/mastodon.el') diff --git a/lisp/mastodon.el b/lisp/mastodon.el index 5f7034e..a78685e 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -275,15 +275,18 @@ If REPLY-JSON is the json of the toot being replied to." (mastodon-toot--compose-buffer user reply-to-id reply-json)) ;;;###autoload -(defun mastodon-notifications-get (&optional type buffer-name) +(defun mastodon-notifications-get (&optional type buffer-name force) "Display NOTIFICATIONS in buffer. Optionally only print notifications of type TYPE, a string. -BUFFER-NAME is added to \"*mastodon-\" to create the buffer name." +BUFFER-NAME is added to \"*mastodon-\" to create the buffer name. +FORCE means do not try to update an existing buffer, but fetch +from the server and load anew." (interactive) (let ((buffer (if buffer-name (concat "*mastodon-" buffer-name "*") "*mastodon-notifications*"))) - (if (get-buffer buffer) + (if (and (not force) + (get-buffer buffer)) (progn (switch-to-buffer buffer) (mastodon-tl--update)) (message "Loading your notifications...") -- cgit v1.2.3 From 911169f518deed674e2553b95b47ec03f8d6e72a Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Wed, 29 Mar 2023 16:50:22 +0200 Subject: remove duplicate autoload --- lisp/mastodon.el | 1 - 1 file changed, 1 deletion(-) (limited to 'lisp/mastodon.el') diff --git a/lisp/mastodon.el b/lisp/mastodon.el index a78685e..9ab6098 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -63,7 +63,6 @@ (autoload 'mastodon-profile--view-favourites "mastodon-profile") (autoload 'mastodon-search--search-query "mastodon-search") (autoload 'mastodon-search--trending-tags "mastodon-search") -(autoload 'mastodon-search--trending-tags "mastodon-search") (autoload 'mastodon-tl--block-user "mastodon-tl") (autoload 'mastodon-tl--follow-user "mastodon-tl") (autoload 'mastodon-tl--get-buffer-type "mastodon-tl") -- cgit v1.2.3 From db0b60a943e04448bdb0e1c63a061c3d4a4a0e34 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Wed, 29 Mar 2023 16:59:56 +0200 Subject: require search --- lisp/mastodon.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lisp/mastodon.el') diff --git a/lisp/mastodon.el b/lisp/mastodon.el index 9ab6098..ef0d2c0 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -38,6 +38,7 @@ (eval-when-compile (require 'subr-x)) (require 'mastodon-http) (require 'mastodon-toot) +(require 'mastodon-search) (require 'url) (require 'thingatpt) (require 'shr) @@ -61,8 +62,6 @@ (autoload 'mastodon-profile--update-user-profile-note "mastodon-profile") (autoload 'mastodon-profile--view-bookmarks "mastodon-profile") (autoload 'mastodon-profile--view-favourites "mastodon-profile") -(autoload 'mastodon-search--search-query "mastodon-search") -(autoload 'mastodon-search--trending-tags "mastodon-search") (autoload 'mastodon-tl--block-user "mastodon-tl") (autoload 'mastodon-tl--follow-user "mastodon-tl") (autoload 'mastodon-tl--get-buffer-type "mastodon-tl") -- cgit v1.2.3 From 08dc0d1990754a94cf2dc0899c8a579bb485c377 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Sat, 1 Apr 2023 17:09:24 +0200 Subject: timeline of all followed tags. FIX #409. --- README.org | 1 + lisp/mastodon-tl.el | 22 ++++++++++++++++++---- lisp/mastodon.el | 2 ++ 3 files changed, 21 insertions(+), 4 deletions(-) (limited to 'lisp/mastodon.el') diff --git a/README.org b/README.org index fbff0cd..fa1afcb 100644 --- a/README.org +++ b/README.org @@ -136,6 +136,7 @@ not contain =:client_id= and =:client_secret=. | =U= | update your profile bio note | | =;= | view instance description for toot at point | | =:= | view followed tags and load a tag timeline | +| =M-:= | view timeline of all followed tags | | =,= | view favouriters of toot at point | | =.= | view boosters of toot at point | | =/= | switch between mastodon buffers | diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index 0c3630b..46ea5da 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -400,6 +400,7 @@ With a double PREFIX arg, limit results to your own instance." (defun mastodon-tl--show-tag-timeline (&optional prefix tag) "Opens a new buffer showing the timeline of posts with hastag TAG. +If TAG is a list, show a timeline for all tags. With a single PREFIX arg, only show posts with media. With a double PREFIX arg, limit results to your own instance." (let ((params @@ -409,13 +410,18 @@ With a double PREFIX arg, limit results to your own instance." (push '("only_media" . "true") params)) (when (eq prefix 16) (push '("local" . "true") params)) - (mastodon-tl--init (concat "tag-" tag) - (concat "timelines/tag/" tag) + (when (listp tag) + (let ((list (mastodon-http--build-array-params-alist "any[]" (cdr tag)))) + (while list + (push (pop list) params)))) + (mastodon-tl--init (concat "tag-" (if (listp tag) "followed-tags" tag)) + (concat "timelines/tag/" (if (listp tag) + ;; endpoint needs to be /tag/:sometag + (car tag) tag)) 'mastodon-tl--timeline nil params))) - ;;; BYLINES, etc. @@ -899,7 +905,7 @@ Used for hitting RET on a given link." (cond ((eq link-type 'content-warning) (mastodon-tl--toggle-spoiler-text position)) ((eq link-type 'hashtag) - (mastodon-tl--show-tag-timeline (get-text-property position 'mastodon-tag))) + (mastodon-tl--show-tag-timeline nil (get-text-property position 'mastodon-tag))) ;; 'account / 'account-id is not set for mentions, only bylines ((eq link-type 'user-handle) (let ((account-json (get-text-property position 'account)) @@ -2078,6 +2084,14 @@ If TAG is provided, unfollow it." (message "You have to follow some tags first.") (mastodon-tl--get-tag-timeline nil tag)))) +(defun mastodon-tl--followed-tags-timeline () + "Open a timeline of all your followed tags." + (interactive) + (let* ((followed-tags-json (mastodon-tl--followed-tags)) + (tags (mastodon-tl--map-alist 'name followed-tags-json))) + (mastodon-tl--show-tag-timeline nil tags))) + + ;;; UPDATING, etc. diff --git a/lisp/mastodon.el b/lisp/mastodon.el index ef0d2c0..1b975f2 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -64,6 +64,7 @@ (autoload 'mastodon-profile--view-favourites "mastodon-profile") (autoload 'mastodon-tl--block-user "mastodon-tl") (autoload 'mastodon-tl--follow-user "mastodon-tl") +(autoload 'mastodon-tl--followed-tags-timeline "mastodon-tl") (autoload 'mastodon-tl--get-buffer-type "mastodon-tl") (autoload 'mastodon-tl--get-federated-timeline "mastodon-tl") (autoload 'mastodon-tl--get-home-timeline "mastodon-tl") @@ -152,6 +153,7 @@ Use. e.g. \"%c\" for your locale's date and time format." ;; navigation between timelines (define-key map (kbd "#") #'mastodon-tl--get-tag-timeline) (define-key map (kbd ":") #'mastodon-tl--list-followed-tags) + (define-key map (kbd "M-:") #'mastodon-tl--followed-tags-timeline) (define-key map (kbd "A") #'mastodon-profile--get-toot-author) (define-key map (kbd "F") #'mastodon-tl--get-federated-timeline) (define-key map (kbd "H") #'mastodon-tl--get-home-timeline) -- cgit v1.2.3 From e4ccc526baf011ad60ef978aef83de2ee2e9f506 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Sat, 1 Apr 2023 22:08:19 +0200 Subject: move followed-tags-tl binding --- lisp/mastodon.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/mastodon.el') diff --git a/lisp/mastodon.el b/lisp/mastodon.el index 1b975f2..5426c1f 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -153,7 +153,7 @@ Use. e.g. \"%c\" for your locale's date and time format." ;; navigation between timelines (define-key map (kbd "#") #'mastodon-tl--get-tag-timeline) (define-key map (kbd ":") #'mastodon-tl--list-followed-tags) - (define-key map (kbd "M-:") #'mastodon-tl--followed-tags-timeline) + (define-key map (kbd "C-:") #'mastodon-tl--followed-tags-timeline) (define-key map (kbd "A") #'mastodon-profile--get-toot-author) (define-key map (kbd "F") #'mastodon-tl--get-federated-timeline) (define-key map (kbd "H") #'mastodon-tl--get-home-timeline) -- cgit v1.2.3 From 91c8612beaa73367f08245fbe54d85c3db8c13cc Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Wed, 5 Apr 2023 10:04:52 +0200 Subject: change package description --- lisp/mastodon.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/mastodon.el') diff --git a/lisp/mastodon.el b/lisp/mastodon.el index 5426c1f..89f5cf4 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -1,4 +1,4 @@ -;;; mastodon.el --- Client for Mastodon, a federated social network -*- lexical-binding: t -*- +;;; mastodon.el --- Client for Mastodon and compatible fediverse services -*- lexical-binding: t -*- ;; Copyright (C) 2017-2019 Johnson Denen ;; Copyright (C) 2020-2022 Marty Hiatt -- cgit v1.2.3