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

@ -765,12 +765,12 @@ respectively."
"#+end_src")
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.
Arguments STRING, POS, FILL, and LEVEL are according to
`byte-compile-log-warning-function'."
;; 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)
"Return predicate function for QUERY."