aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-toot.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/mastodon-toot.el')
-rw-r--r--lisp/mastodon-toot.el8
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