emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/mastodon dad54cccbc 46/63: fold-post-toggle


From: ELPA Syncer
Subject: [nongnu] elpa/mastodon dad54cccbc 46/63: fold-post-toggle
Date: Sun, 4 Aug 2024 04:00:39 -0400 (EDT)

branch: elpa/mastodon
commit dad54cccbcc2385315ff8c32369bb607a937d15d
Author: marty hiatt <martianhiatus@riseup.net>
Commit: marty hiatt <martianhiatus@riseup.net>

    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 ad8cc1a5e7..a357146cc4 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]