aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2015-02-21 18:25:21 -0200
committerArtur Malabarba <bruce.connor.am@gmail.com>2015-02-21 18:25:21 -0200
commitd8968604c6d2e11e5365031759069fb5a671f688 (patch)
tree7518418d7f5e75f8a17e5a2555da0d286fbe9cb1
parentd13f4115beeda50a598f2161100a16fa21455e62 (diff)
Confirm before deletion
-rw-r--r--sx-interaction.el15
1 files changed, 10 insertions, 5 deletions
diff --git a/sx-interaction.el b/sx-interaction.el
index d2129f8..368da09 100644
--- a/sx-interaction.el
+++ b/sx-interaction.el
@@ -278,11 +278,16 @@ guessed from context at point.
With UNDO prefix argument, undelete instead."
(interactive (list (sx--error-if-unread (sx--data-here))
current-prefix-arg))
- (sx-method-post-from-data data (if undo 'delete/undo 'delete))
- ;; Indicate to ourselves this has been deleted.
- (setcdr data (cons (car data) (cdr data)))
- (setcar data 'deleted)
- (sx--maybe-update-display))
+ (when (y-or-n-p (format "DELETE this %s? "
+ (let-alist data
+ (cond (.comment_id "comment")
+ (.answer_id "answer")
+ (.question_id "question")))))
+ (sx-method-post-from-data data (if undo 'delete/undo 'delete))
+ ;; Indicate to ourselves this has been deleted.
+ (setcdr data (cons (car data) (cdr data)))
+ (setcar data 'deleted)
+ (sx--maybe-update-display)))
;;; Commenting