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

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

[nongnu] elpa/mastodon 7bcc81748d 03/13: refactor toot-url and copy-toot


From: ELPA Syncer
Subject: [nongnu] elpa/mastodon 7bcc81748d 03/13: refactor toot-url and copy-toot-url
Date: Thu, 12 Oct 2023 10:01:26 -0400 (EDT)

branch: elpa/mastodon
commit 7bcc81748d5a7c2ef4b6460500a9eb1ea3ddca18
Author: marty hiatt <martianhiatus [a t] riseup [d o t] net>
Commit: marty hiatt <martianhiatus [a t] riseup [d o t] net>

    refactor toot-url and copy-toot-url
---
 lisp/mastodon-toot.el | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index f46fc6deec..f819a16e23 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -507,14 +507,18 @@ With FAVOURITE, list favouriters, else list boosters."
 If the toot is a fave/boost notification, copy the URL of the
 base toot."
   (interactive)
-  (let* ((toot (or (mastodon-tl--property 'base-toot)
-                   (mastodon-tl--property 'toot-json)))
-         (url (if (mastodon-tl--field 'reblog toot)
-                  (alist-get 'url (alist-get 'reblog toot))
-                (alist-get 'url toot))))
+  (let* ((url (mastodon-toot--toot-url)))
     (kill-new url)
     (message "Toot URL copied to the clipboard.")))
 
+(defun mastodon-toot--toot-url ()
+  "Return the URL of the base toot at point."
+  (let* ((toot (or (mastodon-tl--property 'base-toot)
+                   (mastodon-tl--property 'toot-json))))
+    (if (mastodon-tl--field 'reblog toot)
+        (alist-get 'url (alist-get 'reblog toot))
+      (alist-get 'url toot))))
+
 (defun mastodon-toot--copy-toot-text ()
   "Copy text of toot at point.
 If the toot is a fave/boost notification, copy the text of the



reply via email to

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