Add abilitiy to create tasks from org links
This is very handy to create tasks based on mu4e mails and dired files.
This commit is contained in:
parent
8cc5226972
commit
9064d99a01
1 changed files with 12 additions and 0 deletions
|
@ -148,6 +148,18 @@
|
|||
(switch-to-buffer-other-window buf)
|
||||
(insert (taskwarrior--shell-command "info" "" id)))))
|
||||
|
||||
(defun taskwarrior--parse-created-task-id (output)
|
||||
(when (string-match "^.*Created task \\([0-9]+\\)\\.*$" output)
|
||||
(message (match-string 1 output))))
|
||||
|
||||
(defun taskwarrior-org-store-link (arg)
|
||||
(interactive "P")
|
||||
(let* ((link (org-store-link arg))
|
||||
(description (read-from-minibuffer "Description: "))
|
||||
(id (taskwarrior--parse-created-task-id
|
||||
(shell-command-to-string (format "task add %s" description)))))
|
||||
(shell-command-to-string (format "task %s annotate %s" id link))))
|
||||
|
||||
(defun taskwarrior-id-at-point ()
|
||||
(let ((line (thing-at-point 'line t)))
|
||||
(string-match "^ [0-9]*" line)
|
||||
|
|
Loading…
Reference in a new issue