diff options
author | mousebot <mousebot@riseup.net> | 2022-03-10 13:09:47 +0100 |
---|---|---|
committer | mousebot <mousebot@riseup.net> | 2022-03-10 13:09:47 +0100 |
commit | a14ecfce170e82ae610247b8ed1854077deed8c0 (patch) | |
tree | 110797b752882328b1c8b52b1988a7adf9677505 /lisp/mastodon-media.el | |
parent | d90c104299636f2525f8b77001b4374e5b0df72a (diff) |
display image caption in help echo
Diffstat (limited to 'lisp/mastodon-media.el')
-rw-r--r-- | lisp/mastodon-media.el | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lisp/mastodon-media.el b/lisp/mastodon-media.el index 9441bdb..f79b1fa 100644 --- a/lisp/mastodon-media.el +++ b/lisp/mastodon-media.el @@ -307,12 +307,16 @@ Replace them with the referenced image." t image-options)) " "))) -(defun mastodon-media--get-media-link-rendering (media-url &optional full-remote-url type) +(defun mastodon-media--get-media-link-rendering (media-url &optional full-remote-url type caption) "Return the string to be written that renders the image at MEDIA-URL. FULL-REMOTE-URL is used for `shr-browse-image'. TYPE is the attachment's type field on the server." - (let ((help-echo - "RET/i: load full image (prefix: copy URL), +/-: zoom, r: rotate, o: save preview")) + (let* ((help-echo-base "RET/i: load full image (prefix: copy URL), +/-: zoom, r: rotate, o: save preview") + (help-echo (if caption + (concat help-echo-base + "\n\"" + caption "\"") + help-echo-base))) (concat (propertize "[img]" 'media-url media-url |