From 0c8ec9d3aa99c789fc8519b701c62bff379da652 Mon Sep 17 00:00:00 2001 From: Patrick Winter Date: Sun, 1 Sep 2019 21:44:17 +0200 Subject: [PATCH] Add ability to add annotations to tasks --- taskwarrior.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/taskwarrior.el b/taskwarrior.el index ab69cda..5c2b9f2 100644 --- a/taskwarrior.el +++ b/taskwarrior.el @@ -78,6 +78,7 @@ (define-key taskwarrior-mode-map (kbd "U") 'taskwarrior-edit-priority) (define-key taskwarrior-mode-map (kbd "g") 'taskwarrior-update-buffer) (define-key taskwarrior-mode-map (kbd "a") 'taskwarrior-add) + (define-key taskwarrior-mode-map (kbd "A") 'taskwarrior-annotate) (define-key taskwarrior-mode-map (kbd "d") 'taskwarrior-done) (define-key taskwarrior-mode-map (kbd "l") 'taskwarrior-load-profile) (define-key taskwarrior-mode-map (kbd "o") 'taskwarrior-open-annotation) @@ -300,6 +301,12 @@ (when confirmation (taskwarrior--mutable-shell-command "delete" id "" "" "yes")))) +(defun taskwarrior-annotate (annotation) + "Delete current task." + (interactive "sAnnotation: ") + (let ((id (taskwarrior-id-at-point))) + (taskwarrior--mutable-shell-command "annotate" id annotation))) + (defun taskwarrior--mutable-shell-command (command &optional filter modifications misc confirm) "Run shell command and restore taskwarrior buffer." (let ((line-number (line-number-at-pos)))