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

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

[nongnu] elpa/mastodon f152b11732 08/18: separate thread-do function


From: ELPA Syncer
Subject: [nongnu] elpa/mastodon f152b11732 08/18: separate thread-do function
Date: Thu, 21 Nov 2024 13:00:18 -0500 (EST)

branch: elpa/mastodon
commit f152b11732febdbe7ee3e82db8f7ae8b94bfd56b
Author: marty hiatt <martianhiatus@disroot.org>
Commit: marty hiatt <martianhiatus@disroot.org>

    separate thread-do function
---
 lisp/mastodon-tl.el | 8 ++++++--
 lisp/mastodon.el    | 2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index 799b54b1fa..225dfd3f16 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -2336,8 +2336,12 @@ UNFOLDED STATE is a boolean of whether the thread (we are
 reloading) is fully unfolded or folded, i.e. via
 `mastodon-tl--toggle-spoiler-in-thread'."
   (interactive)
-  ;; no toot-at-point macro here as we can call this programmatically, eg from
-  ;; `mastodon-url-lookup'
+  (mastodon-toot--with-toot-item
+   (mastodon-tl--thread-do thread-id unfolded-state)))
+
+(defun mastodon-tl--thread-do (&optional thread-id unfolded-state)
+  "Load a thread.
+Non-interactive version, so we can call it programmatically and not crash into 
`mastodon-toot--with-toot-item'."
   ;; this function's var must not be id as the above macro binds id and even
   ;; if we provide the arg (e.g. url-lookup), the macro definition overrides
   ;; it, making the optional arg unusable!
diff --git a/lisp/mastodon.el b/lisp/mastodon.el
index c13c3ba349..89ce8f189b 100644
--- a/lisp/mastodon.el
+++ b/lisp/mastodon.el
@@ -432,7 +432,7 @@ If FORCE, do a lookup regardless of the result of 
`mastodon--fedi-url-p'."
                (let* ((statuses (assoc 'statuses response))
                       (status (seq-first (cdr statuses)))
                       (status-id (alist-get 'id status)))
-                 (mastodon-tl--thread status-id)))
+                 (mastodon-tl--thread-do status-id)))
               ((not (seq-empty-p (alist-get 'accounts response)))
                (let* ((accounts (assoc 'accounts response))
                       (account (seq-first (cdr accounts))))



reply via email to

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