diff --git a/README.org b/README.org index 54f5cf1..335f7e5 100644 --- a/README.org +++ b/README.org @@ -461,6 +461,11 @@ Simple links may also be written manually in either sexp or non-sexp form, like: /Note:/ Breaking changes may be made before version 1.0, but in the event of major changes, attempts at backward compatibility will be made with obsolescence declarations, translation of arguments, etc. Users who need stability guarantees before 1.0 may choose to use tagged stable releases. +** 0.5.2 + +*Fixed* ++ Predicate ~link~'s ~:target~ and ~:regexp-p~ arguments. ([[https://github.com/alphapapa/org-ql/pull/220][#220]]. Thanks to [[https://github.com/akirak][Akira Komamura]].) + ** 0.5.1 *Fixed* diff --git a/org-ql.el b/org-ql.el index fc4f218..9ea5275 100644 --- a/org-ql.el +++ b/org-ql.el @@ -2,7 +2,7 @@ ;; Author: Adam Porter ;; Url: https://github.com/alphapapa/org-ql -;; Version: 0.5.1 +;; Version: 0.5.2-pre ;; Package-Requires: ((emacs "26.1") (dash "2.13") (dash-functional "1.2.0") (f "0.17.2") (map "2.1") (org "9.0") (org-super-agenda "1.2") (ov "1.0.6") (peg "0.6") (s "1.12.0") (transient "0.1") (ts "0.2-pre")) ;; Keywords: hypermedia, outlines, Org, agenda @@ -810,19 +810,26 @@ replace the clause with a preamble." ;; have to use `plist-get' here for now. Maybe when we drop ;; support for Emacs <28... (`(link ,(and description-or-target - (guard (not (keywordp description-or-target))))) + (guard (not (keywordp description-or-target)))) + . ,plist) (setq org-ql-preamble (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) (`(link . ,plist) (setq org-ql-preamble (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) ;; Planning lines. @@ -1250,7 +1257,7 @@ any link is found." 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 diff --git a/org-ql.info b/org-ql.info index a9e2afa..3127af3 100644 --- a/org-ql.info +++ b/org-ql.info @@ -66,6 +66,7 @@ Functions / Macros Changelog +* 0.5.2: 052. * 0.5.1: 051. * 0.5: 05. * 0.4.9: 049. @@ -832,6 +833,7 @@ releases. * Menu: +* 0.5.2: 052. * 0.5.1: 051. * 0.5: 05. * 0.4.9: 049. @@ -854,9 +856,20 @@ releases. * 0.1: 01.  -File: README.info, Node: 051, Next: 05, Up: Changelog +File: README.info, Node: 052, Next: 051, Up: Changelog -5.1 0.5.1 +5.1 0.5.2 +========= + +*Fixed* + • Predicate ‘link’’s ‘:target’ and ‘:regexp-p’ arguments. (#220 + (https://github.com/alphapapa/org-ql/pull/220). Thanks to Akira + Komamura (https://github.com/akirak).) + + +File: README.info, Node: 051, Next: 05, Prev: 052, Up: Changelog + +5.2 0.5.1 ========= *Fixed* @@ -869,7 +882,7 @@ File: README.info, Node: 051, Next: 05, Up: Changelog  File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog -5.2 0.5 +5.3 0.5 ======= *Added* @@ -910,7 +923,7 @@ File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog  File: README.info, Node: 049, Next: 048, Prev: 05, Up: Changelog -5.3 0.4.9 +5.4 0.4.9 ========= *Fixed* @@ -921,7 +934,7 @@ File: README.info, Node: 049, Next: 048, Prev: 05, Up: Changelog  File: README.info, Node: 048, Next: 047, Prev: 049, Up: Changelog -5.4 0.4.8 +5.5 0.4.8 ========= *Fixed* @@ -933,7 +946,7 @@ File: README.info, Node: 048, Next: 047, Prev: 049, Up: Changelog  File: README.info, Node: 047, Next: 046, Prev: 048, Up: Changelog -5.5 0.4.7 +5.6 0.4.7 ========= *Fixed* @@ -946,7 +959,7 @@ File: README.info, Node: 047, Next: 046, Prev: 048, Up: Changelog  File: README.info, Node: 046, Next: 045, Prev: 047, Up: Changelog -5.6 0.4.6 +5.7 0.4.6 ========= *Fixed* @@ -959,7 +972,7 @@ File: README.info, Node: 046, Next: 045, Prev: 047, Up: Changelog  File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog -5.7 0.4.5 +5.8 0.4.5 ========= *Fixed* @@ -971,7 +984,7 @@ File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog  File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog -5.8 0.4.4 +5.9 0.4.4 ========= *Fixed* @@ -983,8 +996,8 @@ File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog  File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog -5.9 0.4.3 -========= +5.10 0.4.3 +========== *Fixed* • When org-ql-view-refresh is called, ensure the buffer is an Org QL @@ -993,7 +1006,7 @@ File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog  File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog -5.10 0.4.2 +5.11 0.4.2 ========== *Fixed* @@ -1002,7 +1015,7 @@ File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog  File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog -5.11 0.4.1 +5.12 0.4.1 ========== *Fixed* @@ -1012,7 +1025,7 @@ File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog  File: README.info, Node: 04, Next: 032, Prev: 041, Up: Changelog -5.12 0.4 +5.13 0.4 ======== _Note:_ The next release, 0.5, may include changes which will require @@ -1093,7 +1106,7 @@ as they will be pushed to the master branch when ready.  File: README.info, Node: 032, Next: 031, Prev: 04, Up: Changelog -5.13 0.3.2 +5.14 0.3.2 ========== *Fixed* @@ -1106,7 +1119,7 @@ File: README.info, Node: 032, Next: 031, Prev: 04, Up: Changelog  File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog -5.14 0.3.1 +5.15 0.3.1 ========== *Fixed* @@ -1116,7 +1129,7 @@ File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog  File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog -5.15 0.3 +5.16 0.3 ======== *Added* @@ -1181,7 +1194,7 @@ File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog  File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog -5.16 0.2.3 +5.17 0.2.3 ========== *Fixed* @@ -1191,7 +1204,7 @@ File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog  File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog -5.17 0.2.2 +5.18 0.2.2 ========== *Fixed* @@ -1202,7 +1215,7 @@ File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog  File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog -5.18 0.2.1 +5.19 0.2.1 ========== *Fixed* @@ -1212,7 +1225,7 @@ File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog  File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog -5.19 0.2 +5.20 0.2 ======== *Added* @@ -1295,7 +1308,7 @@ File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog  File: README.info, Node: 01, Prev: 02, Up: Changelog -5.20 0.1 +5.21 0.1 ======== First tagged release. @@ -1353,54 +1366,55 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1601 -Node: Screenshots1724 -Node: Installation1842 -Node: Quelpa2480 -Node: Usage2923 -Node: Commands3321 -Node: org-ql-search3794 -Node: helm-org-ql5444 -Node: org-ql-view5856 -Node: org-ql-view-sidebar6356 -Node: org-ql-view-recent-items6712 -Node: org-ql-sparse-tree7196 -Node: Queries7996 -Node: Non-sexp query syntax9107 -Node: General predicates10814 -Node: Ancestor/descendant predicates16227 -Node: Date/time predicates17355 -Node: Functions / Macros20010 -Node: Agenda-like views20265 -Node: Listing / acting-on results21670 -Node: Dynamic block26865 -Node: Links29563 -Node: Tips30250 -Node: Changelog30568 -Node: 05131259 -Node: 0531664 -Node: 04933138 -Node: 04833412 -Node: 04733759 -Node: 04634154 -Node: 04534554 -Node: 04434913 -Node: 04335270 -Node: 04235465 -Node: 04135626 -Node: 0435867 -Node: 03239800 -Node: 03140179 -Node: 0340376 -Node: 02343351 -Node: 02243579 -Node: 02143847 -Node: 0244046 -Node: 0148081 -Node: Notes48182 -Node: Comparison with Org Agenda searches48344 -Node: org-sidebar49216 -Node: License49495 +Node: Contents1616 +Node: Screenshots1739 +Node: Installation1857 +Node: Quelpa2495 +Node: Usage2938 +Node: Commands3336 +Node: org-ql-search3809 +Node: helm-org-ql5459 +Node: org-ql-view5871 +Node: org-ql-view-sidebar6371 +Node: org-ql-view-recent-items6727 +Node: org-ql-sparse-tree7211 +Node: Queries8011 +Node: Non-sexp query syntax9122 +Node: General predicates10829 +Node: Ancestor/descendant predicates16242 +Node: Date/time predicates17370 +Node: Functions / Macros20025 +Node: Agenda-like views20280 +Node: Listing / acting-on results21685 +Node: Dynamic block26880 +Node: Links29578 +Node: Tips30265 +Node: Changelog30583 +Node: 05231289 +Node: 05131578 +Node: 0531995 +Node: 04933469 +Node: 04833743 +Node: 04734090 +Node: 04634485 +Node: 04534885 +Node: 04435244 +Node: 04335601 +Node: 04235798 +Node: 04135959 +Node: 0436200 +Node: 03240133 +Node: 03140512 +Node: 0340709 +Node: 02343684 +Node: 02243912 +Node: 02144180 +Node: 0244379 +Node: 0148414 +Node: Notes48515 +Node: Comparison with Org Agenda searches48677 +Node: org-sidebar49549 +Node: License49828  End Tag Table diff --git a/tests/data.org b/tests/data.org index b7a13cb..99875d8 100644 --- a/tests/data.org +++ b/tests/data.org @@ -81,7 +81,7 @@ SCHEDULED: <2017-07-05 Wed> If I don't, the frobnicator will probably fall off halfway to Mars... -Gotta buy one first, though. +Gotta buy one first, though. [[https://example.com/][This one]] looks suitable. * Recurring :PROPERTIES: diff --git a/tests/test-org-ql.el b/tests/test-org-ql.el index c9d560e..f273c57 100644 --- a/tests/test-org-ql.el +++ b/tests/test-org-ql.el @@ -644,7 +644,7 @@ RESULTS should be a list of strings as returned by (describe "(link)" (org-ql-it "without arguments" (org-ql-expect ('(link)) - '("/r/emacs"))) + '("Fix flux capacitor" "/r/emacs"))) (org-ql-it "with description-or-target" (org-ql-expect ('(link "emacs")) '("/r/emacs"))) @@ -656,6 +656,18 @@ RESULTS should be a list of strings as returned by '("/r/emacs"))) (org-ql-it "with :description and :target" (org-ql-expect ('(link :description "emacs" :target "reddit.com")) + '("/r/emacs"))) + (org-ql-it "with description-or-target regexp" + (org-ql-expect ('(link "em.cs" :regexp-p t)) + '("/r/emacs"))) + (org-ql-it "with :description regexp" + (org-ql-expect ('(link :description "em.cs" :regexp-p t)) + '("/r/emacs"))) + (org-ql-it "with :target regexp" + (org-ql-expect ('(link :target "em.cs" :regexp-p t)) + '("/r/emacs"))) + (org-ql-it "with :description and :target regexp" + (org-ql-expect ('(link :description "em.cs" :target "em.cs" :regexp-p t)) '("/r/emacs")))) (describe "(outline-path)"