From 26240826c408c9412f85d019be9a22d5954d9384 Mon Sep 17 00:00:00 2001 From: Patrick Winter Date: Mon, 4 Nov 2019 13:39:30 +0100 Subject: [PATCH] Raise error if taskwarrior-id-at-point is unable to parse id --- taskwarrior.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/taskwarrior.el b/taskwarrior.el index 0025799..d094664 100644 --- a/taskwarrior.el +++ b/taskwarrior.el @@ -204,9 +204,12 @@ (defun taskwarrior-id-at-point () "Get id of task at point." - (let ((line (thing-at-point 'line t))) - (string-match "^ [0-9]*" line) - (string-trim-left (match-string 0 line)))) + (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))) (defun taskwarrior-reset-filter () "Reset the currently set filter."