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

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

[nongnu] elpa/mastodon 0c048e154b 20/45: copy image caption cmd


From: ELPA Syncer
Subject: [nongnu] elpa/mastodon 0c048e154b 20/45: copy image caption cmd
Date: Thu, 1 Feb 2024 10:00:53 -0500 (EST)

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

    copy image caption cmd
---
 lisp/mastodon-tl.el | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index 97e8bc56e3..3ee12a91b3 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -263,6 +263,7 @@ types of mastodon links and not just shr.el-generated 
ones.")
     (define-key map (kbd "u") #'mastodon-tl--update)
     ;; keep new my-profile binding; shr 'O' doesn't work here anyway
     (define-key map (kbd "O") #'mastodon-profile--my-profile)
+    (define-key map (kbd "C") #'mastodon-tl--copy-image-caption)
     (define-key map (kbd "<C-return>") #'mastodon-tl--mpv-play-video-at-point)
     (define-key map (kbd "<mouse-2>") #'mastodon-tl--click-image-or-video)
     map)
@@ -1290,6 +1291,15 @@ in which case play first video or gif from current toot."
           (message "no moving image here?"))
       (message "no moving image here?"))))
 
+(defun mastodon-tl--copy-image-caption ()
+  "Copy the caption of the image at point."
+  (interactive)
+  (if-let ((desc (get-text-property (point) 'image-description)))
+      (progn
+        (kill-new desc)
+        (message "Image caption copied."))
+    (message "No image caption.")))
+
 
 ;;; INSERT TOOTS
 



reply via email to

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