From f807db692bc83f4f1000dbdd43e92153a5264d30 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Tue, 5 Mar 2024 20:51:11 +0100 Subject: cw-in-thread: don't move point, only fold if cw --- lisp/mastodon-tl.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'lisp/mastodon-tl.el') 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." -- cgit v1.2.3