diff --git a/taskwarrior.el b/taskwarrior.el index e3b761a..defb7ce 100644 --- a/taskwarrior.el +++ b/taskwarrior.el @@ -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)))