From 30adb49e955f3237bd571b7644c3e7953bdc286c Mon Sep 17 00:00:00 2001 From: Patrick Winter Date: Tue, 5 Nov 2019 20:15:19 +0100 Subject: [PATCH] Introduce taskwarrior-task-at-point --- taskwarrior.el | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/taskwarrior.el b/taskwarrior.el index d094664..79632d8 100644 --- a/taskwarrior.el +++ b/taskwarrior.el @@ -204,12 +204,14 @@ (defun taskwarrior-id-at-point () "Get id of task at point." - (let* ((line (thing-at-point 'line t)) - (parse-result (string-match "^ [0-9]*" line)) - (id (string-trim-left (match-string 0 line)))) - (if (= id nil) - (error "Unable to extract id from line '%s'" line) - id))) + (let ((line (thing-at-point 'line t))) + (string-match "^ [0-9]*" line) + (string-trim-left (match-string 0 line)))) + +(defun taskwarrior-task-at-point () + "Get id of task at point." + (let ((id (taskwarrior-id-at-point))) + (taskwarrior-export-task id))) (defun taskwarrior-reset-filter () "Reset the currently set filter."