Skip to content

Fix bugs with the link predicate #220

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions org-ql.el
Original file line number Diff line number Diff line change
@@ -1137,25 +1137,32 @@ any link is found."
"]"
(or eol blank))))
(`(,predicate-names ,(and description-or-target
(guard (not (keywordp description-or-target)))))
(guard (not (keywordp description-or-target))))
. ,plist)
(list :regexp (org-ql--link-regexp :description-or-target
(regexp-quote description-or-target)))
(if (plist-get plist :regexp-p)
description-or-target
(regexp-quote description-or-target))))
nil)
(`(,predicate-names . ,plist)
(list :regexp (org-ql--link-regexp
:description
(when (plist-get plist :description)
(regexp-quote (plist-get plist :description)))
(if (plist-get plist :regexp-p)
(plist-get plist :description)
(regexp-quote (plist-get plist :description))))
:target (when (plist-get plist :target)
(regexp-quote (plist-get plist :target)))))
(if (plist-get plist :regexp-p)
(plist-get plist :target)
(regexp-quote (plist-get plist :target))))))
nil))
:body (let* (plist description-or-target description target regexp-p)
(if (not (keywordp (car args)))
(setf description-or-target (car args)
plist (cdr args))
(setf plist args))
(setf description (plist-get plist :description)
target (plist-get plist :description)
target (plist-get plist :target)
regexp-p (plist-get plist :regexp-p))
(unless regexp-p
;; NOTE: It would also be preferable to avoid regexp-quoting every time this predicate