aboutsummaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-02-13 15:57:33 +0100
committermarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-02-13 15:58:41 +0100
commit696ee69f9877f92abd5221d2314e45f1ea953d8e (patch)
treecc3e4842dbfb4bdec2e1a952a9449312537da9ed /lisp
parent025fd4f246226b78fd0e4a676570962258b2db4f (diff)
tl--list-followed-tags: view tag timeline of chosen tag
Diffstat (limited to 'lisp')
-rw-r--r--lisp/mastodon-tl.el16
1 files changed, 8 insertions, 8 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index 3c6c702..57d827b 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -430,12 +430,13 @@ Used on initializing a timeline or thread."
("limit" . ,mastodon-tl--timeline-posts-count))
(when current-prefix-arg t)))
-(defun mastodon-tl--get-tag-timeline ()
- "Prompt for tag and opens its timeline."
+(defun mastodon-tl--get-tag-timeline (&optional tag)
+ "Prompt for tag and opens its timeline.
+Optionally load TAG timeline directly."
(interactive)
(let* ((word (or (word-at-point) ""))
- (input (read-string (format "Load timeline for tag (%s): " word)))
- (tag (if (string-empty-p input) word input)))
+ (input (or tag (read-string (format "Load timeline for tag (%s): " word))))
+ (tag (or tag (if (string-empty-p input) word input))))
(message "Loading timeline for #%s..." tag)
(mastodon-tl--show-tag-timeline tag)))
@@ -2696,7 +2697,7 @@ If TAG provided, follow it."
(defun mastodon-tl--unfollow-tag (&optional tag)
"Prompt for a followed tag, and unfollow it.
-If TAG if provided, unfollow it."
+If TAG is provided, unfollow it."
(interactive)
(let* ((followed-tags-json (unless tag (mastodon-tl--followed-tags)))
(tags (unless tag (mapcar (lambda (x)
@@ -2711,15 +2712,14 @@ If TAG if provided, unfollow it."
(message "tag #%s unfollowed!" tag)))))
(defun mastodon-tl--list-followed-tags ()
- "List tags followed. If user choses one, display its JSON."
+ "List followed tags. View timeline of tag user choses."
(interactive)
(let* ((followed-tags-json (mastodon-tl--followed-tags))
(tags (mapcar (lambda (x)
(alist-get 'name x))
followed-tags-json))
(tag (completing-read "Tag: " tags)))
- (message (prin1-to-string
- (mastodon-tl--get-tag-json tag)))))
+ (mastodon-tl--get-tag-timeline tag)))
;; TODO: add this to new posts in some cases, e.g. in thread view.
(defun mastodon-tl--reload-timeline-or-profile ()