diff options
author | mousebot <mousebot@riseup.net> | 2021-12-17 19:18:46 +0100 |
---|---|---|
committer | mousebot <mousebot@riseup.net> | 2021-12-17 19:18:46 +0100 |
commit | 9f5b56b4003f4ff5b2c3e6183de228d22c94574c (patch) | |
tree | b41fb69aed9fc52d66ebae2922e07c3adf880100 | |
parent | b693dc24e6bbabab2cbdea0cf19542d130973b02 (diff) |
y-or-n-p before cancelling a toot.
-rw-r--r-- | lisp/mastodon-toot.el | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index e813b33..230f7d2 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -359,7 +359,13 @@ Remove MARKER if REMOVE is non-nil, otherwise add it." (defun mastodon-toot--cancel () "Kill new-toot buffer/window. Does not POST content to Mastodon." (interactive) - (mastodon-toot--kill)) + (let* ((toot (mastodon-toot--remove-docs)) + (empty-toot-p (and (not mastodon-toot--media-attachments) + (string= "" (mastodon-tl--clean-tabs-and-nl toot))))) + (if empty-toot-p + (mastodon-toot--kill) + (when (y-or-n-p "Discard draft toot? ") + (mastodon-toot--kill))))) (defalias 'mastodon-toot--insert-emoji 'emojify-insert-emoji |