diff options
author | marty hiatt <martianhiatus@riseup.net> | 2024-07-30 16:01:23 +0200 |
---|---|---|
committer | marty hiatt <martianhiatus@riseup.net> | 2024-07-30 16:01:23 +0200 |
commit | dad54cccbcc2385315ff8c32369bb607a937d15d (patch) | |
tree | c1865c45664217750e7751e31da8275edc48153f /lisp/mastodon-tl.el | |
parent | 134ec9413a86bc97320548cba3dcfda286ebd938 (diff) |
fold-post-toggle
Diffstat (limited to 'lisp/mastodon-tl.el')
-rw-r--r-- | lisp/mastodon-tl.el | 11 |
1 files changed, 11 insertions, 0 deletions
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. |