diff options
author | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2023-10-08 09:36:48 +0200 |
---|---|---|
committer | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2023-10-08 09:36:48 +0200 |
commit | 7bcc81748d5a7c2ef4b6460500a9eb1ea3ddca18 (patch) | |
tree | 9c7b360380e5667c95e422e80e5d3b163fad4426 /lisp | |
parent | 1a07051ea3ea9573df7634031203ecaf2413dbe1 (diff) |
refactor toot-url and copy-toot-url
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/mastodon-toot.el | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index f46fc6d..f819a16 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 |