From a1f836972d0af422f31af38d9effd82ca03148e1 Mon Sep 17 00:00:00 2001 From: Patrick Winter Date: Fri, 6 Sep 2019 21:58:47 +0200 Subject: [PATCH] Turn delete action into multi action --- taskwarrior.el | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/taskwarrior.el b/taskwarrior.el index e63354b..4b20acc 100644 --- a/taskwarrior.el +++ b/taskwarrior.el @@ -303,6 +303,14 @@ (boundp 'taskwarrior-marks) (> (length taskwarrior-marks) 0))) +(defun taskwarrior-delete () + (interactive) + (taskwarrior-multi-action 'taskwarrior--delete "Delete?")) + +(defun taskwarrior--delete (id) + "Delete task with id." + (taskwarrior--mutable-shell-command "delete" id "" "" "yes")) + (defun taskwarrior-done () (interactive) (taskwarrior-multi-action 'taskwarrior--done "Done?")) @@ -319,14 +327,6 @@ "Mark task as done." (taskwarrior--mutable-shell-command "done" id)) -(defun taskwarrior-delete () - "Delete current task." - (interactive) - (let ((id (taskwarrior-id-at-point)) - (confirmation (yes-or-no-p "Delete?"))) - (when confirmation - (taskwarrior--mutable-shell-command "delete" id "" "" "yes")))) - (defun taskwarrior-annotate (annotation) "Delete current task." (interactive "sAnnotation: ")