Change: (org-ql--byte-compile-warning) More useful error message

e.g. if a predicate only accepts one argument, but the query gives
two, now the error will say, "PREDICATE called with 2 arguments, but
accepts only 1" (so maybe the predicate definition just needs
"&rest").
This commit is contained in:
Adam Porter 2022-05-31 12:01:19 -05:00
parent d0acc8cbba
commit 67506a56f8
3 changed files with 36 additions and 30 deletions

View file

@ -540,6 +540,9 @@ Simple links may also be written manually in either sexp or non-sexp form, like:
*Added* *Added*
+ Commands ~org-ql-find~, ~org-ql-find-heading~, and ~org-ql-find-path~, which jump to entries selected using Emacs's built-in completion facilities and Org QL queries (like ~helm-org-ql~, but doesn't require Helm.). + Commands ~org-ql-find~, ~org-ql-find-heading~, and ~org-ql-find-path~, which jump to entries selected using Emacs's built-in completion facilities and Org QL queries (like ~helm-org-ql~, but doesn't require Helm.).
*Changed*
+ Give more useful error message for invalid queries.
** 0.6.2 ** 0.6.2
*Fixed* *Fixed*

View file

@ -765,12 +765,12 @@ respectively."
"#+end_src") "#+end_src")
t)) t))
(defun org-ql--byte-compile-warning (_string _pos _fill level) (defun org-ql--byte-compile-warning (string _pos _fill level)
"Signal an `org-ql-invalid-query' error. "Signal an `org-ql-invalid-query' error.
Arguments STRING, POS, FILL, and LEVEL are according to Arguments STRING, POS, FILL, and LEVEL are according to
`byte-compile-log-warning-function'." `byte-compile-log-warning-function'."
;; Used as the `byte-compile-log-warning-function' in `org-ql--query-preamble'. ;; Used as the `byte-compile-log-warning-function' in `org-ql--query-preamble'.
(signal 'org-ql-invalid-query level)) (signal 'org-ql-invalid-query (list string level)))
(defun org-ql--query-predicate (query) (defun org-ql--query-predicate (query)
"Return predicate function for QUERY." "Return predicate function for QUERY."

View file

@ -1009,6 +1009,9 @@ File: README.info, Node: 07-pre, Next: 062, Up: Changelog
built-in completion facilities and Org QL queries (like built-in completion facilities and Org QL queries (like
helm-org-ql, but doesnt require Helm.). helm-org-ql, but doesnt require Helm.).
*Changed*
• Give more useful error message for invalid queries.
 
File: README.info, Node: 062, Next: 061, Prev: 07-pre, Up: Changelog File: README.info, Node: 062, Next: 061, Prev: 07-pre, Up: Changelog
@ -1653,34 +1656,34 @@ Node: Links36258
Node: Tips36945 Node: Tips36945
Node: Changelog37269 Node: Changelog37269
Node: 07-pre38037 Node: 07-pre38037
Node: 06238392 Node: 06238465
Node: 06138700 Node: 06138773
Node: 0639268 Node: 0639341
Node: 05242322 Node: 05242395
Node: 05142622 Node: 05142695
Node: 0543045 Node: 0543118
Node: 04944574 Node: 04944647
Node: 04844854 Node: 04844927
Node: 04745201 Node: 04745274
Node: 04645610 Node: 04645683
Node: 04546018 Node: 04546091
Node: 04446379 Node: 04446452
Node: 04346738 Node: 04346811
Node: 04246941 Node: 04247014
Node: 04147102 Node: 04147175
Node: 0447349 Node: 0447422
Node: 03251450 Node: 03251523
Node: 03151853 Node: 03151926
Node: 0352050 Node: 0352123
Node: 02355350 Node: 02355423
Node: 02255584 Node: 02255657
Node: 02155864 Node: 02155937
Node: 0256069 Node: 0256142
Node: 0160147 Node: 0160220
Node: Notes60248 Node: Notes60321
Node: Comparison with Org Agenda searches60410 Node: Comparison with Org Agenda searches60483
Node: org-sidebar61299 Node: org-sidebar61372
Node: License61578 Node: License61651
 
End Tag Table End Tag Table