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

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

[nongnu] elpa/mastodon 589868c98d 19/45: add image-description text prop


From: ELPA Syncer
Subject: [nongnu] elpa/mastodon 589868c98d 19/45: add image-description text property
Date: Thu, 1 Feb 2024 10:00:49 -0500 (EST)

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

    add image-description text property
---
 lisp/mastodon-media.el | 3 ++-
 lisp/mastodon-tl.el    | 6 ++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/lisp/mastodon-media.el b/lisp/mastodon-media.el
index 561327c8d2..894a21a32a 100644
--- a/lisp/mastodon-media.el
+++ b/lisp/mastodon-media.el
@@ -321,7 +321,8 @@ CAPTION is the image caption if provided."
     (concat
      (mastodon-tl--propertize-img-str-or-url
       "[img]" media-url full-remote-url type help-echo
-      (create-image mastodon-media--generic-broken-image-data nil t))
+      (create-image mastodon-media--generic-broken-image-data nil t)
+      nil caption)
      " ")))
 
 (provide 'mastodon-media)
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index 8e3ce4a073..97e8bc56e3 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -1053,11 +1053,12 @@ message is a link which unhides/hides the main body."
                  (concat "Media:: " .preview_url) ; string
                  .preview_url .remote_url .type .description
                  display-str ; display
-                 'shr-link)
+                 'shr-link .description)
                 "\n")))))
 
 (defun mastodon-tl--propertize-img-str-or-url
-    (str media-url full-remote-url type help-echo &optional display face)
+    (str media-url full-remote-url type help-echo
+         &optional display face caption)
   "Propertize an media placeholder string \"[img]\" or media URL.
 STR is the string to propertize, MEDIA-URL is the preview link,
 FULL-REMOTE-URL is the link to the full resolution image on the
@@ -1074,6 +1075,7 @@ HELP-ECHO, DISPLAY, and FACE are the text properties to 
add."
               'mastodon-tab-stop 'image ; for do-link-action-at-point
               'image-url full-remote-url ; for shr-browse-image
               'keymap mastodon-tl--shr-image-map-replacement
+              'image-description caption
               'help-echo (if (or (string= type "image")
                                  (string= type nil)
                                  (string= type "unknown")) ; handle borked 
images



reply via email to

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