Turn delete action into multi action

This commit is contained in:
Patrick Winter 2019-09-06 21:58:47 +02:00
parent 9ada92a225
commit a1f836972d

View file

@ -303,6 +303,14 @@
(boundp 'taskwarrior-marks) (boundp 'taskwarrior-marks)
(> (length taskwarrior-marks) 0))) (> (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 () (defun taskwarrior-done ()
(interactive) (interactive)
(taskwarrior-multi-action 'taskwarrior--done "Done?")) (taskwarrior-multi-action 'taskwarrior--done "Done?"))
@ -319,14 +327,6 @@
"Mark task as done." "Mark task as done."
(taskwarrior--mutable-shell-command "done" id)) (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) (defun taskwarrior-annotate (annotation)
"Delete current task." "Delete current task."
(interactive "sAnnotation: ") (interactive "sAnnotation: ")