aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2015-02-21 15:25:11 -0200
committerArtur Malabarba <bruce.connor.am@gmail.com>2015-02-21 15:25:55 -0200
commit4788ac7655a93fbcc423feaf60eb1e887b2f41c2 (patch)
tree5d7cb6c37a3677691dca073edf74124c0f082cea
parentfb70d2798482057943f4301c75ad09fb8653f27c (diff)
Define sx-delete
-rw-r--r--sx-interaction.el11
1 files changed, 11 insertions, 0 deletions
diff --git a/sx-interaction.el b/sx-interaction.el
index e534984..8eae96f 100644
--- a/sx-interaction.el
+++ b/sx-interaction.el
@@ -270,6 +270,17 @@ changes."
(sx--maybe-update-display))))
+;;; Delete
+(defun sx-delete (data &optional undo)
+ "Delete an object given by DATA.
+DATA can be a question, answer, or comment. Interactively, it is
+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)))
+
+
;;; Commenting
(defun sx-comment (data &optional text)
"Post a comment on DATA given by TEXT.