Avoid compiler warnings when defining predicate without body

This commit is contained in:
Ihor Radchenko 2021-04-06 21:54:29 +08:00
parent 3e6818d819
commit dc6f2d2501
No known key found for this signature in database
GPG key ID: 6470762A7DA11D8B

View file

@ -1117,7 +1117,7 @@ It would be expanded to:
(preambles (cl-sublis (list (cons 'predicate-names (cons 'or (--map (list 'quote it) predicate-names))))
preambles)))
`(progn
(cl-defun ,fn-name ,args ,docstring ,body)
(cl-defun ,fn-name ,(if body args '(&rest _)) ,docstring ,body)
;; SOMEDAY: Use `map-elt' here, after map 2.1 can be automatically installed in CI sandbox...
(setf (alist-get ',predicate-name org-ql-predicates)
`(:name ,',name :aliases ,',aliases :fn ,',fn-name :docstring ,(\, docstring) :args ,',args