From 363f7623c195c56a5543ce17668fcf3decf201ec Mon Sep 17 00:00:00 2001 From: Cyrille Froehlich Date: Sun, 16 May 2021 00:52:29 +0900 Subject: [PATCH 1/3] Fix: pcase pattern shadowed --- org-ql.el | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/org-ql.el b/org-ql.el index ac2e541..a6eedd2 100644 --- a/org-ql.el +++ b/org-ql.el @@ -1750,10 +1750,8 @@ Tests both inherited and local tags." (org-ql-defpred (tags-inherited inherited-tags tags-i itags) (&rest tags) "Return non-nil if current heading's inherited tags include one or more of TAGS (a list of strings). If TAGS is nil, return non-nil if heading has any inherited tags." - :normalizers ((`(,predicate-names . ,tags) - `(tags-inherited ,@tags)) - (`(,predicate-names) - `(tags-inherited))) + :normalizers ((`(,predicate-names) `(tags-inherited)) + (`(,predicate-names . ,tags) `(tags-inherited ,@tags))) :body (cl-macrolet ((tags-p (tags) `(and ,tags (not (eq 'org-ql-nil ,tags))))) From 99a22853173e325a01a689d9bfe416b863d8ce93 Mon Sep 17 00:00:00 2001 From: Cyrille Froehlich Date: Wed, 23 Jun 2021 17:48:06 +0900 Subject: [PATCH 2/3] Simplify tags-inherited normalizer --- org-ql.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/org-ql.el b/org-ql.el index a6eedd2..d56c687 100644 --- a/org-ql.el +++ b/org-ql.el @@ -1750,8 +1750,7 @@ Tests both inherited and local tags." (org-ql-defpred (tags-inherited inherited-tags tags-i itags) (&rest tags) "Return non-nil if current heading's inherited tags include one or more of TAGS (a list of strings). If TAGS is nil, return non-nil if heading has any inherited tags." - :normalizers ((`(,predicate-names) `(tags-inherited)) - (`(,predicate-names . ,tags) `(tags-inherited ,@tags))) + :normalizers ((`(,predicate-names . ,tags) `(tags-inherited ,@tags))) :body (cl-macrolet ((tags-p (tags) `(and ,tags (not (eq 'org-ql-nil ,tags))))) From bbeee64f41c98b82ffbf32db680aec3ed4a5279c Mon Sep 17 00:00:00 2001 From: Cyrille Froehlich Date: Wed, 28 Jul 2021 08:31:29 +0900 Subject: [PATCH 3/3] Simplify tags-all/tags-local too + Fix formatting --- org-ql.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/org-ql.el b/org-ql.el index d56c687..25ac675 100644 --- a/org-ql.el +++ b/org-ql.el @@ -1743,14 +1743,15 @@ Tests both inherited and local tags." "Return non-nil if current heading has all of TAGS (a list of strings). Tests both inherited and local tags." ;; MAYBE: -all versions for inherited and local. - :normalizers ((`(,predicate-names) `(tags)) - (`(,predicate-names . ,tags) `(and ,@(--map `(tags ,it) tags)))) + :normalizers ((`(,predicate-names . ,tags) + `(and ,@(--map `(tags ,it) tags)))) :body (apply #'org-ql--predicate-tags tags)) (org-ql-defpred (tags-inherited inherited-tags tags-i itags) (&rest tags) "Return non-nil if current heading's inherited tags include one or more of TAGS (a list of strings). If TAGS is nil, return non-nil if heading has any inherited tags." - :normalizers ((`(,predicate-names . ,tags) `(tags-inherited ,@tags))) + :normalizers ((`(,predicate-names . ,tags) + `(tags-inherited ,@tags))) :body (cl-macrolet ((tags-p (tags) `(and ,tags (not (eq 'org-ql-nil ,tags))))) @@ -1763,8 +1764,8 @@ If TAGS is nil, return non-nil if heading has any inherited tags." (org-ql-defpred (tags-local local-tags tags-l ltags) (&rest tags) "Return non-nil if current heading's local tags include one or more of TAGS (a list of strings). If TAGS is nil, return non-nil if heading has any local tags." - :normalizers ((`(,predicate-names) `(tags-local)) - (`(,predicate-names . ,tags) `(tags-local ,@tags))) + :normalizers ((`(,predicate-names . ,tags) + `(tags-local ,@tags))) :preambles ((`(,predicate-names . ,(and tags (guard tags))) ;; When searching for local, non-inherited tags, we can ;; search directly to headings containing one of the tags.