From dad54cccbcc2385315ff8c32369bb607a937d15d Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Tue, 30 Jul 2024 16:01:23 +0200 Subject: fold-post-toggle --- lisp/mastodon-tl.el | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index ad8cc1a..a357146 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -1619,6 +1619,17 @@ Folding decided by `mastodon-tl--fold-toots-at-length'." (interactive) (mastodon-tl--unfold-post :fold)) +(defun mastodon-tl--fold-post-toggle () + "Toggle the folding status of the toot at point." + (interactive) + (let* ((byline-p (mastodon-tl--property 'byline)) + (read-more-p (save-excursion + (when byline-p + (previous-line) + (beginning-of-line)) + (mastodon-tl--property 'read-more)))) + (mastodon-tl--unfold-post (if (not read-more-p) :fold)))) + ;; from mastodon-alt.el: (defun mastodon-tl--toot-for-stats (&optional toot) "Return the TOOT on which we want to extract stats. -- cgit v1.2.3