From 366b69a148953aa9c372ffb508a5817be65cbff7 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Sat, 10 Sep 2022 14:37:03 +0200 Subject: delete draft funs --- lisp/mastodon-toot.el | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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*")) -- cgit v1.2.3