diff options
author | marty hiatt <martianhiatus@riseup.net> | 2024-07-30 09:24:50 +0200 |
---|---|---|
committer | marty hiatt <martianhiatus@riseup.net> | 2024-07-30 09:27:29 +0200 |
commit | f8ee682bb403b5488294e69c464149626221f7c7 (patch) | |
tree | b04cb3ada561084fe6ff9ec8d50509c37355f9cc | |
parent | d7816ab59fdf64fc64adf3185052ee10931d7076 (diff) |
flip an if clause
-rw-r--r-- | lisp/mastodon-toot.el | 22 |
1 files changed, 11 insertions, 11 deletions
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." |