Raise error if taskwarrior-id-at-point is unable to parse id
This commit is contained in:
parent
d277e955b9
commit
26240826c4
1 changed files with 6 additions and 3 deletions
|
@ -204,9 +204,12 @@
|
||||||
|
|
||||||
(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))
|
||||||
(string-match "^ [0-9]*" line)
|
(parse-result (string-match "^ [0-9]*" line))
|
||||||
(string-trim-left (match-string 0 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 ()
|
(defun taskwarrior-reset-filter ()
|
||||||
"Reset the currently set filter."
|
"Reset the currently set filter."
|
||||||
|
|
Loading…
Reference in a new issue