Merge: Fix shadowed pcase pattern

Fixes #214.  Thanks to Cyrille Froehlich (@cfroehli), Ihor
Radchenko (@yantar92), Kai von Fintel (@fintelkai), and @aur3l14no.
This commit is contained in:
Adam Porter 2021-09-22 00:37:17 -05:00
commit 8f307a8820

View file

@ -1743,17 +1743,15 @@ Tests both inherited and local tags."
"Return non-nil if current heading has all of TAGS (a list of strings). "Return non-nil if current heading has all of TAGS (a list of strings).
Tests both inherited and local tags." Tests both inherited and local tags."
;; MAYBE: -all versions for inherited and local. ;; MAYBE: -all versions for inherited and local.
:normalizers ((`(,predicate-names) `(tags)) :normalizers ((`(,predicate-names . ,tags)
(`(,predicate-names . ,tags) `(and ,@(--map `(tags ,it) tags)))) `(and ,@(--map `(tags ,it) tags))))
:body (apply #'org-ql--predicate-tags tags)) :body (apply #'org-ql--predicate-tags tags))
(org-ql-defpred (tags-inherited inherited-tags tags-i itags) (&rest 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). "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." If TAGS is nil, return non-nil if heading has any inherited tags."
:normalizers ((`(,predicate-names . ,tags) :normalizers ((`(,predicate-names . ,tags)
`(tags-inherited ,@tags)) `(tags-inherited ,@tags)))
(`(,predicate-names)
`(tags-inherited)))
:body (cl-macrolet ((tags-p (tags) :body (cl-macrolet ((tags-p (tags)
`(and ,tags `(and ,tags
(not (eq 'org-ql-nil ,tags))))) (not (eq 'org-ql-nil ,tags)))))
@ -1766,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) (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). "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." If TAGS is nil, return non-nil if heading has any local tags."
:normalizers ((`(,predicate-names) `(tags-local)) :normalizers ((`(,predicate-names . ,tags)
(`(,predicate-names . ,tags) `(tags-local ,@tags))) `(tags-local ,@tags)))
:preambles ((`(,predicate-names . ,(and tags (guard tags))) :preambles ((`(,predicate-names . ,(and tags (guard tags)))
;; When searching for local, non-inherited tags, we can ;; When searching for local, non-inherited tags, we can
;; search directly to headings containing one of the tags. ;; search directly to headings containing one of the tags.