From a42dd902cb271f7c29e1f63177332780b0053b93 Mon Sep 17 00:00:00 2001 From: Patrick Winter Date: Sun, 8 Sep 2019 11:28:49 +0200 Subject: [PATCH] Add transient command to edit date on task --- taskwarrior.el | 39 ++++++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/taskwarrior.el b/taskwarrior.el index 670dc1b..9e90fb4 100644 --- a/taskwarrior.el +++ b/taskwarrior.el @@ -73,19 +73,20 @@ (defvar taskwarrior-mode-map nil "Keymap for `taskwarrior-mode'") (progn (setq taskwarrior-mode-map (make-sparse-keymap)) - (define-key taskwarrior-mode-map (kbd "q") 'quit-window) - (define-key taskwarrior-mode-map (kbd "e") 'taskwarrior-change-description) - (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 "d") 'taskwarrior-date) + (define-key taskwarrior-mode-map (kbd "x") 'taskwarrior-done) + (define-key taskwarrior-mode-map (kbd "D") 'taskwarrior-delete) + (define-key taskwarrior-mode-map (kbd "e") 'taskwarrior-change-description) + (define-key taskwarrior-mode-map (kbd "q") 'quit-window) + (define-key taskwarrior-mode-map (kbd "g") 'taskwarrior-update-buffer) + (define-key taskwarrior-mode-map (kbd "q") 'quit-window) + (define-key taskwarrior-mode-map (kbd "U") 'taskwarrior-edit-priority) (define-key taskwarrior-mode-map (kbd "l") 'taskwarrior-load-profile) (define-key taskwarrior-mode-map (kbd "o") 'taskwarrior-open-annotation) - (define-key taskwarrior-mode-map (kbd "D") 'taskwarrior-delete) (define-key taskwarrior-mode-map (kbd "m") 'taskwarrior-mark-task) (define-key taskwarrior-mode-map (kbd "u") 'taskwarrior-unmark-task) - (define-key taskwarrior-mode-map (kbd "f") 'taskwarrior-set-filter) (define-key taskwarrior-mode-map (kbd "r") 'taskwarrior-reset-filter) (define-key taskwarrior-mode-map (kbd "t") 'taskwarrior-edit-tags) (define-key taskwarrior-mode-map (kbd "RET") 'taskwarrior-info) @@ -370,3 +371,27 @@ the front and focus it. Otherwise, create one and load the data." (setq font-lock-defaults '(taskwarrior-highlight-regexps)) (taskwarrior-mode) (hl-line-mode)))) + +(defun taskwarrior-set-due () + (interactive) + (taskwarrior--change-attribute "due")) + +(defun taskwarrior-set-scheduled () + (interactive) + (taskwarrior--change-attribute "scheduled")) + +(defun taskwarrior-set-wait () + (interactive) + (taskwarrior--change-attribute "wait")) + +(defun taskwarrior-set-untl () + (interactive) + (taskwarrior--change-attribute "until")) + +(define-transient-command taskwarrior-date () + "Edit date on task" + [["Date" + ("d" "due" taskwarrior-set-due) + ("s" "scheduled" taskwarrior-set-scheduled) + ("w" "wait" taskwarrior-set-wait) + ("u" "until" taskwarrior-set-untl)]])