From f8ee682bb403b5488294e69c464149626221f7c7 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Tue, 30 Jul 2024 09:24:50 +0200 Subject: flip an if clause --- lisp/mastodon-toot.el | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'lisp/mastodon-toot.el') diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index 666d1b0..0cd66db 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -1863,17 +1863,17 @@ Added to `after-change-functions' in new toot buffers." (defun mastodon-toot--delete-draft-toot () "Prompt for a draft toot and delete it." (interactive) - (if (multisession-value mastodon-toot-draft-toots-list) - (let ((draft (completing-read - "Select draft to delete: " - (multisession-value mastodon-toot-draft-toots-list) - nil t))) - (setf (multisession-value mastodon-toot-draft-toots-list) - (cl-delete draft - (multisession-value mastodon-toot-draft-toots-list) - :test #'equal)) - (message "Draft deleted!")) - (message "No drafts to delete."))) + (if (not (multisession-value mastodon-toot-draft-toots-list)) + (message "No drafts to delete.") + (let ((draft (completing-read + "Select draft to delete: " + (multisession-value mastodon-toot-draft-toots-list) + nil t))) + (setf (multisession-value mastodon-toot-draft-toots-list) + (cl-delete draft + (multisession-value mastodon-toot-draft-toots-list) + :test #'equal)) + (message "Draft deleted!")))) (defun mastodon-toot--delete-all-drafts () "Delete all drafts." -- cgit v1.2.3