[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/mastodon 9ffe93009c 38/45: edit attachments description fu
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/mastodon 9ffe93009c 38/45: edit attachments description fun |
Date: |
Thu, 1 Feb 2024 10:01:03 -0500 (EST) |
branch: elpa/mastodon
commit 9ffe93009cbcf40a4b0aab103c8bcd98bb291ba7
Author: marty hiatt <martianhiatus@riseup.net>
Commit: marty hiatt <martianhiatus@riseup.net>
edit attachments description fun
---
lisp/mastodon-toot.el | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index f60f3148de..6febec7544 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -1225,6 +1225,30 @@ File is actually attached to the toot upon posting."
(mastodon-toot--upload-attached-media
(car (last mastodon-toot--media-attachments)))))
+(defun mastodon-toot--attachment-descriptions ()
+ "Return a list of image descriptions for current attachments."
+ (mapcar (lambda (a)
+ (alist-get :description a))
+ mastodon-toot--media-attachments))
+
+(defun mastodon-toot--attachment-from-desc (desc)
+ "Return an attachment based on its description DESC."
+ (car
+ (cl-member-if (lambda (x)
+ (rassoc desc x))
+ mastodon-toot--media-attachments)))
+
+(defun mastodon-toot--edit-media-description ()
+ "Prompt for an attachment, and update its description."
+ (interactive)
+ (let* ((descs (mastodon-toot--attachment-descriptions))
+ (choice (completing-read "Attachment: " descs nil :match))
+ (attachment (mastodon-toot--attachment-from-desc choice))
+ (desc-new (read-string "Description: " choice)))
+ (setf (alist-get :description attachment)
+ desc-new)
+ (mastodon-toot--refresh-attachments-display)))
+
(defun mastodon-toot--upload-attached-media (attachment)
"Upload a single ATTACHMENT using `mastodon-http--post-media-attachment'.
The item's id is added to `mastodon-toot--media-attachment-ids',
- [nongnu] elpa/mastodon 406d87cc7a 07/45: display-media-p var > defcustom, (continued)
- [nongnu] elpa/mastodon 406d87cc7a 07/45: display-media-p var > defcustom, ELPA Syncer, 2024/02/01
- [nongnu] elpa/mastodon 33d0011c7c 11/45: toot--reply: call toot--compose-buffer not just toot, ELPA Syncer, 2024/02/01
- [nongnu] elpa/mastodon 0c7322e839 24/45: refactor mastodon-toot--make-capf, ELPA Syncer, 2024/02/01
- [nongnu] elpa/mastodon 0c048e154b 20/45: copy image caption cmd, ELPA Syncer, 2024/02/01
- [nongnu] elpa/mastodon 703655f109 26/45: Merge branch 'emoji-capf' into develop, ELPA Syncer, 2024/02/01
- [nongnu] elpa/mastodon a6680b093e 13/45: remove ; ; Version: strings in buffers other than mastodon.el, ELPA Syncer, 2024/02/01
- [nongnu] elpa/mastodon 8108187270 10/45: buffer-for: fix () to ensure goto point min works on cycle, ELPA Syncer, 2024/02/01
- [nongnu] elpa/mastodon 3b3f5228ac 35/45: profile: Use v2 search when looking for users, ELPA Syncer, 2024/02/01
- [nongnu] elpa/mastodon 6fc44fe225 34/45: fix signature of make-capf so we call it right!, ELPA Syncer, 2024/02/01
- [nongnu] elpa/mastodon 844a97ca89 39/45: fix typo in fun name, ELPA Syncer, 2024/02/01
- [nongnu] elpa/mastodon 9ffe93009c 38/45: edit attachments description fun,
ELPA Syncer <=
- [nongnu] elpa/mastodon 792e18037d 27/45: Use `equal' to access alist entries by `mastodon-instance-url', ELPA Syncer, 2024/02/01
- [nongnu] elpa/mastodon 07b9052501 40/45: Merge pull request 'profile: Use v2 search when looking for users' (#524) from dme/mastodon.el:develop into develop, ELPA Syncer, 2024/02/01
- [nongnu] elpa/mastodon 9a8d24f9fa 02/45: call remove-overlays in --thread (fix bug display of play if we reload a thread), ELPA Syncer, 2024/02/01
- [nongnu] elpa/mastodon fda3e5963d 44/45: Merge pull request 'Add a couple of key bindings that I have found useful' (#525) from dme/mastodon.el:devel/suspend into develop, ELPA Syncer, 2024/02/01
- [nongnu] elpa/mastodon f994ae1b71 03/45: add role badge to profiles. FIX #504., ELPA Syncer, 2024/02/01
- [nongnu] elpa/mastodon f1af40e2c0 08/45: edit toots adopt attachments. FIX #506, ELPA Syncer, 2024/02/01
- [nongnu] elpa/mastodon aa0a2c08f0 06/45: add msg about loss of attachments on editing toot, ELPA Syncer, 2024/02/01
- [nongnu] elpa/mastodon c9c9487968 21/45: docstring, ELPA Syncer, 2024/02/01
- [nongnu] elpa/mastodon 6a306afeed 23/45: FIX #515. completion-ignore-case t buffer-local for compose, ELPA Syncer, 2024/02/01
- [nongnu] elpa/mastodon 65821b2f24 17/45: update help-echo for new profile cycle cmds, ELPA Syncer, 2024/02/01