Fix: Catch errors in preamble evaluation
This commit is contained in:
parent
83cc00a27d
commit
62f4e0b110
1 changed files with 11 additions and 7 deletions
|
|
@ -1066,6 +1066,7 @@ defined in `org-ql-predicates' by calling `org-ql-defpred'."
|
||||||
(or (when org-ql-preamble
|
(or (when org-ql-preamble
|
||||||
;; Only one preamble is allowed
|
;; Only one preamble is allowed
|
||||||
element)
|
element)
|
||||||
|
(condition-case err
|
||||||
(pcase element
|
(pcase element
|
||||||
(`(or _) element)
|
(`(or _) element)
|
||||||
|
|
||||||
|
|
@ -1074,7 +1075,10 @@ defined in `org-ql-predicates' by calling `org-ql-defpred'."
|
||||||
(`(and . ,rest)
|
(`(and . ,rest)
|
||||||
(let ((clauses (mapcar #'rec rest)))
|
(let ((clauses (mapcar #'rec rest)))
|
||||||
`(and ,@(-non-nil clauses))))
|
`(and ,@(-non-nil clauses))))
|
||||||
(_ element)))))
|
(_ element))
|
||||||
|
(error
|
||||||
|
(message "Preamble error: %s" err)
|
||||||
|
nil)))))
|
||||||
(setq query (pcase (mapcar #'rec (list query))
|
(setq query (pcase (mapcar #'rec (list query))
|
||||||
((or `(nil)
|
((or `(nil)
|
||||||
`((nil))
|
`((nil))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue