Add taskwarrior info function
This commit is contained in:
parent
777434aef5
commit
15d055aaf3
1 changed files with 9 additions and 0 deletions
|
@ -41,6 +41,7 @@
|
||||||
(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-filter)
|
(define-key taskwarrior-mode-map (kbd "f") 'taskwarrior-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 "RET") 'taskwarrior-info)
|
||||||
(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 ()
|
(defun taskwarrior--display-task-details-in-echo-area ()
|
||||||
|
@ -73,6 +74,14 @@
|
||||||
(setq-local taskwarrior-marks (delete-dups (cons id taskwarrior-marks)))
|
(setq-local taskwarrior-marks (delete-dups (cons id taskwarrior-marks)))
|
||||||
(setq-local taskwarrior-marks (list id)))))
|
(setq-local taskwarrior-marks (list id)))))
|
||||||
|
|
||||||
|
(defun taskwarrior-info ()
|
||||||
|
(interactive)
|
||||||
|
(let* ((id (taskwarrior-id-at-point))
|
||||||
|
(buf (get-buffer-create "*taskwarrior info*")))
|
||||||
|
(progn
|
||||||
|
(switch-to-buffer-other-window buf)
|
||||||
|
(insert (taskwarrior--shell-command "info" "" id)))))
|
||||||
|
|
||||||
(defun taskwarrior-id-at-point ()
|
(defun taskwarrior-id-at-point ()
|
||||||
(let ((line (thing-at-point 'line t)))
|
(let ((line (thing-at-point 'line t)))
|
||||||
(string-match "^[0-9]*" line)
|
(string-match "^[0-9]*" line)
|
||||||
|
|
Loading…
Reference in a new issue