Merge pull request #178 from orther/handle-ivy-tasks-matching-errors

Gracefully handle +ivy-tasks match errors
This commit is contained in:
Henrik Lissner 2017-08-22 00:49:31 +02:00 committed by GitHub
commit 274afba607

View file

@ -110,11 +110,17 @@ If WORKSPACE-ONLY-P (universal arg), limit to buffers in the current workspace."
(save-match-data
(cl-loop with out = (shell-command-to-string cmd)
for x in (and out (split-string out "\n" t))
when (string-match
(concat "^\\([^:]+\\):\\([0-9]+\\):.+\\("
(string-join task-tags "\\|")
"\\):?\\s-*\\(.+\\)")
x)
when (condition-case-unless-debug ex
(string-match
(concat "^\\([^:]+\\):\\([0-9]+\\):.+\\("
(string-join task-tags "\\|")
"\\):?\\s-*\\(.+\\)")
x)
(error
(message! (red "Error matching task in file: (%s) %s"
(error-message-string ex)
(car (split-string x ":"))))
nil))
collect `((type . ,(match-string 3 x))
(desc . ,(match-string 4 x))
(file . ,(match-string 1 x))