From f72feb80184749a2f39bb769081d17b0da0e0684 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 4 Sep 2024 21:40:36 -0500 Subject: [PATCH 01/23] Revert "Tests: Fix filename tests for CI" This reverts commit 611198155dbdd5c82d00475aa6587273150c5e8f. --- tests/test-org-ql.el | 40 +++++++++++++++------------------------- 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/tests/test-org-ql.el b/tests/test-org-ql.el index 7618327..7f5431c 100644 --- a/tests/test-org-ql.el +++ b/tests/test-org-ql.el @@ -2111,31 +2111,21 @@ with keyword arg NOW in PLIST." (describe "Buffers/Files" :var ((query '(and (todo "TODO") (regexp "heading"))) (one-filename (car temp-filenames))) - ;; NOTE: Inexplicably, on GitHub CI, the filenames are being - ;; abbreviated (i.e. "/home/FOO" is replaced with "~/FOO"); - ;; I can only guess it's something to do with the way the - ;; Emacs instance is built in the Nix images we use there. - ;; So we have to compare the filenames in abbreviated form. - (cl-labels ((filenames-equal-p (a b) - (seq-set-equal-p (mapcar #'abbreviate-file-name a) - (mapcar #'abbreviate-file-name b)))) - (it "One filename matches" - (should (equal (abbreviate-file-name - (var-after-bookmark-set-and-jump 'org-ql-view-buffers-files one-filename query)) - (abbreviate-file-name one-filename)))) - (it "A list of filenames matches" - (should (filenames-equal-p (var-after-bookmark-set-and-jump 'org-ql-view-buffers-files temp-filenames query) - temp-filenames))) - ;; NOTE: These actually bookmark the filenames backing the buffers. - (it "One buffer matches" - (should (equal (abbreviate-file-name - (var-after-bookmark-set-and-jump 'org-ql-view-buffers-files - (find-file-noselect (car temp-filenames)) query)) - (abbreviate-file-name one-filename)))) - (it "A list of buffers matches" - (should (filenames-equal-p (var-after-bookmark-set-and-jump 'org-ql-view-buffers-files - (mapcar #'find-file-noselect temp-filenames) query) - temp-filenames))))))) + (it "One filename matches" + (expect (var-after-bookmark-set-and-jump 'org-ql-view-buffers-files one-filename query) + :to-equal one-filename)) + (it "A list of filenames matches" + (expect (var-after-bookmark-set-and-jump 'org-ql-view-buffers-files temp-filenames query) + :to-equal temp-filenames)) + ;; NOTE: These actually bookmark the filenames backing the buffers. + (it "One buffer matches" + (expect (var-after-bookmark-set-and-jump 'org-ql-view-buffers-files + (find-file-noselect (car temp-filenames)) query) + :to-equal one-filename)) + (it "A list of buffers matches" + (expect (var-after-bookmark-set-and-jump 'org-ql-view-buffers-files + (mapcar #'find-file-noselect temp-filenames) query) + :to-equal temp-filenames))))) (describe "Dynamic blocks" (describe "warn about sexp queries" From 831a1d47367d18bc0978ca08de6c4776277fe8d0 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 4 Sep 2024 21:40:44 -0500 Subject: [PATCH 02/23] Tests: Fix filenames for CI (better) This is much simpler. --- tests/test-org-ql.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test-org-ql.el b/tests/test-org-ql.el index 7f5431c..2cfb59e 100644 --- a/tests/test-org-ql.el +++ b/tests/test-org-ql.el @@ -2005,7 +2005,7 @@ with keyword arg NOW in PLIST." (describe "View saving/loading" :var* ((temp-dir (make-temp-file "test-org-ql-" 'dir)) (temp-filenames (cl-loop for file in '("test1.org" "test2.org") - collect (expand-file-name file temp-dir))) + collect (abbreviate-file-name (expand-file-name file temp-dir)))) (file-contents (with-temp-buffer (insert "#+TITLE: Test data\n\n" "* TODO Heading 1\n" From bcb77b75cc22cefcd1029a857aebe9139ba7c265 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 4 Sep 2024 21:55:10 -0500 Subject: [PATCH 03/23] Meta: v0.8.9-pre --- README.org | 4 + org-ql.el | 2 +- org-ql.info | 249 +++++++++++++++++++++++++++------------------------- 3 files changed, 135 insertions(+), 120 deletions(-) diff --git a/README.org b/README.org index 226c951..6fda2ae 100644 --- a/README.org +++ b/README.org @@ -553,6 +553,10 @@ 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.8.9-pre + +Nothing new yet. + ** 0.8.8 *Fixes* diff --git a/org-ql.el b/org-ql.el index a0dc7e8..5149c78 100644 --- a/org-ql.el +++ b/org-ql.el @@ -4,7 +4,7 @@ ;; Author: Adam Porter ;; Url: https://github.com/alphapapa/org-ql -;; Version: 0.8.8 +;; Version: 0.8.9-pre ;; Package-Requires: ((emacs "27.1") (compat "29.1") (dash "2.18.1") (f "0.17.2") (map "2.1") (org "9.0") (org-super-agenda "1.2") (ov "1.0.6") (peg "1.0.1") (s "1.12.0") (transient "0.1") (ts "0.2-pre")) ;; Keywords: hypermedia, outlines, Org, agenda diff --git a/org-ql.info b/org-ql.info index 8a0a0fd..cfe60fc 100644 --- a/org-ql.info +++ b/org-ql.info @@ -72,6 +72,7 @@ Functions / Macros Changelog +* 0.8.9-pre: 089-pre. * 0.8.8: 088. * 0.8.7: 087. * 0.8.6: 086. @@ -1036,6 +1037,7 @@ releases. * Menu: +* 0.8.9-pre: 089-pre. * 0.8.8: 088. * 0.8.7: 087. * 0.8.6: 086. @@ -1077,9 +1079,17 @@ releases. * 0.1: 01.  -File: README.info, Node: 088, Next: 087, Up: Changelog +File: README.info, Node: 089-pre, Next: 088, Up: Changelog -5.1 0.8.8 +5.1 0.8.9-pre +============= + +Nothing new yet. + + +File: README.info, Node: 088, Next: 087, Prev: 089-pre, Up: Changelog + +5.2 0.8.8 ========= *Fixes* @@ -1101,7 +1111,7 @@ File: README.info, Node: 088, Next: 087, Up: Changelog  File: README.info, Node: 087, Next: 086, Prev: 088, Up: Changelog -5.2 0.8.7 +5.3 0.8.7 ========= *Fixes* @@ -1129,7 +1139,7 @@ File: README.info, Node: 087, Next: 086, Prev: 088, Up: Changelog  File: README.info, Node: 086, Next: 085, Prev: 087, Up: Changelog -5.3 0.8.6 +5.4 0.8.6 ========= *Fixes* @@ -1139,7 +1149,7 @@ File: README.info, Node: 086, Next: 085, Prev: 087, Up: Changelog  File: README.info, Node: 085, Next: 084, Prev: 086, Up: Changelog -5.4 0.8.5 +5.5 0.8.5 ========= *Fixes* @@ -1156,7 +1166,7 @@ File: README.info, Node: 085, Next: 084, Prev: 086, Up: Changelog  File: README.info, Node: 084, Next: 083, Prev: 085, Up: Changelog -5.5 0.8.4 +5.6 0.8.4 ========= *Fixes* @@ -1170,7 +1180,7 @@ File: README.info, Node: 084, Next: 083, Prev: 085, Up: Changelog  File: README.info, Node: 083, Next: 082, Prev: 084, Up: Changelog -5.6 0.8.3 +5.7 0.8.3 ========= *Fixes* @@ -1183,7 +1193,7 @@ File: README.info, Node: 083, Next: 082, Prev: 084, Up: Changelog  File: README.info, Node: 082, Next: 081, Prev: 083, Up: Changelog -5.7 0.8.2 +5.8 0.8.2 ========= *Fixes* @@ -1197,7 +1207,7 @@ File: README.info, Node: 082, Next: 081, Prev: 083, Up: Changelog  File: README.info, Node: 081, Next: 08, Prev: 082, Up: Changelog -5.8 0.8.1 +5.9 0.8.1 ========= *Fixes* @@ -1212,8 +1222,8 @@ File: README.info, Node: 081, Next: 08, Prev: 082, Up: Changelog  File: README.info, Node: 08, Next: 074, Prev: 081, Up: Changelog -5.9 0.8 -======= +5.10 0.8 +======== *Additions* @@ -1268,7 +1278,7 @@ File: README.info, Node: 08, Next: 074, Prev: 081, Up: Changelog  File: README.info, Node: 074, Next: 073, Prev: 08, Up: Changelog -5.10 0.7.4 +5.11 0.7.4 ========== *Fixes* @@ -1278,7 +1288,7 @@ File: README.info, Node: 074, Next: 073, Prev: 08, Up: Changelog  File: README.info, Node: 073, Next: 072, Prev: 074, Up: Changelog -5.11 0.7.3 +5.12 0.7.3 ========== *Fixes* @@ -1296,7 +1306,7 @@ File: README.info, Node: 073, Next: 072, Prev: 074, Up: Changelog  File: README.info, Node: 072, Next: 071, Prev: 073, Up: Changelog -5.12 0.7.2 +5.13 0.7.2 ========== *Fixes* @@ -1317,7 +1327,7 @@ File: README.info, Node: 072, Next: 071, Prev: 073, Up: Changelog  File: README.info, Node: 071, Next: 07, Prev: 072, Up: Changelog -5.13 0.7.1 +5.14 0.7.1 ========== *Fixes* @@ -1336,7 +1346,7 @@ File: README.info, Node: 071, Next: 07, Prev: 072, Up: Changelog  File: README.info, Node: 07, Next: 063, Prev: 071, Up: Changelog -5.14 0.7 +5.15 0.7 ======== *Added* @@ -1395,7 +1405,7 @@ File: README.info, Node: 07, Next: 063, Prev: 071, Up: Changelog  File: README.info, Node: 063, Next: 062, Prev: 07, Up: Changelog -5.15 0.6.3 +5.16 0.6.3 ========== *Fixed* @@ -1411,7 +1421,7 @@ File: README.info, Node: 063, Next: 062, Prev: 07, Up: Changelog  File: README.info, Node: 062, Next: 061, Prev: 063, Up: Changelog -5.16 0.6.2 +5.17 0.6.2 ========== *Fixed* @@ -1422,7 +1432,7 @@ File: README.info, Node: 062, Next: 061, Prev: 063, Up: Changelog  File: README.info, Node: 061, Next: 06, Prev: 062, Up: Changelog -5.17 0.6.1 +5.18 0.6.1 ========== *Fixed* @@ -1440,7 +1450,7 @@ File: README.info, Node: 061, Next: 06, Prev: 062, Up: Changelog  File: README.info, Node: 06, Next: 052, Prev: 061, Up: Changelog -5.18 0.6 +5.19 0.6 ======== *Added* @@ -1507,7 +1517,7 @@ File: README.info, Node: 06, Next: 052, Prev: 061, Up: Changelog  File: README.info, Node: 052, Next: 051, Prev: 06, Up: Changelog -5.19 0.5.2 +5.20 0.5.2 ========== *Fixed* @@ -1518,7 +1528,7 @@ File: README.info, Node: 052, Next: 051, Prev: 06, Up: Changelog  File: README.info, Node: 051, Next: 05, Prev: 052, Up: Changelog -5.20 0.5.1 +5.21 0.5.1 ========== *Fixed* @@ -1531,7 +1541,7 @@ File: README.info, Node: 051, Next: 05, Prev: 052, Up: Changelog  File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog -5.21 0.5 +5.22 0.5 ======== *Added* @@ -1572,7 +1582,7 @@ File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog  File: README.info, Node: 049, Next: 048, Prev: 05, Up: Changelog -5.22 0.4.9 +5.23 0.4.9 ========== *Fixed* @@ -1583,7 +1593,7 @@ File: README.info, Node: 049, Next: 048, Prev: 05, Up: Changelog  File: README.info, Node: 048, Next: 047, Prev: 049, Up: Changelog -5.23 0.4.8 +5.24 0.4.8 ========== *Fixed* @@ -1595,7 +1605,7 @@ File: README.info, Node: 048, Next: 047, Prev: 049, Up: Changelog  File: README.info, Node: 047, Next: 046, Prev: 048, Up: Changelog -5.24 0.4.7 +5.25 0.4.7 ========== *Fixed* @@ -1608,7 +1618,7 @@ File: README.info, Node: 047, Next: 046, Prev: 048, Up: Changelog  File: README.info, Node: 046, Next: 045, Prev: 047, Up: Changelog -5.25 0.4.6 +5.26 0.4.6 ========== *Fixed* @@ -1621,7 +1631,7 @@ File: README.info, Node: 046, Next: 045, Prev: 047, Up: Changelog  File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog -5.26 0.4.5 +5.27 0.4.5 ========== *Fixed* @@ -1633,7 +1643,7 @@ File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog  File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog -5.27 0.4.4 +5.28 0.4.4 ========== *Fixed* @@ -1645,7 +1655,7 @@ File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog  File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog -5.28 0.4.3 +5.29 0.4.3 ========== *Fixed* @@ -1655,7 +1665,7 @@ File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog  File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog -5.29 0.4.2 +5.30 0.4.2 ========== *Fixed* @@ -1664,7 +1674,7 @@ File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog  File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog -5.30 0.4.1 +5.31 0.4.1 ========== *Fixed* @@ -1674,7 +1684,7 @@ File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog  File: README.info, Node: 04, Next: 032, Prev: 041, Up: Changelog -5.31 0.4 +5.32 0.4 ======== _Note:_ The next release, 0.5, may include changes which will require @@ -1755,7 +1765,7 @@ automatically, as they will be pushed to the ‘master’ branch when ready.  File: README.info, Node: 032, Next: 031, Prev: 04, Up: Changelog -5.32 0.3.2 +5.33 0.3.2 ========== *Fixed* @@ -1768,7 +1778,7 @@ File: README.info, Node: 032, Next: 031, Prev: 04, Up: Changelog  File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog -5.33 0.3.1 +5.34 0.3.1 ========== *Fixed* @@ -1778,7 +1788,7 @@ File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog  File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog -5.34 0.3 +5.35 0.3 ======== *Added* @@ -1846,7 +1856,7 @@ File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog  File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog -5.35 0.2.3 +5.36 0.2.3 ========== *Fixed* @@ -1856,7 +1866,7 @@ File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog  File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog -5.36 0.2.2 +5.37 0.2.2 ========== *Fixed* @@ -1867,7 +1877,7 @@ File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog  File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog -5.37 0.2.1 +5.38 0.2.1 ========== *Fixed* @@ -1877,7 +1887,7 @@ File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog  File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog -5.38 0.2 +5.39 0.2 ======== *Added* @@ -1960,7 +1970,7 @@ File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog  File: README.info, Node: 01, Prev: 02, Up: Changelog -5.39 0.1 +5.40 0.1 ======== First tagged release. @@ -2018,84 +2028,85 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1963 -Node: Screenshots2086 -Node: Installation2204 -Node: Quelpa2718 -Node: Helm support3246 -Node: Usage3649 -Node: Commands4047 -Node: org-ql-find4512 -Node: org-ql-open-link5420 -Node: org-ql-refile6275 -Node: org-ql-search6603 -Node: helm-org-ql8534 -Node: org-ql-view8912 -Node: org-ql-view-sidebar9442 -Node: org-ql-view-recent-items9822 -Node: org-ql-sparse-tree10318 -Node: Queries11118 -Node: Non-sexp query syntax12235 -Node: General predicates13994 -Node: Ancestor/descendant predicates20919 -Node: Date/time predicates22047 -Node: Functions / Macros25171 -Node: Agenda-like views25469 -Ref: Function org-ql-block25631 -Node: Listing / acting-on results26892 -Ref: Caching27100 -Ref: Function org-ql-select28013 -Ref: Function org-ql-query30439 -Ref: Macro org-ql (deprecated)32213 -Node: Custom predicates32528 -Ref: Macro org-ql-defpred32752 -Node: Dynamic block36193 -Node: Links38917 -Node: Tips39604 -Node: Changelog39928 -Node: 08840856 -Node: 08741920 -Node: 08643148 -Node: 08543382 -Node: 08444038 -Node: 08344490 -Node: 08244831 -Node: 08145224 -Node: 0845645 -Node: 07448369 -Node: 07348594 -Node: 07249328 -Node: 07150249 -Node: 0751060 -Node: 06353926 -Node: 06254459 -Node: 06154766 -Node: 0655336 -Node: 05258392 -Node: 05158694 -Node: 0559119 -Node: 04960650 -Node: 04860932 -Node: 04761281 -Node: 04661690 -Node: 04562098 -Node: 04462459 -Node: 04362818 -Node: 04263021 -Node: 04163182 -Node: 0463429 -Node: 03267530 -Node: 03167933 -Node: 0368130 -Node: 02371430 -Node: 02271664 -Node: 02171944 -Node: 0272149 -Node: 0176227 -Node: Notes76328 -Node: Comparison with Org Agenda searches76490 -Node: org-sidebar77379 -Node: License77658 +Node: Contents1985 +Node: Screenshots2108 +Node: Installation2226 +Node: Quelpa2740 +Node: Helm support3268 +Node: Usage3671 +Node: Commands4069 +Node: org-ql-find4534 +Node: org-ql-open-link5442 +Node: org-ql-refile6297 +Node: org-ql-search6625 +Node: helm-org-ql8556 +Node: org-ql-view8934 +Node: org-ql-view-sidebar9464 +Node: org-ql-view-recent-items9844 +Node: org-ql-sparse-tree10340 +Node: Queries11140 +Node: Non-sexp query syntax12257 +Node: General predicates14016 +Node: Ancestor/descendant predicates20941 +Node: Date/time predicates22069 +Node: Functions / Macros25193 +Node: Agenda-like views25491 +Ref: Function org-ql-block25653 +Node: Listing / acting-on results26914 +Ref: Caching27122 +Ref: Function org-ql-select28035 +Ref: Function org-ql-query30461 +Ref: Macro org-ql (deprecated)32235 +Node: Custom predicates32550 +Ref: Macro org-ql-defpred32774 +Node: Dynamic block36215 +Node: Links38939 +Node: Tips39626 +Node: Changelog39950 +Node: 089-pre40900 +Node: 08841012 +Node: 08742092 +Node: 08643320 +Node: 08543554 +Node: 08444210 +Node: 08344662 +Node: 08245003 +Node: 08145396 +Node: 0845817 +Node: 07448543 +Node: 07348768 +Node: 07249502 +Node: 07150423 +Node: 0751234 +Node: 06354100 +Node: 06254633 +Node: 06154940 +Node: 0655510 +Node: 05258566 +Node: 05158868 +Node: 0559293 +Node: 04960824 +Node: 04861106 +Node: 04761455 +Node: 04661864 +Node: 04562272 +Node: 04462633 +Node: 04362992 +Node: 04263195 +Node: 04163356 +Node: 0463603 +Node: 03267704 +Node: 03168107 +Node: 0368304 +Node: 02371604 +Node: 02271838 +Node: 02172118 +Node: 0272323 +Node: 0176401 +Node: Notes76502 +Node: Comparison with Org Agenda searches76664 +Node: org-sidebar77553 +Node: License77832  End Tag Table From a373e812d0e6c1186bf24c05072bd853035e2e97 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 4 Sep 2024 22:00:41 -0500 Subject: [PATCH 04/23] Fix: (org-ql-view--link-follow) Reading link parameters This is needed due to changes in Emacs 30, but this code was always mistaken, and it just happened to work. See . Fixes #441. Suggested-by: Ola Nilsson --- README.org | 3 +- org-ql-view.el | 8 ++--- org-ql.info | 93 ++++++++++++++++++++++++++------------------------ 3 files changed, 55 insertions(+), 49 deletions(-) diff --git a/README.org b/README.org index 6fda2ae..3ec87f8 100644 --- a/README.org +++ b/README.org @@ -555,7 +555,8 @@ Simple links may also be written manually in either sexp or non-sexp form, like: ** 0.8.9-pre -Nothing new yet. +*Fixes* ++ Reading of view settings from Org links in upcoming Emacs version. ([[https://github.com/alphapapa/org-ql/issues/461][#461]]. Thanks to [[https://github.com/snogge][Ola Nilsson]] for help debugging, and for maintaining [[https://github.com/jorgenschaefer/emacs-buttercup][Buttercup]].) ** 0.8.8 diff --git a/org-ql-view.el b/org-ql-view.el index b5c4bb7..0978a80 100644 --- a/org-ql-view.el +++ b/org-ql-view.el @@ -622,7 +622,7 @@ purposes of compatibility with changes in Org 9.4." (query (url-unhex-string query)) (params (when params (url-parse-query-string params))) ;; `url-parse-query-string' returns "improper" alists, which makes this awkward. - (sort (when-let* ((stored-string (alist-get "sort" params nil nil #'string=)) + (sort (when-let* ((stored-string (car (alist-get "sort" params nil nil #'string=))) (read-value (read stored-string))) ;; Ensure the value is either a symbol or list of symbols (which excludes lambdas). (unless (or (symbolp read-value) (cl-every #'symbolp read-value)) @@ -630,11 +630,11 @@ purposes of compatibility with changes in Org 9.4." read-value)) read-value)) (org-super-agenda-allow-unsafe-groups nil) ; Disallow unsafe group selectors. - (groups (--when-let (alist-get "super-groups" params nil nil #'string=) + (groups (--when-let (car (alist-get "super-groups" params nil nil #'string=)) (read it))) - (title (--when-let (alist-get "title" params nil nil #'string=) + (title (--when-let (car (alist-get "title" params nil nil #'string=)) (read it))) - (buffers-files (--if-let (alist-get "buffers-files" params nil nil #'string=) + (buffers-files (--if-let (car (alist-get "buffers-files" params nil nil #'string=)) (org-ql-view--expand-buffers-files (read it)) (current-buffer)))) (unless (or (bufferp buffers-files) diff --git a/org-ql.info b/org-ql.info index cfe60fc..c0a424c 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1084,7 +1084,12 @@ File: README.info, Node: 089-pre, Next: 088, Up: Changelog 5.1 0.8.9-pre ============= -Nothing new yet. +*Fixes* + • Reading of view settings from Org links in upcoming Emacs version. + (#461 (https://github.com/alphapapa/org-ql/issues/461). Thanks to + Ola Nilsson (https://github.com/snogge) for help debugging, and for + maintaining Buttercup + (https://github.com/jorgenschaefer/emacs-buttercup).)  File: README.info, Node: 088, Next: 087, Prev: 089-pre, Up: Changelog @@ -2064,49 +2069,49 @@ Node: Links38939 Node: Tips39626 Node: Changelog39950 Node: 089-pre40900 -Node: 08841012 -Node: 08742092 -Node: 08643320 -Node: 08543554 -Node: 08444210 -Node: 08344662 -Node: 08245003 -Node: 08145396 -Node: 0845817 -Node: 07448543 -Node: 07348768 -Node: 07249502 -Node: 07150423 -Node: 0751234 -Node: 06354100 -Node: 06254633 -Node: 06154940 -Node: 0655510 -Node: 05258566 -Node: 05158868 -Node: 0559293 -Node: 04960824 -Node: 04861106 -Node: 04761455 -Node: 04661864 -Node: 04562272 -Node: 04462633 -Node: 04362992 -Node: 04263195 -Node: 04163356 -Node: 0463603 -Node: 03267704 -Node: 03168107 -Node: 0368304 -Node: 02371604 -Node: 02271838 -Node: 02172118 -Node: 0272323 -Node: 0176401 -Node: Notes76502 -Node: Comparison with Org Agenda searches76664 -Node: org-sidebar77553 -Node: License77832 +Node: 08841308 +Node: 08742388 +Node: 08643616 +Node: 08543850 +Node: 08444506 +Node: 08344958 +Node: 08245299 +Node: 08145692 +Node: 0846113 +Node: 07448839 +Node: 07349064 +Node: 07249798 +Node: 07150719 +Node: 0751530 +Node: 06354396 +Node: 06254929 +Node: 06155236 +Node: 0655806 +Node: 05258862 +Node: 05159164 +Node: 0559589 +Node: 04961120 +Node: 04861402 +Node: 04761751 +Node: 04662160 +Node: 04562568 +Node: 04462929 +Node: 04363288 +Node: 04263491 +Node: 04163652 +Node: 0463899 +Node: 03268000 +Node: 03168403 +Node: 0368600 +Node: 02371900 +Node: 02272134 +Node: 02172414 +Node: 0272619 +Node: 0176697 +Node: Notes76798 +Node: Comparison with Org Agenda searches76960 +Node: org-sidebar77849 +Node: License78128  End Tag Table From 86d338729f17f8830a7b7dd6164fd8d8765a6df3 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 4 Sep 2024 20:48:51 -0500 Subject: [PATCH 05/23] Fix: (property) Calling like (property PROPERTY :inherit t) Supporting this form isn't really required, since it violates the CL-style argument parsing of CL-DEFUN, but it's convenient, and probably saves some hair-pulling for users who are less familiar with Elisp. Fixes #460. Reported-by: Stewmath --- README.org | 1 + org-ql.el | 54 +++++++++++++++++++------- org-ql.info | 90 +++++++++++++++++++++++--------------------- tests/test-org-ql.el | 10 ++++- 4 files changed, 98 insertions(+), 57 deletions(-) diff --git a/README.org b/README.org index 3ec87f8..bb6c589 100644 --- a/README.org +++ b/README.org @@ -556,6 +556,7 @@ Simple links may also be written manually in either sexp or non-sexp form, like: ** 0.8.9-pre *Fixes* ++ Predicate ~property~ when called with argument form ~(property "PROPERTY-NAME" :inherit t)~. ([[https://github.com/alphapapa/org-ql/issues/460][#460]]. Thanks to [[https://github.com/Stewmath][Stewmath]] for reporting.) + Reading of view settings from Org links in upcoming Emacs version. ([[https://github.com/alphapapa/org-ql/issues/461][#461]]. Thanks to [[https://github.com/snogge][Ola Nilsson]] for help debugging, and for maintaining [[https://github.com/jorgenschaefer/emacs-buttercup][Buttercup]].) ** 0.8.8 diff --git a/org-ql.el b/org-ql.el index 5149c78..9ff8d71 100644 --- a/org-ql.el +++ b/org-ql.el @@ -1799,34 +1799,62 @@ interpreted as nil or non-nil)." ;; predicate test for whether an entry has local ;; properties when no arguments are given. (list 'property "")) - (`(,predicate-names ,property ,value . ,plist) + (`(,predicate-names ,property) ;; Convert keyword property arguments to strings. Non-sexp ;; queries result in keyword property arguments (because to do ;; otherwise would require ugly special-casing in the parsing). (when (keywordp property) (setf property (substring (symbol-name property) 1))) - (list 'property property value - :inherit (cond ((plist-member plist :inherit) (plist-get plist :inherit)) - ((listp org-use-property-inheritance) ''selective) - (t org-use-property-inheritance))))) + (list 'property property)) + (`(,predicate-names ,property . ,rest) + (pcase rest + (`(,value) + ;; Convert keyword property arguments to strings. Non-sexp + ;; queries result in keyword property arguments (because to do + ;; otherwise would require ugly special-casing in the parsing). + (when (keywordp property) + (setf property (substring (symbol-name property) 1))) + (list 'property property value)) + ((and `(,value . ,plist) + (guard (not (keywordp value)))) + ;; Convert keyword property arguments to strings. Non-sexp + ;; queries result in keyword property arguments (because to do + ;; otherwise would require ugly special-casing in the parsing). + (when (keywordp property) + (setf property (substring (symbol-name property) 1))) + (list 'property property value + :inherit (cond ((plist-member plist :inherit) (plist-get plist :inherit)) + ((listp org-use-property-inheritance) ''selective) + (t org-use-property-inheritance)))) + ((and plist (guard (keywordp (car rest)))) + ;; Convert keyword property arguments to strings. Non-sexp + ;; queries result in keyword property arguments (because to do + ;; otherwise would require ugly special-casing in the parsing). + (when (keywordp property) + (setf property (substring (symbol-name property) 1))) + (list 'property property nil + :inherit (cond ((plist-member plist :inherit) (plist-get plist :inherit)) + ((listp org-use-property-inheritance) ''selective) + (t org-use-property-inheritance))))))) ;; MAYBE: Should case folding be disabled for properties? What about values? ;; MAYBE: Support (property) without args. ;; NOTE: When inheritance is enabled, the preamble can't be used, ;; which will make the search slower. - :preambles ((`(,predicate-names ,property ,value . ,(map :inherit)) + :preambles (((and `(,predicate-names ,property ,value) + (guard (atom value))) ;; We do NOT return nil, because the predicate still needs to be tested, ;; because the regexp could match a string not inside a property drawer. - (list :regexp (unless inherit - (rx-to-string `(seq bol (0+ space) ":" ,property ":" - (1+ space) ,value (0+ space) eol))) + (list :regexp (rx-to-string `(seq bol (0+ space) ":" ,property ":" + (1+ space) ,value (0+ space) eol)) :query query)) - (`(,predicate-names ,property . ,(map :inherit)) - ;; We do NOT return nil, because the predicate still needs to be tested, + ((and `(,predicate-names ,property ,value . ,plist) + (guard (keywordp (car plist)))) + ;; WE do NOT return nil, because the predicate still needs to be tested, ;; because the regexp could match a string not inside a property drawer. ;; NOTE: The preamble only matches if there appears to be a value. ;; A line like ":ID: " without any other text does not match. - (list :regexp (unless inherit + (list :regexp (unless (plist-get plist :inherit) (rx-to-string `(seq bol (0+ space) ":" ,property ":" (1+ space) (minimal-match (1+ not-newline)) eol))) :query query))) @@ -1838,7 +1866,7 @@ interpreted as nil or non-nil)." ;; Check that PROPERTY exists (org-ql--value-at (point) (lambda () - (org-entry-get (point) property)))) + (org-entry-get (point) property inherit)))) (_ ;; Check that PROPERTY has VALUE. diff --git a/org-ql.info b/org-ql.info index c0a424c..c11c851 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1085,6 +1085,10 @@ File: README.info, Node: 089-pre, Next: 088, Up: Changelog ============= *Fixes* + • Predicate ‘property’ when called with argument form ‘(property + "PROPERTY-NAME" :inherit t)’. (#460 + (https://github.com/alphapapa/org-ql/issues/460). Thanks to + Stewmath (https://github.com/Stewmath) for reporting.) • Reading of view settings from Org links in upcoming Emacs version. (#461 (https://github.com/alphapapa/org-ql/issues/461). Thanks to Ola Nilsson (https://github.com/snogge) for help debugging, and for @@ -2069,49 +2073,49 @@ Node: Links38939 Node: Tips39626 Node: Changelog39950 Node: 089-pre40900 -Node: 08841308 -Node: 08742388 -Node: 08643616 -Node: 08543850 -Node: 08444506 -Node: 08344958 -Node: 08245299 -Node: 08145692 -Node: 0846113 -Node: 07448839 -Node: 07349064 -Node: 07249798 -Node: 07150719 -Node: 0751530 -Node: 06354396 -Node: 06254929 -Node: 06155236 -Node: 0655806 -Node: 05258862 -Node: 05159164 -Node: 0559589 -Node: 04961120 -Node: 04861402 -Node: 04761751 -Node: 04662160 -Node: 04562568 -Node: 04462929 -Node: 04363288 -Node: 04263491 -Node: 04163652 -Node: 0463899 -Node: 03268000 -Node: 03168403 -Node: 0368600 -Node: 02371900 -Node: 02272134 -Node: 02172414 -Node: 0272619 -Node: 0176697 -Node: Notes76798 -Node: Comparison with Org Agenda searches76960 -Node: org-sidebar77849 -Node: License78128 +Node: 08841554 +Node: 08742634 +Node: 08643862 +Node: 08544096 +Node: 08444752 +Node: 08345204 +Node: 08245545 +Node: 08145938 +Node: 0846359 +Node: 07449085 +Node: 07349310 +Node: 07250044 +Node: 07150965 +Node: 0751776 +Node: 06354642 +Node: 06255175 +Node: 06155482 +Node: 0656052 +Node: 05259108 +Node: 05159410 +Node: 0559835 +Node: 04961366 +Node: 04861648 +Node: 04761997 +Node: 04662406 +Node: 04562814 +Node: 04463175 +Node: 04363534 +Node: 04263737 +Node: 04163898 +Node: 0464145 +Node: 03268246 +Node: 03168649 +Node: 0368846 +Node: 02372146 +Node: 02272380 +Node: 02172660 +Node: 0272865 +Node: 0176943 +Node: Notes77044 +Node: Comparison with Org Agenda searches77206 +Node: org-sidebar78095 +Node: License78374  End Tag Table diff --git a/tests/test-org-ql.el b/tests/test-org-ql.el index 6717472..444cb22 100644 --- a/tests/test-org-ql.el +++ b/tests/test-org-ql.el @@ -1337,7 +1337,15 @@ with keyword arg NOW in PLIST." (org-ql-it "with a property and a value" (org-ql-expect ('(property "agenda-group" "plans")) - '("Take over the universe" "Write a symphony")))) + '("Take over the universe" "Write a symphony"))) + + (org-ql-it "with a property and \"nil :inherit t\"" + (org-ql-expect ('(property "agenda-group" nil :inherit t)) + '("Take over the universe" "Take over the world" "Skype with president of Antarctica" "Take over Mars" "Visit Mars" "Take over the moon" "Visit the moon" "Practice leaping tall buildings in a single bound" "Renew membership in supervillain club" "Learn universal sign language" "Spaceship lease" "Recurring" "/r/emacs" "Shop for groceries" "Sunrise/sunset" "Write a symphony"))) + + (org-ql-it "with a property and \":inherit t\"" + (org-ql-expect ('(property "agenda-group" :inherit t)) + '("Take over the universe" "Take over the world" "Skype with president of Antarctica" "Take over Mars" "Visit Mars" "Take over the moon" "Visit the moon" "Practice leaping tall buildings in a single bound" "Renew membership in supervillain club" "Learn universal sign language" "Spaceship lease" "Recurring" "/r/emacs" "Shop for groceries" "Sunrise/sunset" "Write a symphony")))) (describe "(regexp)" From c77bade432dc196314a7391be2a914fdad0b9ecc Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 4 Sep 2024 21:40:44 -0500 Subject: [PATCH 06/23] Tests: Fix filenames for CI (better) This is much simpler. --- tests/test-org-ql.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test-org-ql.el b/tests/test-org-ql.el index 444cb22..baf79c4 100644 --- a/tests/test-org-ql.el +++ b/tests/test-org-ql.el @@ -2011,7 +2011,7 @@ with keyword arg NOW in PLIST." (describe "View saving/loading" :var* ((temp-dir (make-temp-file "test-org-ql-" 'dir)) (temp-filenames (cl-loop for file in '("test1.org" "test2.org") - collect (expand-file-name file temp-dir))) + collect (abbreviate-file-name (expand-file-name file temp-dir)))) (file-contents (with-temp-buffer (insert "#+TITLE: Test data\n\n" "* TODO Heading 1\n" From 3e7f48ad7e000d4131b94aa3a54f555d7c98f394 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 27 Jun 2024 07:02:09 -0500 Subject: [PATCH 07/23] Meta: (test.yml) Also test on Emacs 29.1-29.4 --- .github/workflows/test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4f11ce7..2de58b4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -45,6 +45,10 @@ jobs: - 27.2 - 28.1 - 28.2 + - 29.1 + - 29.2 + - 29.3 + - 29.4 - snapshot steps: - uses: purcell/setup-emacs@master From 5ea97d22721475a920ca57532eb482b2bf545246 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 5 Sep 2024 15:49:11 -0500 Subject: [PATCH 08/23] Fix: (level) Check number argument for preamble This allows a query like this: (level <= (string-to-number (property PROPERTY))) to proceed without signaling an error from ORG-QL--QUERY-PREAMBLE. See #460. Reported-by: Stewmath --- README.org | 1 + org-ql.el | 6 ++- org-ql.info | 90 +++++++++++++++++++++++--------------------- tests/test-org-ql.el | 5 +++ 4 files changed, 57 insertions(+), 45 deletions(-) diff --git a/README.org b/README.org index bb6c589..36d8031 100644 --- a/README.org +++ b/README.org @@ -557,6 +557,7 @@ Simple links may also be written manually in either sexp or non-sexp form, like: *Fixes* + Predicate ~property~ when called with argument form ~(property "PROPERTY-NAME" :inherit t)~. ([[https://github.com/alphapapa/org-ql/issues/460][#460]]. Thanks to [[https://github.com/Stewmath][Stewmath]] for reporting.) ++ Predicate ~level~'s preamble optimizer allows expressions in place of the numeric argument. (See [[https://github.com/alphapapa/org-ql/issues/460][#460]]. Thanks to [[https://github.com/Stewmath][Stewmath]] for reporting.) + Reading of view settings from Org links in upcoming Emacs version. ([[https://github.com/alphapapa/org-ql/issues/461][#461]]. Thanks to [[https://github.com/snogge][Ola Nilsson]] for help debugging, and for maintaining [[https://github.com/jorgenschaefer/emacs-buttercup][Buttercup]].) ** 0.8.8 diff --git a/org-ql.el b/org-ql.el index 9ff8d71..40266e3 100644 --- a/org-ql.el +++ b/org-ql.el @@ -1534,7 +1534,8 @@ COMPARATOR may be `<', `<=', `>', or `>='." ;; is "h:" while the user is typing. (list :regexp (rx bol (1+ "*") " ") :case-fold t)) - (`(,predicate-names ,comparator-or-num ,num) + ((and `(,predicate-names ,comparator-or-num ,num) + (guard (numberp num))) (let ((repeat (pcase comparator-or-num ('< `(repeat 1 ,(1- num) "*")) ('<= `(repeat 1 ,num "*")) @@ -1543,7 +1544,8 @@ COMPARATOR may be `<', `<=', `>', or `>='." ((pred integerp) `(repeat ,comparator-or-num ,num "*"))))) (list :regexp (rx-to-string `(seq bol ,repeat " ") t) :case-fold t))) - (`(,predicate-names ,num) + ((and `(,predicate-names ,num) + (guard (numberp num))) (list :regexp (rx-to-string `(seq bol (repeat ,num "*") " ") t) :case-fold t))) ;; NOTE: It might be necessary to take into account `org-odd-levels'; see docstring for diff --git a/org-ql.info b/org-ql.info index c11c851..e2ab21f 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1089,6 +1089,10 @@ File: README.info, Node: 089-pre, Next: 088, Up: Changelog "PROPERTY-NAME" :inherit t)’. (#460 (https://github.com/alphapapa/org-ql/issues/460). Thanks to Stewmath (https://github.com/Stewmath) for reporting.) + • Predicate ‘level’’s preamble optimizer allows expressions in place + of the numeric argument. (See #460 + (https://github.com/alphapapa/org-ql/issues/460). Thanks to + Stewmath (https://github.com/Stewmath) for reporting.) • Reading of view settings from Org links in upcoming Emacs version. (#461 (https://github.com/alphapapa/org-ql/issues/461). Thanks to Ola Nilsson (https://github.com/snogge) for help debugging, and for @@ -2073,49 +2077,49 @@ Node: Links38939 Node: Tips39626 Node: Changelog39950 Node: 089-pre40900 -Node: 08841554 -Node: 08742634 -Node: 08643862 -Node: 08544096 -Node: 08444752 -Node: 08345204 -Node: 08245545 -Node: 08145938 -Node: 0846359 -Node: 07449085 -Node: 07349310 -Node: 07250044 -Node: 07150965 -Node: 0751776 -Node: 06354642 -Node: 06255175 -Node: 06155482 -Node: 0656052 -Node: 05259108 -Node: 05159410 -Node: 0559835 -Node: 04961366 -Node: 04861648 -Node: 04761997 -Node: 04662406 -Node: 04562814 -Node: 04463175 -Node: 04363534 -Node: 04263737 -Node: 04163898 -Node: 0464145 -Node: 03268246 -Node: 03168649 -Node: 0368846 -Node: 02372146 -Node: 02272380 -Node: 02172660 -Node: 0272865 -Node: 0176943 -Node: Notes77044 -Node: Comparison with Org Agenda searches77206 -Node: org-sidebar78095 -Node: License78374 +Node: 08841801 +Node: 08742881 +Node: 08644109 +Node: 08544343 +Node: 08444999 +Node: 08345451 +Node: 08245792 +Node: 08146185 +Node: 0846606 +Node: 07449332 +Node: 07349557 +Node: 07250291 +Node: 07151212 +Node: 0752023 +Node: 06354889 +Node: 06255422 +Node: 06155729 +Node: 0656299 +Node: 05259355 +Node: 05159657 +Node: 0560082 +Node: 04961613 +Node: 04861895 +Node: 04762244 +Node: 04662653 +Node: 04563061 +Node: 04463422 +Node: 04363781 +Node: 04263984 +Node: 04164145 +Node: 0464392 +Node: 03268493 +Node: 03168896 +Node: 0369093 +Node: 02372393 +Node: 02272627 +Node: 02172907 +Node: 0273112 +Node: 0177190 +Node: Notes77291 +Node: Comparison with Org Agenda searches77453 +Node: org-sidebar78342 +Node: License78621  End Tag Table diff --git a/tests/test-org-ql.el b/tests/test-org-ql.el index baf79c4..fab9ea9 100644 --- a/tests/test-org-ql.el +++ b/tests/test-org-ql.el @@ -636,6 +636,11 @@ with keyword arg NOW in PLIST." :to-equal (list :query t :preamble (rx bol (repeat 2 4 "*") " ") :preamble-case-fold t))) + (it "with an expression in level number's place" + (expect (org-ql--query-preamble '(level <= (string-to-number (property "PROPERTY")))) + :to-equal (list :query '(level <= (string-to-number (property "PROPERTY"))) + :preamble nil + :preamble-case-fold t))) (it "<" (expect (org-ql--query-preamble '(level < 3)) :to-equal (list :query t From e241354fd60ad203db486b5450f9c4544d91b7f3 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 27 Jun 2024 09:10:47 -0500 Subject: [PATCH 09/23] 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, and the current 30.0.50-ish snapshot build. Note: This change was originally applied on master, but it seems reasonable to apply it to this stable bugfix release now. Fixes #433. Reported-by: Akira Komamura Co-developed-by: Stefan Monnier --- README.org | 3 ++ org-ql.el | 5 ++- org-ql.info | 92 ++++++++++++++++++++++++++++------------------------- 3 files changed, 56 insertions(+), 44 deletions(-) diff --git a/README.org b/README.org index 36d8031..0887467 100644 --- a/README.org +++ b/README.org @@ -560,6 +560,9 @@ Simple links may also be written manually in either sexp or non-sexp form, like: + Predicate ~level~'s preamble optimizer allows expressions in place of the numeric argument. (See [[https://github.com/alphapapa/org-ql/issues/460][#460]]. Thanks to [[https://github.com/Stewmath][Stewmath]] for reporting.) + Reading of view settings from Org links in upcoming Emacs version. ([[https://github.com/alphapapa/org-ql/issues/461][#461]]. Thanks to [[https://github.com/snogge][Ola Nilsson]] for help debugging, and for maintaining [[https://github.com/jorgenschaefer/emacs-buttercup][Buttercup]].) +*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]].) + ** 0.8.8 *Fixes* diff --git a/org-ql.el b/org-ql.el index 40266e3..5a0538e 100644 --- a/org-ql.el +++ b/org-ql.el @@ -1118,7 +1118,10 @@ defined in `org-ql-predicates' by calling `org-ql-defpred'." ;; Only one preamble is allowed element) (pcase element - (`(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 e2ab21f..332c847 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1099,6 +1099,12 @@ File: README.info, Node: 089-pre, Next: 088, Up: Changelog maintaining Buttercup (https://github.com/jorgenschaefer/emacs-buttercup).) + *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).) +  File: README.info, Node: 088, Next: 087, Prev: 089-pre, Up: Changelog @@ -2077,49 +2083,49 @@ Node: Links38939 Node: Tips39626 Node: Changelog39950 Node: 089-pre40900 -Node: 08841801 -Node: 08742881 -Node: 08644109 -Node: 08544343 -Node: 08444999 -Node: 08345451 -Node: 08245792 -Node: 08146185 -Node: 0846606 -Node: 07449332 -Node: 07349557 -Node: 07250291 -Node: 07151212 -Node: 0752023 -Node: 06354889 -Node: 06255422 -Node: 06155729 -Node: 0656299 -Node: 05259355 -Node: 05159657 -Node: 0560082 -Node: 04961613 -Node: 04861895 -Node: 04762244 -Node: 04662653 -Node: 04563061 -Node: 04463422 -Node: 04363781 -Node: 04263984 -Node: 04164145 -Node: 0464392 -Node: 03268493 -Node: 03168896 -Node: 0369093 -Node: 02372393 -Node: 02272627 -Node: 02172907 -Node: 0273112 -Node: 0177190 -Node: Notes77291 -Node: Comparison with Org Agenda searches77453 -Node: org-sidebar78342 -Node: License78621 +Node: 08842039 +Node: 08743119 +Node: 08644347 +Node: 08544581 +Node: 08445237 +Node: 08345689 +Node: 08246030 +Node: 08146423 +Node: 0846844 +Node: 07449570 +Node: 07349795 +Node: 07250529 +Node: 07151450 +Node: 0752261 +Node: 06355127 +Node: 06255660 +Node: 06155967 +Node: 0656537 +Node: 05259593 +Node: 05159895 +Node: 0560320 +Node: 04961851 +Node: 04862133 +Node: 04762482 +Node: 04662891 +Node: 04563299 +Node: 04463660 +Node: 04364019 +Node: 04264222 +Node: 04164383 +Node: 0464630 +Node: 03268731 +Node: 03169134 +Node: 0369331 +Node: 02372631 +Node: 02272865 +Node: 02173145 +Node: 0273350 +Node: 0177428 +Node: Notes77529 +Node: Comparison with Org Agenda searches77691 +Node: org-sidebar78580 +Node: License78859  End Tag Table From 81281350d44a3903a0866431342299f5f3c74beb Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 5 Sep 2024 18:56:47 -0500 Subject: [PATCH 10/23] Release: v0.8.9 --- README.org | 2 +- org-ql.el | 2 +- org-ql.info | 170 ++++++++++++++++++++++++++-------------------------- 3 files changed, 87 insertions(+), 87 deletions(-) diff --git a/README.org b/README.org index 0887467..461bcda 100644 --- a/README.org +++ b/README.org @@ -553,7 +553,7 @@ 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.8.9-pre +** 0.8.9 *Fixes* + Predicate ~property~ when called with argument form ~(property "PROPERTY-NAME" :inherit t)~. ([[https://github.com/alphapapa/org-ql/issues/460][#460]]. Thanks to [[https://github.com/Stewmath][Stewmath]] for reporting.) diff --git a/org-ql.el b/org-ql.el index 5a0538e..efbb3f2 100644 --- a/org-ql.el +++ b/org-ql.el @@ -4,7 +4,7 @@ ;; Author: Adam Porter ;; Url: https://github.com/alphapapa/org-ql -;; Version: 0.8.9-pre +;; Version: 0.8.9 ;; Package-Requires: ((emacs "27.1") (compat "29.1") (dash "2.18.1") (f "0.17.2") (map "2.1") (org "9.0") (org-super-agenda "1.2") (ov "1.0.6") (peg "1.0.1") (s "1.12.0") (transient "0.1") (ts "0.2-pre")) ;; Keywords: hypermedia, outlines, Org, agenda diff --git a/org-ql.info b/org-ql.info index 332c847..83817aa 100644 --- a/org-ql.info +++ b/org-ql.info @@ -72,7 +72,7 @@ Functions / Macros Changelog -* 0.8.9-pre: 089-pre. +* 0.8.9: 089. * 0.8.8: 088. * 0.8.7: 087. * 0.8.6: 086. @@ -1037,7 +1037,7 @@ releases. * Menu: -* 0.8.9-pre: 089-pre. +* 0.8.9: 089. * 0.8.8: 088. * 0.8.7: 087. * 0.8.6: 086. @@ -1079,10 +1079,10 @@ releases. * 0.1: 01.  -File: README.info, Node: 089-pre, Next: 088, Up: Changelog +File: README.info, Node: 089, Next: 088, Up: Changelog -5.1 0.8.9-pre -============= +5.1 0.8.9 +========= *Fixes* • Predicate ‘property’ when called with argument form ‘(property @@ -1106,7 +1106,7 @@ File: README.info, Node: 089-pre, Next: 088, Up: Changelog (https://github.com/monnier).)  -File: README.info, Node: 088, Next: 087, Prev: 089-pre, Up: Changelog +File: README.info, Node: 088, Next: 087, Prev: 089, Up: Changelog 5.2 0.8.8 ========= @@ -2047,85 +2047,85 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1985 -Node: Screenshots2108 -Node: Installation2226 -Node: Quelpa2740 -Node: Helm support3268 -Node: Usage3671 -Node: Commands4069 -Node: org-ql-find4534 -Node: org-ql-open-link5442 -Node: org-ql-refile6297 -Node: org-ql-search6625 -Node: helm-org-ql8556 -Node: org-ql-view8934 -Node: org-ql-view-sidebar9464 -Node: org-ql-view-recent-items9844 -Node: org-ql-sparse-tree10340 -Node: Queries11140 -Node: Non-sexp query syntax12257 -Node: General predicates14016 -Node: Ancestor/descendant predicates20941 -Node: Date/time predicates22069 -Node: Functions / Macros25193 -Node: Agenda-like views25491 -Ref: Function org-ql-block25653 -Node: Listing / acting-on results26914 -Ref: Caching27122 -Ref: Function org-ql-select28035 -Ref: Function org-ql-query30461 -Ref: Macro org-ql (deprecated)32235 -Node: Custom predicates32550 -Ref: Macro org-ql-defpred32774 -Node: Dynamic block36215 -Node: Links38939 -Node: Tips39626 -Node: Changelog39950 -Node: 089-pre40900 -Node: 08842039 -Node: 08743119 -Node: 08644347 -Node: 08544581 -Node: 08445237 -Node: 08345689 -Node: 08246030 -Node: 08146423 -Node: 0846844 -Node: 07449570 -Node: 07349795 -Node: 07250529 -Node: 07151450 -Node: 0752261 -Node: 06355127 -Node: 06255660 -Node: 06155967 -Node: 0656537 -Node: 05259593 -Node: 05159895 -Node: 0560320 -Node: 04961851 -Node: 04862133 -Node: 04762482 -Node: 04662891 -Node: 04563299 -Node: 04463660 -Node: 04364019 -Node: 04264222 -Node: 04164383 -Node: 0464630 -Node: 03268731 -Node: 03169134 -Node: 0369331 -Node: 02372631 -Node: 02272865 -Node: 02173145 -Node: 0273350 -Node: 0177428 -Node: Notes77529 -Node: Comparison with Org Agenda searches77691 -Node: org-sidebar78580 -Node: License78859 +Node: Contents1977 +Node: Screenshots2100 +Node: Installation2218 +Node: Quelpa2732 +Node: Helm support3260 +Node: Usage3663 +Node: Commands4061 +Node: org-ql-find4526 +Node: org-ql-open-link5434 +Node: org-ql-refile6289 +Node: org-ql-search6617 +Node: helm-org-ql8548 +Node: org-ql-view8926 +Node: org-ql-view-sidebar9456 +Node: org-ql-view-recent-items9836 +Node: org-ql-sparse-tree10332 +Node: Queries11132 +Node: Non-sexp query syntax12249 +Node: General predicates14008 +Node: Ancestor/descendant predicates20933 +Node: Date/time predicates22061 +Node: Functions / Macros25185 +Node: Agenda-like views25483 +Ref: Function org-ql-block25645 +Node: Listing / acting-on results26906 +Ref: Caching27114 +Ref: Function org-ql-select28027 +Ref: Function org-ql-query30453 +Ref: Macro org-ql (deprecated)32227 +Node: Custom predicates32542 +Ref: Macro org-ql-defpred32766 +Node: Dynamic block36207 +Node: Links38931 +Node: Tips39618 +Node: Changelog39942 +Node: 08940884 +Node: 08842011 +Node: 08743087 +Node: 08644315 +Node: 08544549 +Node: 08445205 +Node: 08345657 +Node: 08245998 +Node: 08146391 +Node: 0846812 +Node: 07449538 +Node: 07349763 +Node: 07250497 +Node: 07151418 +Node: 0752229 +Node: 06355095 +Node: 06255628 +Node: 06155935 +Node: 0656505 +Node: 05259561 +Node: 05159863 +Node: 0560288 +Node: 04961819 +Node: 04862101 +Node: 04762450 +Node: 04662859 +Node: 04563267 +Node: 04463628 +Node: 04363987 +Node: 04264190 +Node: 04164351 +Node: 0464598 +Node: 03268699 +Node: 03169102 +Node: 0369299 +Node: 02372599 +Node: 02272833 +Node: 02173113 +Node: 0273318 +Node: 0177396 +Node: Notes77497 +Node: Comparison with Org Agenda searches77659 +Node: org-sidebar78548 +Node: License78827  End Tag Table From 1c8c89f26407e5fc874f5ef0141768737e7897f1 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Tue, 10 Sep 2024 22:11:10 -0500 Subject: [PATCH 11/23] Add: (defface org-ql-view-title) Use in -view--header-line-format Note that we also add a safety check in ORG-QL-VIEW--LINK-FOLLOW, because the addition of a call to PROPERTIZE in ORG-QL-VIEW--HEADER-LINE-FORMAT effectively removes what was functioning as a safety check there (as CONCAT had been signaling an error for the unsafe argument, whereas PROPERTIZE, which is called to apply the new face, does not). We also change the expected error in the tests accordingly. --- README.org | 3 ++ org-ql-view.el | 9 +++- org-ql.info | 99 +++++++++++++++++++++++--------------------- tests/test-org-ql.el | 6 +-- 4 files changed, 65 insertions(+), 52 deletions(-) diff --git a/README.org b/README.org index 77cee93..404460e 100644 --- a/README.org +++ b/README.org @@ -556,6 +556,9 @@ Simple links may also be written manually in either sexp or non-sexp form, like: ** 0.9-pre +*Additions* ++ Face ~org-ql-view-title~, applied to view titles in header line. + *Changes* + Command ~org-ql-find~ respects narrowing of the current buffer by default, allowing searching within the narrowed region. (Using one ~C-u~ argument widens the current buffer, and using two ~C-u~ arguments prompts for the buffers to search.) + Function ~org-ql-completing-read~ accepts a new ~NARROWP~ argument, which is passed to ~org-ql-select~. diff --git a/org-ql-view.el b/org-ql-view.el index 1377e40..77089d5 100644 --- a/org-ql-view.el +++ b/org-ql-view.el @@ -59,6 +59,10 @@ "Face for due dates in `org-ql-view' views." :group 'org-ql) +(defface org-ql-view-title '((t :weight bold)) + "View title in header line." + :group 'org-ql-view) + ;;;; Variables (defvar org-ql-view-buffer-name-prefix "*Org QL View:" @@ -459,7 +463,8 @@ subsequent refreshing of the buffer: `org-ql-view-buffers-files', If TITLE, prepend it to the header." (let* ((title (if title (concat (propertize "View:" 'face 'transient-argument) - title " ") + (propertize title 'face 'org-ql-view-title) + " ") "")) (query-formatted (when query (org-ql-view--format-query query))) @@ -645,6 +650,8 @@ purposes of compatibility with changes in Org 9.4." (stringp buffers-files) (cl-every #'stringp buffers-files)) (error "CAUTION: Link not opened because unsafe buffers-files parameter detected: %s" buffers-files)) + (unless (or (stringp title) (null title)) + (error "CAUTION: Link not opened because unsafe title parameter detected: %S" title)) (when (or (listp query) (string-match (rx bol (0+ space) "(") query)) ;; SAFETY: Query is in sexp form: ask for confirmation, because it could contain arbitrary code. diff --git a/org-ql.info b/org-ql.info index 77e33ef..4225785 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1095,7 +1095,10 @@ File: README.info, Node: 09-pre, Next: 089, Up: Changelog 5.1 0.9-pre =========== -*Changes* +*Additions* + • Face ‘org-ql-view-title’, applied to view titles in header line. + + *Changes* • Command ‘org-ql-find’ respects narrowing of the current buffer by default, allowing searching within the narrowed region. (Using one ‘C-u’ argument widens the current buffer, and using two ‘C-u’ @@ -2147,53 +2150,53 @@ Node: Links39051 Node: Tips39738 Node: Changelog40062 Node: 09-pre41029 -Node: helm-org-ql (1)41575 -Node: 08941716 -Node: 08842858 -Node: 08743934 -Node: 08645162 -Node: 08545396 -Node: 08446052 -Node: 08346504 -Node: 08246845 -Node: 08147238 -Node: 0847661 -Node: 07450387 -Node: 07350612 -Node: 07251346 -Node: 07152267 -Node: 0753078 -Node: 06355944 -Node: 06256477 -Node: 06156784 -Node: 0657354 -Node: 05260410 -Node: 05160712 -Node: 0561137 -Node: 04962668 -Node: 04862950 -Node: 04763299 -Node: 04663708 -Node: 04564116 -Node: 04464477 -Node: 04364836 -Node: 04265039 -Node: 04165200 -Node: 0465447 -Node: 03269548 -Node: 03169951 -Node: 0370148 -Node: 02373448 -Node: 02273682 -Node: 02173962 -Node: 0274167 -Node: 0178245 -Node: Development78346 -Node: Copyright assignment78579 -Node: Notes79169 -Node: Comparison with Org Agenda searches79333 -Node: org-sidebar80222 -Node: License80501 +Node: helm-org-ql (1)41667 +Node: 08941808 +Node: 08842950 +Node: 08744026 +Node: 08645254 +Node: 08545488 +Node: 08446144 +Node: 08346596 +Node: 08246937 +Node: 08147330 +Node: 0847753 +Node: 07450479 +Node: 07350704 +Node: 07251438 +Node: 07152359 +Node: 0753170 +Node: 06356036 +Node: 06256569 +Node: 06156876 +Node: 0657446 +Node: 05260502 +Node: 05160804 +Node: 0561229 +Node: 04962760 +Node: 04863042 +Node: 04763391 +Node: 04663800 +Node: 04564208 +Node: 04464569 +Node: 04364928 +Node: 04265131 +Node: 04165292 +Node: 0465539 +Node: 03269640 +Node: 03170043 +Node: 0370240 +Node: 02373540 +Node: 02273774 +Node: 02174054 +Node: 0274259 +Node: 0178337 +Node: Development78438 +Node: Copyright assignment78671 +Node: Notes79261 +Node: Comparison with Org Agenda searches79425 +Node: org-sidebar80314 +Node: License80593  End Tag Table diff --git a/tests/test-org-ql.el b/tests/test-org-ql.el index 22d173b..923ec66 100644 --- a/tests/test-org-ql.el +++ b/tests/test-org-ql.el @@ -1986,13 +1986,13 @@ with keyword arg NOW in PLIST." (expression-link "[[org-ql-search:todo:?title%3D%28error%20%22UNSAFE%22%29]]")) (it "Errors for a quoted lambda" (expect (open-link quoted-lambda-link) - :to-throw 'wrong-type-argument '(characterp lambda))) + :to-throw 'error '("CAUTION: Link not opened because unsafe title parameter detected: (lambda (_ _) (error \"UNSAFE\"))"))) (it "Errors for an unquoted lambda" (expect (open-link unquoted-lambda-link) - :to-throw 'wrong-type-argument '(characterp lambda))) + :to-throw 'error '("CAUTION: Link not opened because unsafe title parameter detected: (lambda (_ _) (error \"UNSAFE\"))"))) (it "Errors for an expression" (expect (open-link expression-link) - :to-throw 'wrong-type-argument '(characterp error)))) + :to-throw 'error '("CAUTION: Link not opened because unsafe title parameter detected: (error \"UNSAFE\")")))) (describe "sort parameter" :var ((quoted-lambda-link "[[org-ql-search:todo:?sort%3D%28lambda%20%28_%20_%29%20%28error%20%22UNSAFE%22%29%29]]") From a3c0205a68a573fd4b67f208c0121b911b6d11ff Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Tue, 10 Sep 2024 22:38:19 -0500 Subject: [PATCH 12/23] Fix: (defface org-ql-view-due-date) Customization group --- README.org | 3 ++ org-ql-view.el | 2 +- org-ql.info | 97 ++++++++++++++++++++++++++------------------------ 3 files changed, 54 insertions(+), 48 deletions(-) diff --git a/README.org b/README.org index 404460e..34b5c3f 100644 --- a/README.org +++ b/README.org @@ -563,6 +563,9 @@ Simple links may also be written manually in either sexp or non-sexp form, like: + Command ~org-ql-find~ respects narrowing of the current buffer by default, allowing searching within the narrowed region. (Using one ~C-u~ argument widens the current buffer, and using two ~C-u~ arguments prompts for the buffers to search.) + Function ~org-ql-completing-read~ accepts a new ~NARROWP~ argument, which is passed to ~org-ql-select~. +*Fixes* ++ Customization group for face ~org-ql-view-due-date~. + *** helm-org-ql Tagged v0.6.2, fixing a compilation warning. diff --git a/org-ql-view.el b/org-ql-view.el index 77089d5..b0ec311 100644 --- a/org-ql-view.el +++ b/org-ql-view.el @@ -57,7 +57,7 @@ (defface org-ql-view-due-date '((t (:slant italic :weight bold))) "Face for due dates in `org-ql-view' views." - :group 'org-ql) + :group 'org-ql-view) (defface org-ql-view-title '((t :weight bold)) "View title in header line." diff --git a/org-ql.info b/org-ql.info index 4225785..df1dc2f 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1106,6 +1106,9 @@ File: README.info, Node: 09-pre, Next: 089, Up: Changelog • Function ‘org-ql-completing-read’ accepts a new ‘NARROWP’ argument, which is passed to ‘org-ql-select’. + *Fixes* + • Customization group for face ‘org-ql-view-due-date’. + * Menu: * helm-org-ql: helm-org-ql (1). @@ -2150,53 +2153,53 @@ Node: Links39051 Node: Tips39738 Node: Changelog40062 Node: 09-pre41029 -Node: helm-org-ql (1)41667 -Node: 08941808 -Node: 08842950 -Node: 08744026 -Node: 08645254 -Node: 08545488 -Node: 08446144 -Node: 08346596 -Node: 08246937 -Node: 08147330 -Node: 0847753 -Node: 07450479 -Node: 07350704 -Node: 07251438 -Node: 07152359 -Node: 0753170 -Node: 06356036 -Node: 06256569 -Node: 06156876 -Node: 0657446 -Node: 05260502 -Node: 05160804 -Node: 0561229 -Node: 04962760 -Node: 04863042 -Node: 04763391 -Node: 04663800 -Node: 04564208 -Node: 04464569 -Node: 04364928 -Node: 04265131 -Node: 04165292 -Node: 0465539 -Node: 03269640 -Node: 03170043 -Node: 0370240 -Node: 02373540 -Node: 02273774 -Node: 02174054 -Node: 0274259 -Node: 0178337 -Node: Development78438 -Node: Copyright assignment78671 -Node: Notes79261 -Node: Comparison with Org Agenda searches79425 -Node: org-sidebar80314 -Node: License80593 +Node: helm-org-ql (1)41743 +Node: 08941884 +Node: 08843026 +Node: 08744102 +Node: 08645330 +Node: 08545564 +Node: 08446220 +Node: 08346672 +Node: 08247013 +Node: 08147406 +Node: 0847829 +Node: 07450555 +Node: 07350780 +Node: 07251514 +Node: 07152435 +Node: 0753246 +Node: 06356112 +Node: 06256645 +Node: 06156952 +Node: 0657522 +Node: 05260578 +Node: 05160880 +Node: 0561305 +Node: 04962836 +Node: 04863118 +Node: 04763467 +Node: 04663876 +Node: 04564284 +Node: 04464645 +Node: 04365004 +Node: 04265207 +Node: 04165368 +Node: 0465615 +Node: 03269716 +Node: 03170119 +Node: 0370316 +Node: 02373616 +Node: 02273850 +Node: 02174130 +Node: 0274335 +Node: 0178413 +Node: Development78514 +Node: Copyright assignment78747 +Node: Notes79337 +Node: Comparison with Org Agenda searches79501 +Node: org-sidebar80390 +Node: License80669  End Tag Table From 82f762e31c37aa5775cbfabf3f7e8756fd481e9a Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 11 Sep 2024 01:01:30 -0500 Subject: [PATCH 13/23] Add: (org-ql-view-relative-deadline-prefix) --- README.org | 1 + org-ql-view.el | 10 +++++- org-ql.info | 95 +++++++++++++++++++++++++------------------------- 3 files changed, 58 insertions(+), 48 deletions(-) diff --git a/README.org b/README.org index 34b5c3f..99fb8fb 100644 --- a/README.org +++ b/README.org @@ -558,6 +558,7 @@ Simple links may also be written manually in either sexp or non-sexp form, like: *Additions* + Face ~org-ql-view-title~, applied to view titles in header line. ++ Option ~org-ql-view-relative-deadline-prefix~. *Changes* + Command ~org-ql-find~ respects narrowing of the current buffer by default, allowing searching within the narrowed region. (Using one ~C-u~ argument widens the current buffer, and using two ~C-u~ arguments prompts for the buffers to search.) diff --git a/org-ql-view.el b/org-ql-view.el index b0ec311..90d0521 100644 --- a/org-ql-view.el +++ b/org-ql-view.el @@ -242,6 +242,12 @@ See info node `(elisp)Cyclic Window Ordering'." (sexp :tag "org-super-agenda grouping expression") (variable :tag "Variable holding org-super-agenda grouping expression")))))))) +(defcustom org-ql-view-relative-deadline-prefix "due " + ;; TODO(v0.9): Add one for scheduled, too. + "Prefix for relative deadlines. +Relative deadlines are, e.g. \"in 5d\", \"5d ago\"." + :type 'string) + ;;;; Commands ;;;###autoload @@ -1021,7 +1027,9 @@ property." (deadline-day-number (org-time-string-to-absolute (org-element-timestamp-interpreter deadline-date 'ignore))) (difference-days (- today-day-number deadline-day-number)) - (relative-due-date (org-add-props (org-ql-view--format-relative-date difference-days) nil + (relative-due-date (org-add-props + (concat org-ql-view-relative-deadline-prefix + (org-ql-view--format-relative-date difference-days)) nil 'help-echo (org-element-property :raw-value deadline-date))) ;; FIXME: Unused for now: (todo-keyword (org-element-property :todo-keyword element)) ;; FIXME: Unused for now: (done-p (member todo-keyword org-done-keywords)) diff --git a/org-ql.info b/org-ql.info index df1dc2f..9fc615c 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1097,6 +1097,7 @@ File: README.info, Node: 09-pre, Next: 089, Up: Changelog *Additions* • Face ‘org-ql-view-title’, applied to view titles in header line. + • Option ‘org-ql-view-relative-deadline-prefix’. *Changes* • Command ‘org-ql-find’ respects narrowing of the current buffer by @@ -2153,53 +2154,53 @@ Node: Links39051 Node: Tips39738 Node: Changelog40062 Node: 09-pre41029 -Node: helm-org-ql (1)41743 -Node: 08941884 -Node: 08843026 -Node: 08744102 -Node: 08645330 -Node: 08545564 -Node: 08446220 -Node: 08346672 -Node: 08247013 -Node: 08147406 -Node: 0847829 -Node: 07450555 -Node: 07350780 -Node: 07251514 -Node: 07152435 -Node: 0753246 -Node: 06356112 -Node: 06256645 -Node: 06156952 -Node: 0657522 -Node: 05260578 -Node: 05160880 -Node: 0561305 -Node: 04962836 -Node: 04863118 -Node: 04763467 -Node: 04663876 -Node: 04564284 -Node: 04464645 -Node: 04365004 -Node: 04265207 -Node: 04165368 -Node: 0465615 -Node: 03269716 -Node: 03170119 -Node: 0370316 -Node: 02373616 -Node: 02273850 -Node: 02174130 -Node: 0274335 -Node: 0178413 -Node: Development78514 -Node: Copyright assignment78747 -Node: Notes79337 -Node: Comparison with Org Agenda searches79501 -Node: org-sidebar80390 -Node: License80669 +Node: helm-org-ql (1)41801 +Node: 08941942 +Node: 08843084 +Node: 08744160 +Node: 08645388 +Node: 08545622 +Node: 08446278 +Node: 08346730 +Node: 08247071 +Node: 08147464 +Node: 0847887 +Node: 07450613 +Node: 07350838 +Node: 07251572 +Node: 07152493 +Node: 0753304 +Node: 06356170 +Node: 06256703 +Node: 06157010 +Node: 0657580 +Node: 05260636 +Node: 05160938 +Node: 0561363 +Node: 04962894 +Node: 04863176 +Node: 04763525 +Node: 04663934 +Node: 04564342 +Node: 04464703 +Node: 04365062 +Node: 04265265 +Node: 04165426 +Node: 0465673 +Node: 03269774 +Node: 03170177 +Node: 0370374 +Node: 02373674 +Node: 02273908 +Node: 02174188 +Node: 0274393 +Node: 0178471 +Node: Development78572 +Node: Copyright assignment78805 +Node: Notes79395 +Node: Comparison with Org Agenda searches79559 +Node: org-sidebar80448 +Node: License80727  End Tag Table From d574b6055103f81780ff9c52d411a44f87f1dcfa Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 11 Sep 2024 01:50:16 -0500 Subject: [PATCH 14/23] Add: (defface org-ql-view-query) --- README.org | 1 + org-ql-view.el | 8 +++++ org-ql.info | 95 +++++++++++++++++++++++++------------------------- 3 files changed, 57 insertions(+), 47 deletions(-) diff --git a/README.org b/README.org index 99fb8fb..943b159 100644 --- a/README.org +++ b/README.org @@ -557,6 +557,7 @@ Simple links may also be written manually in either sexp or non-sexp form, like: ** 0.9-pre *Additions* ++ Face ~org-ql-view-query~, applied to view queries in header line. + Face ~org-ql-view-title~, applied to view titles in header line. + Option ~org-ql-view-relative-deadline-prefix~. diff --git a/org-ql-view.el b/org-ql-view.el index 90d0521..1165bef 100644 --- a/org-ql-view.el +++ b/org-ql-view.el @@ -59,6 +59,13 @@ "Face for due dates in `org-ql-view' views." :group 'org-ql-view) +(defface org-ql-view-query nil + "View query in header line. +This face is added to the formatted query after font-lock faces +are applied to it. It may be used, e.g. to reduce the height so +more of it is visible." + :group 'org-ql-view) + (defface org-ql-view-title '((t :weight bold)) "View title in header line." :group 'org-ql-view) @@ -489,6 +496,7 @@ If TITLE, prepend it to the header." (org-ql-view--font-lock-string 'emacs-lisp-mode) (s-truncate available-width)) 'help-echo buffers-files-formatted)))) + (add-face-text-property 0 (length query-propertized) 'org-ql-view-query 'append query-propertized) (concat title (when query (propertize "Query:" 'face 'transient-argument)) (when query query-propertized) diff --git a/org-ql.info b/org-ql.info index 9fc615c..d5c5a07 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1096,6 +1096,7 @@ File: README.info, Node: 09-pre, Next: 089, Up: Changelog =========== *Additions* + • Face ‘org-ql-view-query’, applied to view queries in header line. • Face ‘org-ql-view-title’, applied to view titles in header line. • Option ‘org-ql-view-relative-deadline-prefix’. @@ -2154,53 +2155,53 @@ Node: Links39051 Node: Tips39738 Node: Changelog40062 Node: 09-pre41029 -Node: helm-org-ql (1)41801 -Node: 08941942 -Node: 08843084 -Node: 08744160 -Node: 08645388 -Node: 08545622 -Node: 08446278 -Node: 08346730 -Node: 08247071 -Node: 08147464 -Node: 0847887 -Node: 07450613 -Node: 07350838 -Node: 07251572 -Node: 07152493 -Node: 0753304 -Node: 06356170 -Node: 06256703 -Node: 06157010 -Node: 0657580 -Node: 05260636 -Node: 05160938 -Node: 0561363 -Node: 04962894 -Node: 04863176 -Node: 04763525 -Node: 04663934 -Node: 04564342 -Node: 04464703 -Node: 04365062 -Node: 04265265 -Node: 04165426 -Node: 0465673 -Node: 03269774 -Node: 03170177 -Node: 0370374 -Node: 02373674 -Node: 02273908 -Node: 02174188 -Node: 0274393 -Node: 0178471 -Node: Development78572 -Node: Copyright assignment78805 -Node: Notes79395 -Node: Comparison with Org Agenda searches79559 -Node: org-sidebar80448 -Node: License80727 +Node: helm-org-ql (1)41878 +Node: 08942019 +Node: 08843161 +Node: 08744237 +Node: 08645465 +Node: 08545699 +Node: 08446355 +Node: 08346807 +Node: 08247148 +Node: 08147541 +Node: 0847964 +Node: 07450690 +Node: 07350915 +Node: 07251649 +Node: 07152570 +Node: 0753381 +Node: 06356247 +Node: 06256780 +Node: 06157087 +Node: 0657657 +Node: 05260713 +Node: 05161015 +Node: 0561440 +Node: 04962971 +Node: 04863253 +Node: 04763602 +Node: 04664011 +Node: 04564419 +Node: 04464780 +Node: 04365139 +Node: 04265342 +Node: 04165503 +Node: 0465750 +Node: 03269851 +Node: 03170254 +Node: 0370451 +Node: 02373751 +Node: 02273985 +Node: 02174265 +Node: 0274470 +Node: 0178548 +Node: Development78649 +Node: Copyright assignment78882 +Node: Notes79472 +Node: Comparison with Org Agenda searches79636 +Node: org-sidebar80525 +Node: License80804  End Tag Table From fff110acded7f7746b086079204fb37c005d7763 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Mon, 16 Sep 2024 13:42:17 -0500 Subject: [PATCH 15/23] Fix: (org-ql-refile) Use base buffer Should probably release this in a v0.8.10. See #466. --- README.org | 1 + org-ql-find.el | 26 +++++++------- org-ql.info | 96 ++++++++++++++++++++++++++------------------------ 3 files changed, 64 insertions(+), 59 deletions(-) diff --git a/README.org b/README.org index 943b159..4610596 100644 --- a/README.org +++ b/README.org @@ -567,6 +567,7 @@ Simple links may also be written manually in either sexp or non-sexp form, like: *Fixes* + Customization group for face ~org-ql-view-due-date~. ++ Command ~org-ql-refile~ uses the base buffer when refiling to an indirect buffer. *** helm-org-ql diff --git a/org-ql-find.el b/org-ql-find.el index ed6d21d..e6c4795 100644 --- a/org-ql-find.el +++ b/org-ql-find.el @@ -122,18 +122,20 @@ which see (but only the files are used)." ((and (pred listp) files) files))) (list files-spec))))))) (list (org-ql-completing-read buffers-files :prompt "Refile to: ")))) - (org-refile nil nil - ;; The RFLOC argument: - (list - ;; Name - (org-with-point-at marker - (nth 4 (org-heading-components))) - ;; File - (buffer-file-name (marker-buffer marker)) - ;; nil - nil - ;; Position - marker))) + (let ((buffer (or (buffer-base-buffer (marker-buffer marker)) + (marker-buffer marker)))) + (org-refile nil nil + ;; The RFLOC argument: + (list + ;; Name + (org-with-point-at marker + (nth 4 (org-heading-components))) + ;; File + (buffer-file-name buffer) + ;; nil + nil + ;; Position + marker)))) ;;;###autoload (defun org-ql-find-in-agenda () diff --git a/org-ql.info b/org-ql.info index d5c5a07..d0b34a2 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1110,6 +1110,8 @@ File: README.info, Node: 09-pre, Next: 089, Up: Changelog *Fixes* • Customization group for face ‘org-ql-view-due-date’. + • Command ‘org-ql-refile’ uses the base buffer when refiling to an + indirect buffer. * Menu: @@ -2155,53 +2157,53 @@ Node: Links39051 Node: Tips39738 Node: Changelog40062 Node: 09-pre41029 -Node: helm-org-ql (1)41878 -Node: 08942019 -Node: 08843161 -Node: 08744237 -Node: 08645465 -Node: 08545699 -Node: 08446355 -Node: 08346807 -Node: 08247148 -Node: 08147541 -Node: 0847964 -Node: 07450690 -Node: 07350915 -Node: 07251649 -Node: 07152570 -Node: 0753381 -Node: 06356247 -Node: 06256780 -Node: 06157087 -Node: 0657657 -Node: 05260713 -Node: 05161015 -Node: 0561440 -Node: 04962971 -Node: 04863253 -Node: 04763602 -Node: 04664011 -Node: 04564419 -Node: 04464780 -Node: 04365139 -Node: 04265342 -Node: 04165503 -Node: 0465750 -Node: 03269851 -Node: 03170254 -Node: 0370451 -Node: 02373751 -Node: 02273985 -Node: 02174265 -Node: 0274470 -Node: 0178548 -Node: Development78649 -Node: Copyright assignment78882 -Node: Notes79472 -Node: Comparison with Org Agenda searches79636 -Node: org-sidebar80525 -Node: License80804 +Node: helm-org-ql (1)41976 +Node: 08942117 +Node: 08843259 +Node: 08744335 +Node: 08645563 +Node: 08545797 +Node: 08446453 +Node: 08346905 +Node: 08247246 +Node: 08147639 +Node: 0848062 +Node: 07450788 +Node: 07351013 +Node: 07251747 +Node: 07152668 +Node: 0753479 +Node: 06356345 +Node: 06256878 +Node: 06157185 +Node: 0657755 +Node: 05260811 +Node: 05161113 +Node: 0561538 +Node: 04963069 +Node: 04863351 +Node: 04763700 +Node: 04664109 +Node: 04564517 +Node: 04464878 +Node: 04365237 +Node: 04265440 +Node: 04165601 +Node: 0465848 +Node: 03269949 +Node: 03170352 +Node: 0370549 +Node: 02373849 +Node: 02274083 +Node: 02174363 +Node: 0274568 +Node: 0178646 +Node: Development78747 +Node: Copyright assignment78980 +Node: Notes79570 +Node: Comparison with Org Agenda searches79734 +Node: org-sidebar80623 +Node: License80902  End Tag Table From b6f8a315e966123fbfd1ac240d35da5c2b48d6ac Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Mon, 16 Sep 2024 18:25:02 -0500 Subject: [PATCH 16/23] Fix: (org-ql-view--format-element) Font-lock Org syntax Not sure why I overlooked this for so long (links already worked, which is probably why). --- README.org | 1 + org-ql-view.el | 21 +++++++++++ org-ql.info | 95 +++++++++++++++++++++++++------------------------- 3 files changed, 70 insertions(+), 47 deletions(-) diff --git a/README.org b/README.org index 4610596..0f20c2c 100644 --- a/README.org +++ b/README.org @@ -568,6 +568,7 @@ Simple links may also be written manually in either sexp or non-sexp form, like: *Fixes* + Customization group for face ~org-ql-view-due-date~. + Command ~org-ql-refile~ uses the base buffer when refiling to an indirect buffer. ++ Apply Org syntax font-locking to items in ~org-ql-view~ buffers. *** helm-org-ql diff --git a/org-ql-view.el b/org-ql-view.el index 1165bef..8d65582 100644 --- a/org-ql-view.el +++ b/org-ql-view.el @@ -528,6 +528,22 @@ with human-readable strings." (font-lock-ensure) (buffer-string)))) +(defun org-ql-view--font-lock-as-org (s) + "Return string S font-locked as in `org-mode'." + ;; This works like `org-fontify-like-in-org-mode', but uses a single + ;; buffer instead of a new one every time. + ;; TODO(C): Submit these improvements upstream. + (let ((buffer (or (get-buffer " *org-ql-view--font-lock-as-org*") + (with-current-buffer (get-buffer-create " *org-ql-view--font-lock-as-org*") + (buffer-disable-undo) + (org-mode) + (current-buffer))))) + (with-current-buffer buffer + (insert s) + (font-lock-ensure) + (prog1 (buffer-string) + (erase-buffer))))) + (defun org-ql-view--buffer (&optional name) "Return `org-ql-view' buffer, creating it if necessary. If NAME is non-nil, return buffer by that name instead of using @@ -898,6 +914,11 @@ return an empty string." ;; (which would also make it easier to do it independently of faces, etc). (title (--> (org-ql-view--add-faces element) (org-element-property :raw-value it))) + ;; TODO(B): Needs refactoring. A function like `org-ql-view--add-faces' + ;; should return a list of faces to be added. + (title-faces (get-text-property 0 'face title)) + (title (org-ql-view--font-lock-as-org title)) + (_ (add-face-text-property 0 (length title) title-faces t title)) (todo-keyword (-some--> (org-element-property :todo-keyword element) (org-ql-view--add-todo-face (substring-no-properties it)))) diff --git a/org-ql.info b/org-ql.info index d0b34a2..ea2444f 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1112,6 +1112,7 @@ File: README.info, Node: 09-pre, Next: 089, Up: Changelog • Customization group for face ‘org-ql-view-due-date’. • Command ‘org-ql-refile’ uses the base buffer when refiling to an indirect buffer. + • Apply Org syntax font-locking to items in ‘org-ql-view’ buffers. * Menu: @@ -2157,53 +2158,53 @@ Node: Links39051 Node: Tips39738 Node: Changelog40062 Node: 09-pre41029 -Node: helm-org-ql (1)41976 -Node: 08942117 -Node: 08843259 -Node: 08744335 -Node: 08645563 -Node: 08545797 -Node: 08446453 -Node: 08346905 -Node: 08247246 -Node: 08147639 -Node: 0848062 -Node: 07450788 -Node: 07351013 -Node: 07251747 -Node: 07152668 -Node: 0753479 -Node: 06356345 -Node: 06256878 -Node: 06157185 -Node: 0657755 -Node: 05260811 -Node: 05161113 -Node: 0561538 -Node: 04963069 -Node: 04863351 -Node: 04763700 -Node: 04664109 -Node: 04564517 -Node: 04464878 -Node: 04365237 -Node: 04265440 -Node: 04165601 -Node: 0465848 -Node: 03269949 -Node: 03170352 -Node: 0370549 -Node: 02373849 -Node: 02274083 -Node: 02174363 -Node: 0274568 -Node: 0178646 -Node: Development78747 -Node: Copyright assignment78980 -Node: Notes79570 -Node: Comparison with Org Agenda searches79734 -Node: org-sidebar80623 -Node: License80902 +Node: helm-org-ql (1)42052 +Node: 08942193 +Node: 08843335 +Node: 08744411 +Node: 08645639 +Node: 08545873 +Node: 08446529 +Node: 08346981 +Node: 08247322 +Node: 08147715 +Node: 0848138 +Node: 07450864 +Node: 07351089 +Node: 07251823 +Node: 07152744 +Node: 0753555 +Node: 06356421 +Node: 06256954 +Node: 06157261 +Node: 0657831 +Node: 05260887 +Node: 05161189 +Node: 0561614 +Node: 04963145 +Node: 04863427 +Node: 04763776 +Node: 04664185 +Node: 04564593 +Node: 04464954 +Node: 04365313 +Node: 04265516 +Node: 04165677 +Node: 0465924 +Node: 03270025 +Node: 03170428 +Node: 0370625 +Node: 02373925 +Node: 02274159 +Node: 02174439 +Node: 0274644 +Node: 0178722 +Node: Development78823 +Node: Copyright assignment79056 +Node: Notes79646 +Node: Comparison with Org Agenda searches79810 +Node: org-sidebar80699 +Node: License80978  End Tag Table From 3cfc77d2ff62e39de182ceaef1913ce2d38db299 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 6 Nov 2024 21:18:37 -0600 Subject: [PATCH 17/23] Meta: v0.8.10-pre --- README.org | 4 + org-ql.el | 2 +- org-ql.info | 253 +++++++++++++++++++++++++++------------------------- 3 files changed, 137 insertions(+), 122 deletions(-) diff --git a/README.org b/README.org index 461bcda..a0f3334 100644 --- a/README.org +++ b/README.org @@ -553,6 +553,10 @@ 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.8.10-pre + +Nothing new yet. + ** 0.8.9 *Fixes* diff --git a/org-ql.el b/org-ql.el index efbb3f2..3353a58 100644 --- a/org-ql.el +++ b/org-ql.el @@ -4,7 +4,7 @@ ;; Author: Adam Porter ;; Url: https://github.com/alphapapa/org-ql -;; Version: 0.8.9 +;; Version: 0.8.10-pre ;; Package-Requires: ((emacs "27.1") (compat "29.1") (dash "2.18.1") (f "0.17.2") (map "2.1") (org "9.0") (org-super-agenda "1.2") (ov "1.0.6") (peg "1.0.1") (s "1.12.0") (transient "0.1") (ts "0.2-pre")) ;; Keywords: hypermedia, outlines, Org, agenda diff --git a/org-ql.info b/org-ql.info index 83817aa..20971d4 100644 --- a/org-ql.info +++ b/org-ql.info @@ -72,6 +72,7 @@ Functions / Macros Changelog +* 0.8.10-pre: 0810-pre. * 0.8.9: 089. * 0.8.8: 088. * 0.8.7: 087. @@ -1037,6 +1038,7 @@ releases. * Menu: +* 0.8.10-pre: 0810-pre. * 0.8.9: 089. * 0.8.8: 088. * 0.8.7: 087. @@ -1079,9 +1081,17 @@ releases. * 0.1: 01.  -File: README.info, Node: 089, Next: 088, Up: Changelog +File: README.info, Node: 0810-pre, Next: 089, Up: Changelog -5.1 0.8.9 +5.1 0.8.10-pre +============== + +Nothing new yet. + + +File: README.info, Node: 089, Next: 088, Prev: 0810-pre, Up: Changelog + +5.2 0.8.9 ========= *Fixes* @@ -1108,7 +1118,7 @@ File: README.info, Node: 089, Next: 088, Up: Changelog  File: README.info, Node: 088, Next: 087, Prev: 089, Up: Changelog -5.2 0.8.8 +5.3 0.8.8 ========= *Fixes* @@ -1130,7 +1140,7 @@ File: README.info, Node: 088, Next: 087, Prev: 089, Up: Changelog  File: README.info, Node: 087, Next: 086, Prev: 088, Up: Changelog -5.3 0.8.7 +5.4 0.8.7 ========= *Fixes* @@ -1158,7 +1168,7 @@ File: README.info, Node: 087, Next: 086, Prev: 088, Up: Changelog  File: README.info, Node: 086, Next: 085, Prev: 087, Up: Changelog -5.4 0.8.6 +5.5 0.8.6 ========= *Fixes* @@ -1168,7 +1178,7 @@ File: README.info, Node: 086, Next: 085, Prev: 087, Up: Changelog  File: README.info, Node: 085, Next: 084, Prev: 086, Up: Changelog -5.5 0.8.5 +5.6 0.8.5 ========= *Fixes* @@ -1185,7 +1195,7 @@ File: README.info, Node: 085, Next: 084, Prev: 086, Up: Changelog  File: README.info, Node: 084, Next: 083, Prev: 085, Up: Changelog -5.6 0.8.4 +5.7 0.8.4 ========= *Fixes* @@ -1199,7 +1209,7 @@ File: README.info, Node: 084, Next: 083, Prev: 085, Up: Changelog  File: README.info, Node: 083, Next: 082, Prev: 084, Up: Changelog -5.7 0.8.3 +5.8 0.8.3 ========= *Fixes* @@ -1212,7 +1222,7 @@ File: README.info, Node: 083, Next: 082, Prev: 084, Up: Changelog  File: README.info, Node: 082, Next: 081, Prev: 083, Up: Changelog -5.8 0.8.2 +5.9 0.8.2 ========= *Fixes* @@ -1226,8 +1236,8 @@ File: README.info, Node: 082, Next: 081, Prev: 083, Up: Changelog  File: README.info, Node: 081, Next: 08, Prev: 082, Up: Changelog -5.9 0.8.1 -========= +5.10 0.8.1 +========== *Fixes* @@ -1241,7 +1251,7 @@ File: README.info, Node: 081, Next: 08, Prev: 082, Up: Changelog  File: README.info, Node: 08, Next: 074, Prev: 081, Up: Changelog -5.10 0.8 +5.11 0.8 ======== *Additions* @@ -1297,7 +1307,7 @@ File: README.info, Node: 08, Next: 074, Prev: 081, Up: Changelog  File: README.info, Node: 074, Next: 073, Prev: 08, Up: Changelog -5.11 0.7.4 +5.12 0.7.4 ========== *Fixes* @@ -1307,7 +1317,7 @@ File: README.info, Node: 074, Next: 073, Prev: 08, Up: Changelog  File: README.info, Node: 073, Next: 072, Prev: 074, Up: Changelog -5.12 0.7.3 +5.13 0.7.3 ========== *Fixes* @@ -1325,7 +1335,7 @@ File: README.info, Node: 073, Next: 072, Prev: 074, Up: Changelog  File: README.info, Node: 072, Next: 071, Prev: 073, Up: Changelog -5.13 0.7.2 +5.14 0.7.2 ========== *Fixes* @@ -1346,7 +1356,7 @@ File: README.info, Node: 072, Next: 071, Prev: 073, Up: Changelog  File: README.info, Node: 071, Next: 07, Prev: 072, Up: Changelog -5.14 0.7.1 +5.15 0.7.1 ========== *Fixes* @@ -1365,7 +1375,7 @@ File: README.info, Node: 071, Next: 07, Prev: 072, Up: Changelog  File: README.info, Node: 07, Next: 063, Prev: 071, Up: Changelog -5.15 0.7 +5.16 0.7 ======== *Added* @@ -1424,7 +1434,7 @@ File: README.info, Node: 07, Next: 063, Prev: 071, Up: Changelog  File: README.info, Node: 063, Next: 062, Prev: 07, Up: Changelog -5.16 0.6.3 +5.17 0.6.3 ========== *Fixed* @@ -1440,7 +1450,7 @@ File: README.info, Node: 063, Next: 062, Prev: 07, Up: Changelog  File: README.info, Node: 062, Next: 061, Prev: 063, Up: Changelog -5.17 0.6.2 +5.18 0.6.2 ========== *Fixed* @@ -1451,7 +1461,7 @@ File: README.info, Node: 062, Next: 061, Prev: 063, Up: Changelog  File: README.info, Node: 061, Next: 06, Prev: 062, Up: Changelog -5.18 0.6.1 +5.19 0.6.1 ========== *Fixed* @@ -1469,7 +1479,7 @@ File: README.info, Node: 061, Next: 06, Prev: 062, Up: Changelog  File: README.info, Node: 06, Next: 052, Prev: 061, Up: Changelog -5.19 0.6 +5.20 0.6 ======== *Added* @@ -1536,7 +1546,7 @@ File: README.info, Node: 06, Next: 052, Prev: 061, Up: Changelog  File: README.info, Node: 052, Next: 051, Prev: 06, Up: Changelog -5.20 0.5.2 +5.21 0.5.2 ========== *Fixed* @@ -1547,7 +1557,7 @@ File: README.info, Node: 052, Next: 051, Prev: 06, Up: Changelog  File: README.info, Node: 051, Next: 05, Prev: 052, Up: Changelog -5.21 0.5.1 +5.22 0.5.1 ========== *Fixed* @@ -1560,7 +1570,7 @@ File: README.info, Node: 051, Next: 05, Prev: 052, Up: Changelog  File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog -5.22 0.5 +5.23 0.5 ======== *Added* @@ -1601,7 +1611,7 @@ File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog  File: README.info, Node: 049, Next: 048, Prev: 05, Up: Changelog -5.23 0.4.9 +5.24 0.4.9 ========== *Fixed* @@ -1612,7 +1622,7 @@ File: README.info, Node: 049, Next: 048, Prev: 05, Up: Changelog  File: README.info, Node: 048, Next: 047, Prev: 049, Up: Changelog -5.24 0.4.8 +5.25 0.4.8 ========== *Fixed* @@ -1624,7 +1634,7 @@ File: README.info, Node: 048, Next: 047, Prev: 049, Up: Changelog  File: README.info, Node: 047, Next: 046, Prev: 048, Up: Changelog -5.25 0.4.7 +5.26 0.4.7 ========== *Fixed* @@ -1637,7 +1647,7 @@ File: README.info, Node: 047, Next: 046, Prev: 048, Up: Changelog  File: README.info, Node: 046, Next: 045, Prev: 047, Up: Changelog -5.26 0.4.6 +5.27 0.4.6 ========== *Fixed* @@ -1650,7 +1660,7 @@ File: README.info, Node: 046, Next: 045, Prev: 047, Up: Changelog  File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog -5.27 0.4.5 +5.28 0.4.5 ========== *Fixed* @@ -1662,7 +1672,7 @@ File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog  File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog -5.28 0.4.4 +5.29 0.4.4 ========== *Fixed* @@ -1674,7 +1684,7 @@ File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog  File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog -5.29 0.4.3 +5.30 0.4.3 ========== *Fixed* @@ -1684,7 +1694,7 @@ File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog  File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog -5.30 0.4.2 +5.31 0.4.2 ========== *Fixed* @@ -1693,7 +1703,7 @@ File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog  File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog -5.31 0.4.1 +5.32 0.4.1 ========== *Fixed* @@ -1703,7 +1713,7 @@ File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog  File: README.info, Node: 04, Next: 032, Prev: 041, Up: Changelog -5.32 0.4 +5.33 0.4 ======== _Note:_ The next release, 0.5, may include changes which will require @@ -1784,7 +1794,7 @@ automatically, as they will be pushed to the ‘master’ branch when ready.  File: README.info, Node: 032, Next: 031, Prev: 04, Up: Changelog -5.33 0.3.2 +5.34 0.3.2 ========== *Fixed* @@ -1797,7 +1807,7 @@ File: README.info, Node: 032, Next: 031, Prev: 04, Up: Changelog  File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog -5.34 0.3.1 +5.35 0.3.1 ========== *Fixed* @@ -1807,7 +1817,7 @@ File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog  File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog -5.35 0.3 +5.36 0.3 ======== *Added* @@ -1875,7 +1885,7 @@ File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog  File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog -5.36 0.2.3 +5.37 0.2.3 ========== *Fixed* @@ -1885,7 +1895,7 @@ File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog  File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog -5.37 0.2.2 +5.38 0.2.2 ========== *Fixed* @@ -1896,7 +1906,7 @@ File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog  File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog -5.38 0.2.1 +5.39 0.2.1 ========== *Fixed* @@ -1906,7 +1916,7 @@ File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog  File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog -5.39 0.2 +5.40 0.2 ======== *Added* @@ -1989,7 +1999,7 @@ File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog  File: README.info, Node: 01, Prev: 02, Up: Changelog -5.40 0.1 +5.41 0.1 ======== First tagged release. @@ -2047,85 +2057,86 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1977 -Node: Screenshots2100 -Node: Installation2218 -Node: Quelpa2732 -Node: Helm support3260 -Node: Usage3663 -Node: Commands4061 -Node: org-ql-find4526 -Node: org-ql-open-link5434 -Node: org-ql-refile6289 -Node: org-ql-search6617 -Node: helm-org-ql8548 -Node: org-ql-view8926 -Node: org-ql-view-sidebar9456 -Node: org-ql-view-recent-items9836 -Node: org-ql-sparse-tree10332 -Node: Queries11132 -Node: Non-sexp query syntax12249 -Node: General predicates14008 -Node: Ancestor/descendant predicates20933 -Node: Date/time predicates22061 -Node: Functions / Macros25185 -Node: Agenda-like views25483 -Ref: Function org-ql-block25645 -Node: Listing / acting-on results26906 -Ref: Caching27114 -Ref: Function org-ql-select28027 -Ref: Function org-ql-query30453 -Ref: Macro org-ql (deprecated)32227 -Node: Custom predicates32542 -Ref: Macro org-ql-defpred32766 -Node: Dynamic block36207 -Node: Links38931 -Node: Tips39618 -Node: Changelog39942 -Node: 08940884 -Node: 08842011 -Node: 08743087 -Node: 08644315 -Node: 08544549 -Node: 08445205 -Node: 08345657 -Node: 08245998 -Node: 08146391 -Node: 0846812 -Node: 07449538 -Node: 07349763 -Node: 07250497 -Node: 07151418 -Node: 0752229 -Node: 06355095 -Node: 06255628 -Node: 06155935 -Node: 0656505 -Node: 05259561 -Node: 05159863 -Node: 0560288 -Node: 04961819 -Node: 04862101 -Node: 04762450 -Node: 04662859 -Node: 04563267 -Node: 04463628 -Node: 04363987 -Node: 04264190 -Node: 04164351 -Node: 0464598 -Node: 03268699 -Node: 03169102 -Node: 0369299 -Node: 02372599 -Node: 02272833 -Node: 02173113 -Node: 0273318 -Node: 0177396 -Node: Notes77497 -Node: Comparison with Org Agenda searches77659 -Node: org-sidebar78548 -Node: License78827 +Node: Contents2001 +Node: Screenshots2124 +Node: Installation2242 +Node: Quelpa2756 +Node: Helm support3284 +Node: Usage3687 +Node: Commands4085 +Node: org-ql-find4550 +Node: org-ql-open-link5458 +Node: org-ql-refile6313 +Node: org-ql-search6641 +Node: helm-org-ql8572 +Node: org-ql-view8950 +Node: org-ql-view-sidebar9480 +Node: org-ql-view-recent-items9860 +Node: org-ql-sparse-tree10356 +Node: Queries11156 +Node: Non-sexp query syntax12273 +Node: General predicates14032 +Node: Ancestor/descendant predicates20957 +Node: Date/time predicates22085 +Node: Functions / Macros25209 +Node: Agenda-like views25507 +Ref: Function org-ql-block25669 +Node: Listing / acting-on results26930 +Ref: Caching27138 +Ref: Function org-ql-select28051 +Ref: Function org-ql-query30477 +Ref: Macro org-ql (deprecated)32251 +Node: Custom predicates32566 +Ref: Macro org-ql-defpred32790 +Node: Dynamic block36231 +Node: Links38955 +Node: Tips39642 +Node: Changelog39966 +Node: 0810-pre40932 +Node: 08941047 +Node: 08842191 +Node: 08743267 +Node: 08644495 +Node: 08544729 +Node: 08445385 +Node: 08345837 +Node: 08246178 +Node: 08146571 +Node: 0846994 +Node: 07449720 +Node: 07349945 +Node: 07250679 +Node: 07151600 +Node: 0752411 +Node: 06355277 +Node: 06255810 +Node: 06156117 +Node: 0656687 +Node: 05259743 +Node: 05160045 +Node: 0560470 +Node: 04962001 +Node: 04862283 +Node: 04762632 +Node: 04663041 +Node: 04563449 +Node: 04463810 +Node: 04364169 +Node: 04264372 +Node: 04164533 +Node: 0464780 +Node: 03268881 +Node: 03169284 +Node: 0369481 +Node: 02372781 +Node: 02273015 +Node: 02173295 +Node: 0273500 +Node: 0177578 +Node: Notes77679 +Node: Comparison with Org Agenda searches77841 +Node: org-sidebar78730 +Node: License79009  End Tag Table From 0e68cc9facba048d16f4cfdba0b269b7db66fe4b Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 6 Nov 2024 21:20:30 -0600 Subject: [PATCH 18/23] Fix: (link) Don't match against null groups e.g. in a source block containing Bash shell code like: [[ -z $data ]] The matched groups could be null, since it's not actually an Org link, so calling STRING-MATCH-P on them would signal an error. Reported-by: John Wiegley --- README.org | 3 +- org-ql.el | 14 +++++--- org-ql.info | 94 ++++++++++++++++++++++++++++------------------------- 3 files changed, 60 insertions(+), 51 deletions(-) diff --git a/README.org b/README.org index a0f3334..6d68ee7 100644 --- a/README.org +++ b/README.org @@ -555,7 +555,8 @@ Simple links may also be written manually in either sexp or non-sexp form, like: ** 0.8.10-pre -Nothing new yet. +*Fixes* ++ Predicate ~link~ could signal an error when searching text that is mistakenly recognized as an Org link (e.g. Bash double-bracket constructs in a source block). (Thanks to [[https://github.com/jwiegley][John Wiegley]] for reporting.) ** 0.8.9 diff --git a/org-ql.el b/org-ql.el index 3353a58..5858899 100644 --- a/org-ql.el +++ b/org-ql.el @@ -1626,11 +1626,15 @@ any link is found." (or (null description) (string-match-p description (match-string org-ql-link-description-group))))) (_ (if (and description target) - (and (string-match-p target (match-string 1)) - (string-match-p description (match-string org-ql-link-description-group))) - (or (string-match-p description-or-target (match-string 1)) - (string-match-p description-or-target - (match-string org-ql-link-description-group))))))))) + (and (and (match-string 1) + (string-match-p target (match-string 1))) + (and (match-string org-ql-link-description-group) + (string-match-p description (match-string org-ql-link-description-group)))) + (or (and (match-string 1) + (string-match-p description-or-target (match-string 1))) + (and (match-string org-ql-link-description-group) + (string-match-p description-or-target + (match-string org-ql-link-description-group)))))))))) (org-ql-defpred (rifle smart) (&rest strings) "Return non-nil if each of strings is found in the entry or its outline path. diff --git a/org-ql.info b/org-ql.info index 20971d4..028fc00 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1086,7 +1086,11 @@ File: README.info, Node: 0810-pre, Next: 089, Up: Changelog 5.1 0.8.10-pre ============== -Nothing new yet. +*Fixes* + • Predicate ‘link’ could signal an error when searching text that is + mistakenly recognized as an Org link (e.g. Bash double-bracket + constructs in a source block). (Thanks to John Wiegley + (https://github.com/jwiegley) for reporting.)  File: README.info, Node: 089, Next: 088, Prev: 0810-pre, Up: Changelog @@ -2093,50 +2097,50 @@ Node: Links38955 Node: Tips39642 Node: Changelog39966 Node: 0810-pre40932 -Node: 08941047 -Node: 08842191 -Node: 08743267 -Node: 08644495 -Node: 08544729 -Node: 08445385 -Node: 08345837 -Node: 08246178 -Node: 08146571 -Node: 0846994 -Node: 07449720 -Node: 07349945 -Node: 07250679 -Node: 07151600 -Node: 0752411 -Node: 06355277 -Node: 06255810 -Node: 06156117 -Node: 0656687 -Node: 05259743 -Node: 05160045 -Node: 0560470 -Node: 04962001 -Node: 04862283 -Node: 04762632 -Node: 04663041 -Node: 04563449 -Node: 04463810 -Node: 04364169 -Node: 04264372 -Node: 04164533 -Node: 0464780 -Node: 03268881 -Node: 03169284 -Node: 0369481 -Node: 02372781 -Node: 02273015 -Node: 02173295 -Node: 0273500 -Node: 0177578 -Node: Notes77679 -Node: Comparison with Org Agenda searches77841 -Node: org-sidebar78730 -Node: License79009 +Node: 08941297 +Node: 08842441 +Node: 08743517 +Node: 08644745 +Node: 08544979 +Node: 08445635 +Node: 08346087 +Node: 08246428 +Node: 08146821 +Node: 0847244 +Node: 07449970 +Node: 07350195 +Node: 07250929 +Node: 07151850 +Node: 0752661 +Node: 06355527 +Node: 06256060 +Node: 06156367 +Node: 0656937 +Node: 05259993 +Node: 05160295 +Node: 0560720 +Node: 04962251 +Node: 04862533 +Node: 04762882 +Node: 04663291 +Node: 04563699 +Node: 04464060 +Node: 04364419 +Node: 04264622 +Node: 04164783 +Node: 0465030 +Node: 03269131 +Node: 03169534 +Node: 0369731 +Node: 02373031 +Node: 02273265 +Node: 02173545 +Node: 0273750 +Node: 0177828 +Node: Notes77929 +Node: Comparison with Org Agenda searches78091 +Node: org-sidebar78980 +Node: License79259  End Tag Table From c95bb8a3efbd634c0a1826e6618f8f39020958b5 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Mon, 16 Sep 2024 13:42:17 -0500 Subject: [PATCH 19/23] Fix: (org-ql-refile) Use base buffer See #466. --- README.org | 1 + org-ql-find.el | 26 ++++++++------- org-ql.info | 91 ++++++++++++++++++++++++++------------------------ 3 files changed, 62 insertions(+), 56 deletions(-) diff --git a/README.org b/README.org index 6d68ee7..30720ac 100644 --- a/README.org +++ b/README.org @@ -556,6 +556,7 @@ Simple links may also be written manually in either sexp or non-sexp form, like: ** 0.8.10-pre *Fixes* ++ Command ~org-ql-refile~ uses the base buffer when refiling to an indirect buffer. ([[https://github.com/alphapapa/org-ql/issues/466][#466]].) + Predicate ~link~ could signal an error when searching text that is mistakenly recognized as an Org link (e.g. Bash double-bracket constructs in a source block). (Thanks to [[https://github.com/jwiegley][John Wiegley]] for reporting.) ** 0.8.9 diff --git a/org-ql-find.el b/org-ql-find.el index f6f2b9c..b1a9137 100644 --- a/org-ql-find.el +++ b/org-ql-find.el @@ -110,18 +110,20 @@ which see (but only the files are used)." ((and (pred listp) files) files))) (list files-spec))))))) (list (org-ql-completing-read buffers-files :prompt "Refile to: ")))) - (org-refile nil nil - ;; The RFLOC argument: - (list - ;; Name - (org-with-point-at marker - (nth 4 (org-heading-components))) - ;; File - (buffer-file-name (marker-buffer marker)) - ;; nil - nil - ;; Position - marker))) + (let ((buffer (or (buffer-base-buffer (marker-buffer marker)) + (marker-buffer marker)))) + (org-refile nil nil + ;; The RFLOC argument: + (list + ;; Name + (org-with-point-at marker + (nth 4 (org-heading-components))) + ;; File + (buffer-file-name buffer) + ;; nil + nil + ;; Position + marker)))) ;;;###autoload (defun org-ql-find-in-agenda () diff --git a/org-ql.info b/org-ql.info index 028fc00..2703fc7 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1087,6 +1087,9 @@ File: README.info, Node: 0810-pre, Next: 089, Up: Changelog ============== *Fixes* + • Command ‘org-ql-refile’ uses the base buffer when refiling to an + indirect buffer. (#466 + (https://github.com/alphapapa/org-ql/issues/466).) • Predicate ‘link’ could signal an error when searching text that is mistakenly recognized as an Org link (e.g. Bash double-bracket constructs in a source block). (Thanks to John Wiegley @@ -2097,50 +2100,50 @@ Node: Links38955 Node: Tips39642 Node: Changelog39966 Node: 0810-pre40932 -Node: 08941297 -Node: 08842441 -Node: 08743517 -Node: 08644745 -Node: 08544979 -Node: 08445635 -Node: 08346087 -Node: 08246428 -Node: 08146821 -Node: 0847244 -Node: 07449970 -Node: 07350195 -Node: 07250929 -Node: 07151850 -Node: 0752661 -Node: 06355527 -Node: 06256060 -Node: 06156367 -Node: 0656937 -Node: 05259993 -Node: 05160295 -Node: 0560720 -Node: 04962251 -Node: 04862533 -Node: 04762882 -Node: 04663291 -Node: 04563699 -Node: 04464060 -Node: 04364419 -Node: 04264622 -Node: 04164783 -Node: 0465030 -Node: 03269131 -Node: 03169534 -Node: 0369731 -Node: 02373031 -Node: 02273265 -Node: 02173545 -Node: 0273750 -Node: 0177828 -Node: Notes77929 -Node: Comparison with Org Agenda searches78091 -Node: org-sidebar78980 -Node: License79259 +Node: 08941458 +Node: 08842602 +Node: 08743678 +Node: 08644906 +Node: 08545140 +Node: 08445796 +Node: 08346248 +Node: 08246589 +Node: 08146982 +Node: 0847405 +Node: 07450131 +Node: 07350356 +Node: 07251090 +Node: 07152011 +Node: 0752822 +Node: 06355688 +Node: 06256221 +Node: 06156528 +Node: 0657098 +Node: 05260154 +Node: 05160456 +Node: 0560881 +Node: 04962412 +Node: 04862694 +Node: 04763043 +Node: 04663452 +Node: 04563860 +Node: 04464221 +Node: 04364580 +Node: 04264783 +Node: 04164944 +Node: 0465191 +Node: 03269292 +Node: 03169695 +Node: 0369892 +Node: 02373192 +Node: 02273426 +Node: 02173706 +Node: 0273911 +Node: 0177989 +Node: Notes78090 +Node: Comparison with Org Agenda searches78252 +Node: org-sidebar79141 +Node: License79420  End Tag Table From 9c53c1bddfcbda3475ffd8810f012be6de07d963 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 6 Nov 2024 21:43:13 -0600 Subject: [PATCH 20/23] Release: v0.8.10 --- README.org | 2 +- org-ql.el | 2 +- org-ql.info | 172 ++++++++++++++++++++++++++-------------------------- 3 files changed, 88 insertions(+), 88 deletions(-) diff --git a/README.org b/README.org index 30720ac..a9ba6f6 100644 --- a/README.org +++ b/README.org @@ -553,7 +553,7 @@ 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.8.10-pre +** 0.8.10 *Fixes* + Command ~org-ql-refile~ uses the base buffer when refiling to an indirect buffer. ([[https://github.com/alphapapa/org-ql/issues/466][#466]].) diff --git a/org-ql.el b/org-ql.el index 5858899..78ae0a1 100644 --- a/org-ql.el +++ b/org-ql.el @@ -4,7 +4,7 @@ ;; Author: Adam Porter ;; Url: https://github.com/alphapapa/org-ql -;; Version: 0.8.10-pre +;; Version: 0.8.10 ;; Package-Requires: ((emacs "27.1") (compat "29.1") (dash "2.18.1") (f "0.17.2") (map "2.1") (org "9.0") (org-super-agenda "1.2") (ov "1.0.6") (peg "1.0.1") (s "1.12.0") (transient "0.1") (ts "0.2-pre")) ;; Keywords: hypermedia, outlines, Org, agenda diff --git a/org-ql.info b/org-ql.info index 2703fc7..eb66655 100644 --- a/org-ql.info +++ b/org-ql.info @@ -72,7 +72,7 @@ Functions / Macros Changelog -* 0.8.10-pre: 0810-pre. +* 0.8.10: 0810. * 0.8.9: 089. * 0.8.8: 088. * 0.8.7: 087. @@ -1038,7 +1038,7 @@ releases. * Menu: -* 0.8.10-pre: 0810-pre. +* 0.8.10: 0810. * 0.8.9: 089. * 0.8.8: 088. * 0.8.7: 087. @@ -1081,10 +1081,10 @@ releases. * 0.1: 01.  -File: README.info, Node: 0810-pre, Next: 089, Up: Changelog +File: README.info, Node: 0810, Next: 089, Up: Changelog -5.1 0.8.10-pre -============== +5.1 0.8.10 +========== *Fixes* • Command ‘org-ql-refile’ uses the base buffer when refiling to an @@ -1096,7 +1096,7 @@ File: README.info, Node: 0810-pre, Next: 089, Up: Changelog (https://github.com/jwiegley) for reporting.)  -File: README.info, Node: 089, Next: 088, Prev: 0810-pre, Up: Changelog +File: README.info, Node: 089, Next: 088, Prev: 0810, Up: Changelog 5.2 0.8.9 ========= @@ -2064,86 +2064,86 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents2001 -Node: Screenshots2124 -Node: Installation2242 -Node: Quelpa2756 -Node: Helm support3284 -Node: Usage3687 -Node: Commands4085 -Node: org-ql-find4550 -Node: org-ql-open-link5458 -Node: org-ql-refile6313 -Node: org-ql-search6641 -Node: helm-org-ql8572 -Node: org-ql-view8950 -Node: org-ql-view-sidebar9480 -Node: org-ql-view-recent-items9860 -Node: org-ql-sparse-tree10356 -Node: Queries11156 -Node: Non-sexp query syntax12273 -Node: General predicates14032 -Node: Ancestor/descendant predicates20957 -Node: Date/time predicates22085 -Node: Functions / Macros25209 -Node: Agenda-like views25507 -Ref: Function org-ql-block25669 -Node: Listing / acting-on results26930 -Ref: Caching27138 -Ref: Function org-ql-select28051 -Ref: Function org-ql-query30477 -Ref: Macro org-ql (deprecated)32251 -Node: Custom predicates32566 -Ref: Macro org-ql-defpred32790 -Node: Dynamic block36231 -Node: Links38955 -Node: Tips39642 -Node: Changelog39966 -Node: 0810-pre40932 -Node: 08941458 -Node: 08842602 -Node: 08743678 -Node: 08644906 -Node: 08545140 -Node: 08445796 -Node: 08346248 -Node: 08246589 -Node: 08146982 -Node: 0847405 -Node: 07450131 -Node: 07350356 -Node: 07251090 -Node: 07152011 -Node: 0752822 -Node: 06355688 -Node: 06256221 -Node: 06156528 -Node: 0657098 -Node: 05260154 -Node: 05160456 -Node: 0560881 -Node: 04962412 -Node: 04862694 -Node: 04763043 -Node: 04663452 -Node: 04563860 -Node: 04464221 -Node: 04364580 -Node: 04264783 -Node: 04164944 -Node: 0465191 -Node: 03269292 -Node: 03169695 -Node: 0369892 -Node: 02373192 -Node: 02273426 -Node: 02173706 -Node: 0273911 -Node: 0177989 -Node: Notes78090 -Node: Comparison with Org Agenda searches78252 -Node: org-sidebar79141 -Node: License79420 +Node: Contents1993 +Node: Screenshots2116 +Node: Installation2234 +Node: Quelpa2748 +Node: Helm support3276 +Node: Usage3679 +Node: Commands4077 +Node: org-ql-find4542 +Node: org-ql-open-link5450 +Node: org-ql-refile6305 +Node: org-ql-search6633 +Node: helm-org-ql8564 +Node: org-ql-view8942 +Node: org-ql-view-sidebar9472 +Node: org-ql-view-recent-items9852 +Node: org-ql-sparse-tree10348 +Node: Queries11148 +Node: Non-sexp query syntax12265 +Node: General predicates14024 +Node: Ancestor/descendant predicates20949 +Node: Date/time predicates22077 +Node: Functions / Macros25201 +Node: Agenda-like views25499 +Ref: Function org-ql-block25661 +Node: Listing / acting-on results26922 +Ref: Caching27130 +Ref: Function org-ql-select28043 +Ref: Function org-ql-query30469 +Ref: Macro org-ql (deprecated)32243 +Node: Custom predicates32558 +Ref: Macro org-ql-defpred32782 +Node: Dynamic block36223 +Node: Links38947 +Node: Tips39634 +Node: Changelog39958 +Node: 081040916 +Node: 08941430 +Node: 08842570 +Node: 08743646 +Node: 08644874 +Node: 08545108 +Node: 08445764 +Node: 08346216 +Node: 08246557 +Node: 08146950 +Node: 0847373 +Node: 07450099 +Node: 07350324 +Node: 07251058 +Node: 07151979 +Node: 0752790 +Node: 06355656 +Node: 06256189 +Node: 06156496 +Node: 0657066 +Node: 05260122 +Node: 05160424 +Node: 0560849 +Node: 04962380 +Node: 04862662 +Node: 04763011 +Node: 04663420 +Node: 04563828 +Node: 04464189 +Node: 04364548 +Node: 04264751 +Node: 04164912 +Node: 0465159 +Node: 03269260 +Node: 03169663 +Node: 0369860 +Node: 02373160 +Node: 02273394 +Node: 02173674 +Node: 0273879 +Node: 0177957 +Node: Notes78058 +Node: Comparison with Org Agenda searches78220 +Node: org-sidebar79109 +Node: License79388  End Tag Table From 98c62ab0a6c084ae4132110e24d9fe1ace91d363 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Mon, 25 Nov 2024 17:49:54 -0600 Subject: [PATCH 21/23] Docs: Fix some predicate arguments Reported-by: Trevoke --- README.org | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.org b/README.org index 93139ab..457dedd 100644 --- a/README.org +++ b/README.org @@ -233,7 +233,7 @@ Note that the =effort=, =level=, and =priority= predicates do not support compar Arguments are listed next to predicate names, where applicable. + =blocked= :: Return non-nil if current heading is blocked. Calls ~org-entry-blocked-p~, which see. -+ =category (&optional categories)= :: Return non-nil if current heading is in one or more of ~CATEGORIES~ (a list of strings). ++ =category (&rest categories)= :: Return non-nil if current heading is in one or more of ~CATEGORIES~ (a list of strings). + =done= :: Return non-nil if entry's ~TODO~ keyword is in ~org-done-keywords~. + =effort (&optional effort-or-comparator effort)= :: Return non-nil if current heading's effort property matches arguments. The following forms are accepted: ~(effort DURATION)~: Matches if effort is ~DURATION~. ~(effort DURATION DURATION)~: Matches if effort is between DURATIONs, inclusive. ~(effort COMPARATOR DURATION)~: Matches if effort compares to ~DURATION~ with ~COMPARATOR~. ~COMPARATOR~ may be ~<~, ~<=~, ~>~, or ~>=~. ~DURATION~ should be an Org effort string, like =5= or =0:05=. + =habit= :: Return non-nil if entry is a habit. @@ -256,16 +256,16 @@ Arguments are listed next to predicate names, where applicable. - Aliases: ~smart~. - *Note:* By default, this is the default predicate used for plain-string query tokens (i.e. given without a specified predicate). This can be customized with the option ~org-ql-default-predicate~. + ~src (&key lang regexps)~ :: Return non-nil if current entry contains an Org Babel source block. If ~LANG~ is non-nil, match blocks of that language. If ~REGEXPS~ is non-nil, require that block's contents match all regexps. Matching is done case-insensitively. -+ =tags (&optional tags)= :: Return non-nil if current heading has one or more of ~TAGS~ (a list of strings). Tests both inherited and local tags. -+ =tags-inherited (&optional 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. ++ =tags (&rest tags)= :: Return non-nil if current heading has one or more of ~TAGS~ (a list of strings). Tests both inherited and local tags. ++ =tags-inherited (&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. - Aliases: ~inherited-tags~, ~tags-i~, ~itags~. -+ =tags-local (&optional 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. ++ =tags-local (&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. - Aliases: ~local-tags~, ~tags-l~, ~ltags~. -+ =tags-all (tags)= :: Return non-nil if current heading includes all of ~TAGS~. Tests both inherited and local tags. ++ =tags-all (&rest tags)= :: Return non-nil if current heading includes all of ~TAGS~. Tests both inherited and local tags. - Aliases: ~tags&~. + =tags-regexp (&rest regexps)= :: Return non-nil if current heading has tags matching one or more of ~REGEXPS~. Tests both inherited and local tags. - Aliases: ~tags*~. -+ =todo (&optional keywords)= :: Return non-nil if current heading is a ~TODO~ item. With ~KEYWORDS~, return non-nil if its keyword is one of ~KEYWORDS~ (a list of strings). When called without arguments, only matches non-done tasks (i.e. does not match keywords in ~org-done-keywords~). ++ =todo (&rest keywords)= :: Return non-nil if current heading is a ~TODO~ item. With ~KEYWORDS~, return non-nil if its keyword is one of ~KEYWORDS~ (a list of strings). When called without arguments, only matches non-done tasks (i.e. does not match keywords in ~org-done-keywords~). *** Ancestor/descendant predicates From 9946299beccccf0675ed0bc2c87fdf0650d76614 Mon Sep 17 00:00:00 2001 From: Musa Al-hassy Date: Sun, 20 Apr 2025 07:50:43 -0400 Subject: [PATCH 22/23] =?UTF-8?q?Docs:=20Remove=20grammatical=20typo=20fro?= =?UTF-8?q?m=20=E2=80=9Corg-ql-search-block=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- org-ql-search.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org-ql-search.el b/org-ql-search.el index 9c0aa86..dc7c130 100644 --- a/org-ql-search.el +++ b/org-ql-search.el @@ -235,7 +235,7 @@ Like other agenda block commands, it searches files returned by function `org-agenda-files'. Inserts a newline after the block. If `org-ql-block-header' is non-nil, it is used as the header -string for the block, otherwise a the header is formed +string for the block, otherwise the header is formed automatically from the query." (let (narrow-p old-beg old-end) (when-let* ((from (pcase org-agenda-restrict From ed23480e4b141b53a6c2503d786b8dd7ba22f3e0 Mon Sep 17 00:00:00 2001 From: Jiri Jakes Date: Mon, 17 Aug 2026 19:55:50 +0800 Subject: [PATCH 23/23] Apply #459 --- org-ql-search.el | 41 ++++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/org-ql-search.el b/org-ql-search.el index dc7c130..6fe0e55 100644 --- a/org-ql-search.el +++ b/org-ql-search.el @@ -225,11 +225,16 @@ necessary." (org-ql-view--display :buffer buffer :header header :strings strings)))) ;;;###autoload -(defun org-ql-search-block (query) - "Insert items for QUERY into current buffer. -QUERY should be an `org-ql' query form. Intended to be used as a -user-defined function in `org-agenda-custom-commands'. QUERY -corresponds to the `match' item in the custom command form. +(defun org-ql-search-block (args) + "Insert items for ARGS into current buffer. +Intended to be used as a user-defined function in +`org-agenda-custom-commands'. ARGS corresponds to the `match' +item in the custom command form. It should be a list of +arguments which may be applied to `org-ql-select', which see, but +not including its BUFFERS-FILES argument (which is supplied +through the Agenda). An additional `:header' keyword argument +may be supplied as a string, like that supplied to +`org-ql-view--display'. Like other agenda block commands, it searches files returned by function `org-agenda-files'. Inserts a newline after the block. @@ -237,7 +242,8 @@ function `org-agenda-files'. Inserts a newline after the block. If `org-ql-block-header' is non-nil, it is used as the header string for the block, otherwise the header is formed automatically from the query." - (let (narrow-p old-beg old-end) + (pcase-let ((`(,query . ,(map :header :sort)) args) + (narrow-p) (old-beg) (old-end)) (when-let* ((from (pcase org-agenda-restrict ('nil (org-agenda-files nil 'ifmode)) (_ (prog1 org-agenda-restrict @@ -248,7 +254,7 @@ automatically from the query." (narrow-to-region org-agenda-restrict-begin org-agenda-restrict-end)))))) (items (org-ql-select from query :action 'element-with-markers - :narrow narrow-p))) + :narrow narrow-p :sort sort))) (when narrow-p ;; Restore buffer's previous restrictions. (with-current-buffer from @@ -258,16 +264,25 @@ automatically from the query." ;; FIXME: `org-agenda--insert-overriding-header' is from an Org version newer than ;; I'm using. Should probably declare it as a minimum Org version after upgrading. ;; (org-agenda--insert-overriding-header (or org-ql-block-header (org-ql-agenda--header-line-format from query))) - (insert (org-add-props (or org-ql-block-header (org-ql-view--header-line-format - :buffers-files from :query query)) + ;; FIXME: Should we really use `org-ql-block-header' AND `header', or just one of them? + (insert (org-add-props (or org-ql-block-header header + (org-ql-view--header-line-format + :buffers-files from :query query)) nil 'face 'org-agenda-structure) "\n") ;; Calling `org-agenda-finalize' should be unnecessary, because in a "series" agenda, ;; `org-agenda-multi' is bound non-nil, in which case `org-agenda-finalize' does nothing. ;; But we do call `org-agenda-finalize-entries', which allows `org-super-agenda' to work. - (->> items - (-map #'org-ql-view--format-element) - org-agenda-finalize-entries - insert) + ;; However, `org-agenda-finalize-entries' sorts entries with `org-entries-lessp', which + ;; overrides the sorting `org-ql' has already done, so we rebind `org-entries-lessp' to + ;; prevent it from affecting sort order. (Ideally we would let `org-entries-lessp' + ;; handle sorting, but that's not possible, because we can't add the `type' text property + ;; it uses to sort entries, because the design of org-ql and org-agenda is fundamentally + ;; different. So we have to do the sorting ourselves.) + (cl-letf (((symbol-function 'org-entries-lessp) #'ignore)) + (->> items + (-map #'org-ql-view--format-element) + org-agenda-finalize-entries + insert)) (insert "\n")))) ;;;###autoload