Fix deletion of tasks
This commit is contained in:
parent
ce8bae17cd
commit
888dd38a40
1 changed files with 13 additions and 9 deletions
|
@ -86,10 +86,16 @@
|
|||
(taskwarrior--set-filter new-filter)
|
||||
(taskwarrior-update-buffer new-filter))))
|
||||
|
||||
(defun taskwarrior--shell-command (command &optional filter modifications miscellaneous)
|
||||
(let ((cmd (format "task %s %s %s %s"
|
||||
|
||||
|
||||
(shell-command-to-string "echo yes | task 34 delete")
|
||||
|
||||
(defun taskwarrior--shell-command (command &optional filter modifications miscellaneous confirm)
|
||||
(let* ((confirmation (if confirm (concat "echo " confirm " |") ""))
|
||||
(cmd (format "%s task %s %s %s %s"
|
||||
(or confirmation "")
|
||||
(or filter "")
|
||||
command
|
||||
(or command "")
|
||||
(or modifications "")
|
||||
(or miscellaneous ""))))
|
||||
(progn
|
||||
|
@ -155,9 +161,7 @@
|
|||
(let ((id (taskwarrior-id-at-point))
|
||||
(confirmation (read-from-minibuffer "Delete [y/n]?: ")))
|
||||
(when (string= confirmation "y")
|
||||
(taskwarrior--shell-command "config" "" "confirmation off")
|
||||
(message (taskwarrior--shell-command "delete" id))
|
||||
(taskwarrior--shell-command "config" "" "confirmation on")
|
||||
(message (taskwarrior--shell-command "delete" id "" "" "yes"))
|
||||
(taskwarrior-update-buffer))))
|
||||
|
||||
;; Setup a major mode for taskwarrior
|
||||
|
|
Loading…
Reference in a new issue