From b7d4856f926cb71e01427a940dc948a48b0a702d Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 27 Jun 2024 09:10:47 -0500 Subject: [PATCH] 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. But on the current Emacs snapshot build used in CI, Buttercup is hanging indefinitely, which may be the same problem that led Guix to disable the tests in . But I've no way of knowing whether that's a problem in org-ql (seems unlikely), Emacs snapshot, or Buttercup. It would be nice to solve this before Emacs 30.1 is released, but I don't know how to peer inside Buttercup to find out what it's hanging on. Fixes #433. Reported-by: Akira Komamura Co-developed-by: Stefan Monnier --- README.org | 3 +- org-ql.el | 8 ++--- org-ql.info | 96 ++++++++++++++++++++++++++++------------------------- 3 files changed, 56 insertions(+), 51 deletions(-) diff --git a/README.org b/README.org index 4fb2fb9..61995fb 100644 --- a/README.org +++ b/README.org @@ -556,7 +556,8 @@ Simple links may also be written manually in either sexp or non-sexp form, like: ** 0.9-pre -Nothing new yet. +*Compatibility* ++ Fix compilation error on Emacs 30. ([[https://github.com/alphapapa/org-ql/issues/433][#433]]. Thanks to [[https://github.com/akirak][Akira Komamura]] and [[https://github.com/monnier][Stefan Monnier]].) *** helm-org-ql diff --git a/org-ql.el b/org-ql.el index 921a5b2..811bd92 100644 --- a/org-ql.el +++ b/org-ql.el @@ -1118,10 +1118,10 @@ defined in `org-ql-predicates' by calling `org-ql-defpred'." ;; Only one preamble is allowed element) (pcase element - ;; FIXME: Should the pattern below be "`(or . ,_)"? It - ;; seems to work fine either way, but it seems like it - ;; should be changed. - (`(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 diff --git a/org-ql.info b/org-ql.info index cf608ad..c2641b7 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1091,7 +1091,11 @@ File: README.info, Node: 09-pre, Next: 087, Up: Changelog 5.1 0.9-pre =========== -Nothing new yet. +*Compatibility* + • Fix compilation error on Emacs 30. (#433 + (https://github.com/alphapapa/org-ql/issues/433). Thanks to Akira + Komamura (https://github.com/akirak) and Stefan Monnier + (https://github.com/monnier).) * Menu: @@ -2088,51 +2092,51 @@ Node: Links39023 Node: Tips39710 Node: Changelog40034 Node: 09-pre40973 -Node: helm-org-ql (1)41122 -Node: 08741263 -Node: 08642494 -Node: 08542728 -Node: 08443384 -Node: 08343836 -Node: 08244177 -Node: 08144570 -Node: 0844991 -Node: 07447715 -Node: 07347940 -Node: 07248674 -Node: 07149595 -Node: 0750406 -Node: 06353272 -Node: 06253805 -Node: 06154112 -Node: 0654682 -Node: 05257738 -Node: 05158040 -Node: 0558465 -Node: 04959996 -Node: 04860278 -Node: 04760627 -Node: 04661036 -Node: 04561444 -Node: 04461805 -Node: 04362164 -Node: 04262367 -Node: 04162528 -Node: 0462775 -Node: 03266876 -Node: 03167279 -Node: 0367476 -Node: 02370776 -Node: 02271010 -Node: 02171290 -Node: 0271495 -Node: 0175573 -Node: Development75674 -Node: Copyright assignment75907 -Node: Notes76497 -Node: Comparison with Org Agenda searches76661 -Node: org-sidebar77550 -Node: License77829 +Node: helm-org-ql (1)41339 +Node: 08741480 +Node: 08642711 +Node: 08542945 +Node: 08443601 +Node: 08344053 +Node: 08244394 +Node: 08144787 +Node: 0845208 +Node: 07447932 +Node: 07348157 +Node: 07248891 +Node: 07149812 +Node: 0750623 +Node: 06353489 +Node: 06254022 +Node: 06154329 +Node: 0654899 +Node: 05257955 +Node: 05158257 +Node: 0558682 +Node: 04960213 +Node: 04860495 +Node: 04760844 +Node: 04661253 +Node: 04561661 +Node: 04462022 +Node: 04362381 +Node: 04262584 +Node: 04162745 +Node: 0462992 +Node: 03267093 +Node: 03167496 +Node: 0367693 +Node: 02370993 +Node: 02271227 +Node: 02171507 +Node: 0271712 +Node: 0175790 +Node: Development75891 +Node: Copyright assignment76124 +Node: Notes76714 +Node: Comparison with Org Agenda searches76878 +Node: org-sidebar77767 +Node: License78046  End Tag Table