Add transient command to edit date on task

This commit is contained in:
Patrick Winter 2019-09-08 11:28:49 +02:00
parent 9e8747037b
commit a42dd902cb

View file

@ -73,19 +73,20 @@
(defvar taskwarrior-mode-map nil "Keymap for `taskwarrior-mode'") (defvar taskwarrior-mode-map nil "Keymap for `taskwarrior-mode'")
(progn (progn
(setq taskwarrior-mode-map (make-sparse-keymap)) (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-add)
(define-key taskwarrior-mode-map (kbd "A") 'taskwarrior-annotate) (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 "l") 'taskwarrior-load-profile)
(define-key taskwarrior-mode-map (kbd "o") 'taskwarrior-open-annotation) (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 "m") 'taskwarrior-mark-task)
(define-key taskwarrior-mode-map (kbd "u") 'taskwarrior-unmark-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 "r") 'taskwarrior-reset-filter)
(define-key taskwarrior-mode-map (kbd "t") 'taskwarrior-edit-tags) (define-key taskwarrior-mode-map (kbd "t") 'taskwarrior-edit-tags)
(define-key taskwarrior-mode-map (kbd "RET") 'taskwarrior-info) (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)) (setq font-lock-defaults '(taskwarrior-highlight-regexps))
(taskwarrior-mode) (taskwarrior-mode)
(hl-line-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)]])