Replace read-from-minibuffer with yes-or-no-p

No reason to reinvent the wheel.
This commit is contained in:
Patrick Winter 2019-04-09 13:42:53 +02:00
parent e92708ae9a
commit 3de77fb049

View file

@ -165,8 +165,8 @@
"Mark current task as done." "Mark current task as done."
(interactive) (interactive)
(let ((id (taskwarrior-id-at-point)) (let ((id (taskwarrior-id-at-point))
(confirmation (read-from-minibuffer "Done [y/n]?: "))) (confirmation (yes-or-no-p "Done?")))
(when (string= confirmation "y") (when confirmation
(taskwarrior--shell-command "done" id) (taskwarrior--shell-command "done" id)
(taskwarrior-update-buffer)))) (taskwarrior-update-buffer))))
@ -174,8 +174,8 @@
"Delete current task." "Delete current task."
(interactive) (interactive)
(let ((id (taskwarrior-id-at-point)) (let ((id (taskwarrior-id-at-point))
(confirmation (read-from-minibuffer "Delete [y/n]?: "))) (confirmation (yes-or-no-p "Delete?")))
(when (string= confirmation "y") (when confirmation
(taskwarrior--shell-command "delete" id "" "" "yes") (taskwarrior--shell-command "delete" id "" "" "yes")
(taskwarrior-update-buffer)))) (taskwarrior-update-buffer))))