aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-tl.el
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus@riseup.net>2024-03-05 20:51:11 +0100
committermarty hiatt <martianhiatus@riseup.net>2024-03-05 20:51:11 +0100
commitf807db692bc83f4f1000dbdd43e92153a5264d30 (patch)
tree61f2df476f61039372893348906b2159c5f46c39 /lisp/mastodon-tl.el
parent0dc21c9c3ed39b489e9220864fa47a1f9daade6a (diff)
cw-in-thread: don't move point, only fold if cw
Diffstat (limited to 'lisp/mastodon-tl.el')
-rw-r--r--lisp/mastodon-tl.el12
1 files changed, 8 insertions, 4 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index 83fdabc..9a3c798 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -1010,10 +1010,14 @@ content should be hidden."
'mastodon-tl--thread)))
(if (not thread-p)
(user-error "Not in a thread")
- (goto-char (point-min))
- (while (not (equal "No more items" ; improve this hack test!
- (mastodon-tl--goto-next-item :no-refresh)))
- (mastodon-tl--toggle-spoiler-text-in-toot)))))
+ (save-excursion
+ (goto-char (point-min))
+ (while (not (equal "No more items" ; improve this hack test!
+ (mastodon-tl--goto-next-item :no-refresh)))
+ (let* ((json (mastodon-tl--property 'item-json :no-move))
+ (cw (alist-get 'spoiler_text json)))
+ (when (not (equal "" cw))
+ (mastodon-tl--toggle-spoiler-text-in-toot))))))))
(defun mastodon-tl--clean-tabs-and-nl (string)
"Remove tabs and newlines from STRING."