aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-04-12 13:47:32 +0200
committermarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-04-12 13:47:32 +0200
commit82d1189d7ea816c4419c28558ce5ce4a5c26b16e (patch)
tree7a77f39d643fff499c110dcde0915aaf783af9ca
parent8b65f27106f55b7f2868ee4c7e1a965eee24fd97 (diff)
parente54deed13f3ccf3dc14d9a77417ee0688dc30987 (diff)
Merge branch 'develop'
-rw-r--r--README.org6
-rw-r--r--lisp/mastodon-tl.el14
-rw-r--r--test/mastodon-tl-tests.el57
3 files changed, 48 insertions, 29 deletions
diff --git a/README.org b/README.org
index bcc08e8..c168401 100644
--- a/README.org
+++ b/README.org
@@ -188,8 +188,8 @@ not contain =:client_id= and =:client_secret=.
|---------------+------------------------|
| Marker | Meaning |
|---------------+------------------------|
-| =(B)= | I boosted this toot |
-| =(F)= | I favourited this toot |
+| =(🔁)= (or =(B)=) | I boosted this toot |
+| =(⭐)= (or =(F)=) | I favourited this toot |
| =(🔖)= (or (=K=)) | I bookmarked this toot |
|---------------+------------------------|
@@ -280,6 +280,8 @@ work without first loading =mastodon.el=:
- =mastodon-tl--follow-tag=: Follow a tag (works like following a user)
- =mastodon-tl--unfollow-tag=: Unfollow a tag
- =mastodon-tl--list-followed-tags=: View a list of tags you're following.
+- =mastodon-tl--followed-tags-timeline=: View a timeline of all your followed tags.
+- =mastodon-tl--some-followed-tags-timleine=: View a timeline of multiple tags, from your followed tags or any other.
- =mastodon-switch-to-buffer=: switch between mastodon buffers.
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index 794b198..e90be9a 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -414,7 +414,9 @@ With a double PREFIX arg, limit results to your own instance."
(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))
+ (mastodon-tl--init (if (listp tag)
+ "tags-multiple"
+ (concat "tag-" tag))
(concat "timelines/tag/" (if (listp tag)
;; endpoint needs to be /tag/:sometag
(car tag) tag))
@@ -2093,6 +2095,16 @@ Prefix is sent to `mastodon-tl--show-tag-timeline', which see."
(tags (mastodon-tl--map-alist 'name followed-tags-json)))
(mastodon-tl--show-tag-timeline prefix tags)))
+(defun mastodon-tl--some-followed-tags-timeline (&optional prefix)
+ "Prompt for some tags, and open a timeline for them.
+The suggestions are from followed tags, but any other tags are also allowed."
+ (interactive "p")
+ (let* ((followed-tags-json (mastodon-tl--followed-tags))
+ (tags (mastodon-tl--map-alist 'name followed-tags-json))
+ (selection (completing-read-multiple
+ "Tags' timelines to view [TAB to view, comma to separate]: "
+ tags)))
+ (mastodon-tl--show-tag-timeline prefix selection)))
;;; UPDATING, etc.
diff --git a/test/mastodon-tl-tests.el b/test/mastodon-tl-tests.el
index a284c25..a3ac330 100644
--- a/test/mastodon-tl-tests.el
+++ b/test/mastodon-tl-tests.el
@@ -316,9 +316,10 @@ Strict-Transport-Security: max-age=31536000
(handle-location 20))
(should (string= (substring-no-properties
byline)
- "Account 42 (@acct42@example.space) 2999-99-99 00:11:22
- ------------
-"))
+ (concat "Account 42 (@acct42@example.space) 2999-99-99 00:11:22
+ "
+ mastodon-tl--horiz-bar "
+")))
(should (eq (get-text-property handle-location 'mastodon-tab-stop byline)
'user-handle))
(should (string= (get-text-property handle-location 'mastodon-handle byline)
@@ -340,9 +341,10 @@ Strict-Transport-Security: max-age=31536000
(mastodon-tl--byline mastodon-tl-test-base-toot
'mastodon-tl--byline-author
'mastodon-tl--byline-boosted))
- "Account 42 (@acct42@example.space) 2999-99-99 00:11:22
- ------------
-")))))
+ (concat "Account 42 (@acct42@example.space) 2999-99-99 00:11:22
+ "
+ mastodon-tl--horiz-bar "
+"))))))
(ert-deftest mastodon-tl--byline-boosted ()
"Should format the boosted toot correctly."
@@ -359,9 +361,10 @@ Strict-Transport-Security: max-age=31536000
(mastodon-tl--byline toot
'mastodon-tl--byline-author
'mastodon-tl--byline-boosted))
- "(B) Account 42 (@acct42@example.space) 2999-99-99 00:11:22
- ------------
-")))))
+ (concat "(B) Account 42 (@acct42@example.space) 2999-99-99 00:11:22
+ "
+ mastodon-tl--horiz-bar "
+"))))))
(ert-deftest mastodon-tl--byline-favorited ()
"Should format the favourited toot correctly."
@@ -378,9 +381,10 @@ Strict-Transport-Security: max-age=31536000
(mastodon-tl--byline toot
'mastodon-tl--byline-author
'mastodon-tl--byline-boosted))
- "(F) Account 42 (@acct42@example.space) 2999-99-99 00:11:22
- ------------
-")))))
+ (concat "(F) Account 42 (@acct42@example.space) 2999-99-99 00:11:22
+ "
+ mastodon-tl--horiz-bar "
+"))))))
(ert-deftest mastodon-tl--byline-boosted/favorited ()
@@ -401,9 +405,10 @@ Strict-Transport-Security: max-age=31536000
(mastodon-tl--byline toot
'mastodon-tl--byline-author
'mastodon-tl--byline-boosted))
- "(?) (?) Account 42 (@acct42@example.space) 2999-99-99 00:11:22
- ------------
-")))))
+ (concat "(?) (?) Account 42 (@acct42@example.space) 2999-99-99 00:11:22
+ "
+ mastodon-tl--horiz-bar "
+"))))))
(ert-deftest mastodon-tl--byline-reblogged ()
"Should format the reblogged toot correctly."
@@ -427,10 +432,10 @@ Strict-Transport-Security: max-age=31536000
(handle1-location 20)
(handle2-location 65))
(should (string= (substring-no-properties byline)
- "Account 42 (@acct42@example.space)
+ (concat "Account 42 (@acct42@example.space)
Boosted Account 43 (@acct43@example.space) original time
- ------------
-"))
+ " mastodon-tl--horiz-bar "
+")))
(should (eq (get-text-property handle1-location 'mastodon-tab-stop byline)
'user-handle))
(should (equal (get-text-property handle1-location 'help-echo byline)
@@ -461,10 +466,10 @@ Strict-Transport-Security: max-age=31536000
(mastodon-tl--byline toot
'mastodon-tl--byline-author
'mastodon-tl--byline-boosted))
- "Account 42 (@acct42@example.space)
+ (concat "Account 42 (@acct42@example.space)
Boosted Account 43 (@acct43@example.space) original time
- ------------
-")))))
+ " mastodon-tl--horiz-bar "
+"))))))
(ert-deftest mastodon-tl--byline-reblogged-boosted/favorited ()
"Should format the reblogged toot that was also boosted & favoritedcorrectly."
@@ -490,10 +495,10 @@ Strict-Transport-Security: max-age=31536000
(mastodon-tl--byline toot
'mastodon-tl--byline-author
'mastodon-tl--byline-boosted))
- "(?) (?) Account 42 (@acct42@example.space)
+ (concat "(?) (?) Account 42 (@acct42@example.space)
Boosted Account 43 (@acct43@example.space) original time
- ------------
-")))))
+ " mastodon-tl--horiz-bar "
+"))))))
(ert-deftest mastodon-tl--byline-timestamp-has-relative-display ()
"Should display the timestamp with a relative time."
@@ -829,8 +834,8 @@ Strict-Transport-Security: max-age=31536000
(defun tl-tests--property-values-at (property ranges)
"Returns a list with property values at the given ranges.
- The property value for PROPERTY within a region is assumed to be
- constant."
+ The property value for PROPERTY within a region is assumed to be
+ constant."
(let (result)
(dolist (range ranges (nreverse result))
(push (get-text-property (car range) property) result))))