aboutsummaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus [a t] riseup [d o t] net>2022-09-10 14:37:03 +0200
committermarty hiatt <martianhiatus [a t] riseup [d o t] net>2022-09-10 14:37:59 +0200
commit366b69a148953aa9c372ffb508a5817be65cbff7 (patch)
tree09297559e1980c6c5e03ed8297cd7da704cd2499 /lisp
parent64fed02a4bda13cb47a727d8da63a506b6bf855b (diff)
delete draft funs
Diffstat (limited to 'lisp')
-rw-r--r--lisp/mastodon-toot.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index 3eebd4b..a312cf5 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -1091,6 +1091,21 @@ Added to `after-change-functions' in new toot buffers."
(mastodon-toot--compose-buffer))
(message "No drafts available")))
+(defun mastodon-toot-delete-draft-toot ()
+ "Prompt for a draft toot and delete it."
+ (interactive)
+ (let ((draft (completing-read "Select draft to delete: "
+ mastodon-toot-draft-toots-list
+ nil t)))
+ (setq mastodon-toot-draft-toots-list
+ (cl-delete draft mastodon-toot-draft-toots-list
+ :test 'equal))
+ (message "Draft deleted!")))
+
+(defun mastodon-toot-delete-all-drafts ()
+ "Delete all drafts."
+ (setq mastodon-toot-draft-toots-list nil))
+
(defun mastodon-toot-compose-buffer-p ()
"Return t if compose buffer is "
(equal (buffer-name (current-buffer)) "*new toot*"))