Introduce taskwarrior-task-at-point

This commit is contained in:
Patrick Winter 2019-11-05 20:15:19 +01:00
parent 02af750b16
commit 30adb49e95

View file

@ -204,12 +204,14 @@
(defun taskwarrior-id-at-point () (defun taskwarrior-id-at-point ()
"Get id of task at point." "Get id of task at point."
(let* ((line (thing-at-point 'line t)) (let ((line (thing-at-point 'line t)))
(parse-result (string-match "^ [0-9]*" line)) (string-match "^ [0-9]*" line)
(id (string-trim-left (match-string 0 line)))) (string-trim-left (match-string 0 line))))
(if (= id nil)
(error "Unable to extract id from line '%s'" line) (defun taskwarrior-task-at-point ()
id))) "Get id of task at point."
(let ((id (taskwarrior-id-at-point)))
(taskwarrior-export-task id)))
(defun taskwarrior-reset-filter () (defun taskwarrior-reset-filter ()
"Reset the currently set filter." "Reset the currently set filter."