From 0c048e154b5599fb83a2b2b8cc2579e1eef7eb39 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Fri, 8 Dec 2023 14:11:50 +0100 Subject: 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 97e8bc5..3ee12a9 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 "") #'mastodon-tl--mpv-play-video-at-point) (define-key map (kbd "") #'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 -- cgit v1.2.3