Fix: (org-ql--define-query-preamble-fn) Pcase pattern for Emacs 30

Now all tests and lints pass on Emacs versions 27.1-29.4, and the
current 30.0.50-ish snapshot build.

Note: This change was originally applied on master, but it seems
reasonable to apply it to this stable bugfix release now.

Fixes #433.

Reported-by: Akira Komamura <akira.komamura@gmail.com>
Co-developed-by: Stefan Monnier <monnier@iro.umontreal.ca>
This commit is contained in:
Adam Porter 2024-06-27 09:10:47 -05:00
parent 5ea97d2272
commit e241354fd6
3 changed files with 56 additions and 44 deletions

View file

@ -1118,7 +1118,10 @@ defined in `org-ql-predicates' by calling `org-ql-defpred'."
;; Only one preamble is allowed
element)
(pcase element
(`(or _) element)
(`(or ,element)
;; A predicate with a single name: unwrap the OR. (Pcase doesn't like
;; "one-armed ORs", giving a "Please avoid it" compilation error.)
element)
,@preamble-patterns