From 5d64ae379c87fe2b183b5a03401b43dcc9f9610a Mon Sep 17 00:00:00 2001 From: Patrick Winter Date: Tue, 13 Nov 2018 21:28:26 +0100 Subject: [PATCH] Update buffer when content is modified through add, delete or done --- taskwarrior.el | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/taskwarrior.el b/taskwarrior.el index 0bb2ee0..400a0db 100644 --- a/taskwarrior.el +++ b/taskwarrior.el @@ -105,7 +105,8 @@ (defun taskwarrior-add (description) (interactive "sDescription: ") - (message (taskwarrior--shell-command "add" "" description))) + (message (taskwarrior--shell-command "add" "" description)) + (taskwarrior-update-buffer)) (defun taskwarrior-done () "Mark current task as done." @@ -113,7 +114,8 @@ (let ((id (taskwarrior-id-at-point)) (confirmation (read-from-minibuffer "Done [y/n]?: "))) (when (string= confirmation "y") - (message (taskwarrior--shell-command "done" id))))) + (message (taskwarrior--shell-command "done" id)) + (taskwarrior-update-buffer)))) (defun taskwarrior-delete () "Delete current task." @@ -121,10 +123,10 @@ (let ((id (taskwarrior-id-at-point)) (confirmation (read-from-minibuffer "Delete [y/n]?: "))) (when (string= confirmation "y") - (progn - (taskwarrior--shell-command "config" "" "confirmation off") - (message (taskwarrior--shell-command "delete" id)) - (taskwarrior--shell-command "config" "" "confirmation on"))))) + (taskwarrior--shell-command "config" "" "confirmation off") + (message (taskwarrior--shell-command "delete" id)) + (taskwarrior--shell-command "config" "" "confirmation on") + (taskwarrior-update-buffer)))) ;; Setup a major mode for taskwarrior ;;;###autoload