Display due date in echo area

This commit is contained in:
Patrick Winter 2018-10-31 20:38:57 +01:00
parent 523c81b8cc
commit 1d2d76d972

View file

@ -22,15 +22,31 @@
(defvar taskwarrior-mode-map nil "Keymap for `taskwarrior-mode'")
(progn
(setq taskwarrior-mode-map (make-sparse-keymap))
(define-key taskwarrior-mode-map (kbd "p") 'previous-line)
(define-key taskwarrior-mode-map (kbd "k") 'previous-line)
(define-key taskwarrior-mode-map (kbd "n") 'next-line)
(define-key taskwarrior-mode-map (kbd "j") 'next-line)
(define-key taskwarrior-mode-map (kbd "p") 'taskwarrior-previous-task)
(define-key taskwarrior-mode-map (kbd "k") 'taskwarrior-previous-task)
(define-key taskwarrior-mode-map (kbd "n") 'taskwarrior-next-task)
(define-key taskwarrior-mode-map (kbd "j") 'taskwarrior-next-task)
(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-update-buffer)
(define-key taskwarrior-mode-map (kbd "a") 'taskwarrior-add)
(define-key taskwarrior-mode-map (kbd "p") 'taskwarrior-change-project))
(define-key taskwarrior-mode-map (kbd "P") 'taskwarrior-change-project))
(defun taskwarrior--display-task-details-in-echo-area ()
(let* ((id (taskwarrior-id-at-point))
(task (taskwarrior-export-task id))
(due (alist-get 'due task)))
(message "Due: %s" due)))
(defun taskwarrior-previous-task ()
(interactive)
(previous-line)
(taskwarrior--display-task-details-in-echo-area))
(defun taskwarrior-next-task ()
(interactive)
(next-line)
(taskwarrior--display-task-details-in-echo-area))
(defun taskwarrior-id-at-point ()
(let ((line (thing-at-point 'line t)))