From 1d98c7d07c6f2af5c84e8358cb6c5db71e8f1006 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Tue, 14 Mar 2023 12:13:07 -0500 Subject: [PATCH 001/145] Tests: Disable Org link bracket tests on old Org versions --- tests/test-org-ql.el | 56 +++++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/tests/test-org-ql.el b/tests/test-org-ql.el index 4e78f3a..5f9463f 100644 --- a/tests/test-org-ql.el +++ b/tests/test-org-ql.el @@ -1147,33 +1147,35 @@ with keyword arg NOW in PLIST." (before-each (setq org-ql-test-buffer (org-ql-test-data-buffer "data-links.org"))) - (org-ql-it "without arguments" - (org-ql-expect ('(link)) - '("Alpha"))) - (org-ql-it "with description-or-target" - (org-ql-expect ('(link "phrase")) - '("Alpha"))) - (org-ql-it "with :description" - (org-ql-expect ('(link :description "phrase")) - '("Alpha"))) - (org-ql-it "with :target" - (org-ql-expect ('(link :target "id:")) - '("Alpha"))) - (org-ql-it "with :description and :target" - (org-ql-expect ('(link :description "phrase" :target "id")) - '("Alpha"))) - (org-ql-it "with description-or-target regexp" - (org-ql-expect ('(link "id:.*" :regexp-p t)) - '("Alpha"))) - (org-ql-it "with :description regexp" - (org-ql-expect ('(link :description "phr.se" :regexp-p t)) - '("Alpha"))) - (org-ql-it "with :target regexp" - (org-ql-expect ('(link :target "id:.*" :regexp-p t)) - '("Alpha"))) - (org-ql-it "with :description and :target regexp" - (org-ql-expect ('(link :description "phr.se" :target "id:.*" :regexp-p t)) - '("Alpha"))))) + (unless (version< org-version "9.3") + ;; Earlier Org versions don't allow escaped brackets in descriptions. + (org-ql-it "without arguments" + (org-ql-expect ('(link)) + '("Alpha"))) + (org-ql-it "with description-or-target" + (org-ql-expect ('(link "phrase")) + '("Alpha"))) + (org-ql-it "with :description" + (org-ql-expect ('(link :description "phrase")) + '("Alpha"))) + (org-ql-it "with :target" + (org-ql-expect ('(link :target "id:")) + '("Alpha"))) + (org-ql-it "with :description and :target" + (org-ql-expect ('(link :description "phrase" :target "id")) + '("Alpha"))) + (org-ql-it "with description-or-target regexp" + (org-ql-expect ('(link "id:.*" :regexp-p t)) + '("Alpha"))) + (org-ql-it "with :description regexp" + (org-ql-expect ('(link :description "phr.se" :regexp-p t)) + '("Alpha"))) + (org-ql-it "with :target regexp" + (org-ql-expect ('(link :target "id:.*" :regexp-p t)) + '("Alpha"))) + (org-ql-it "with :description and :target regexp" + (org-ql-expect ('(link :description "phr.se" :target "id:.*" :regexp-p t)) + '("Alpha")))))) (describe "(outline-path)" (org-ql-it "with one argument" From 2c098540cab6a0ee7d82abe2327d524a171edd1e Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Fri, 5 May 2023 17:23:50 -0500 Subject: [PATCH 002/145] Fix: (org-ql-completing-read) Format links before display Also use org-entry-get to get the heading, which should avoid issues with different Org versions having different optional arguments to org-get-heading. --- README.org | 1 + org-ql-completing-read.el | 2 +- org-ql.info | 242 +++++++++++++++++++------------------- 3 files changed, 124 insertions(+), 121 deletions(-) diff --git a/README.org b/README.org index 5135cdc..827f04f 100644 --- a/README.org +++ b/README.org @@ -547,6 +547,7 @@ Simple links may also be written manually in either sexp or non-sexp form, like: *Fixes* + Function ~org-ql-completing-read~ is more compatible with default Emacs completion. (See [[https://github.com/alphapapa/org-ql/issues/338][#338]]. Thanks to [[https://github.com/arozbiz][arozbiz]] for reporting.) ++ In ~org-ql-completing-read~, format links for display, and use ~org-entry-get~ internally rather than ~org-get-heading~. ** 0.7 diff --git a/org-ql-completing-read.el b/org-ql-completing-read.el index b72c8fa..7d335b3 100644 --- a/org-ql-completing-read.el +++ b/org-ql-completing-read.el @@ -116,7 +116,7 @@ single predicate)." ;; without properties, so we have to use `org-get-heading', which added additional ;; optional arguments in a certain Org version, so in those versions, it will ;; return priority cookies and comment strings. - (let ((heading (org-get-heading t t))) + (let ((heading (org-link-display-format (org-entry-get (point) "ITEM")))) (when (gethash heading table) ;; Disambiguate heading (even adding the path isn't enough, because that could ;; also be duplicated). diff --git a/org-ql.info b/org-ql.info index 7998193..bc9c3be 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1,4 +1,4 @@ -This is README.info, produced by makeinfo version 5.2 from README.texi. +This is README.info, produced by makeinfo version 6.7 from README.texi. INFO-DIR-SECTION Emacs START-INFO-DIR-ENTRY @@ -71,33 +71,33 @@ Functions / Macros Changelog -* 0.7.1-pre: 071-pre. -* 0.7: 07. -* 0.6.3: 063. -* 0.6.2: 062. -* 0.6.1: 061. -* 0.6: 06. -* 0.5.2: 052. -* 0.5.1: 051. -* 0.5: 05. -* 0.4.9: 049. -* 0.4.8: 048. -* 0.4.7: 047. -* 0.4.6: 046. -* 0.4.5: 045. -* 0.4.4: 044. -* 0.4.3: 043. -* 0.4.2: 042. -* 0.4.1: 041. -* 0.4: 04. -* 0.3.2: 032. -* 0.3.1: 031. -* 0.3: 03. -* 0.2.3: 023. -* 0.2.2: 022. -* 0.2.1: 021. -* 0.2: 02. -* 0.1: 01. +* 0.7.1-pre: 071-pre. +* 0.7: 07. +* 0.6.3: 063. +* 0.6.2: 062. +* 0.6.1: 061. +* 0.6: 06. +* 0.5.2: 052. +* 0.5.1: 051. +* 0.5: 05. +* 0.4.9: 049. +* 0.4.8: 048. +* 0.4.7: 047. +* 0.4.6: 046. +* 0.4.5: 045. +* 0.4.4: 044. +* 0.4.3: 043. +* 0.4.2: 042. +* 0.4.1: 041. +* 0.4: 04. +* 0.3.2: 032. +* 0.3.1: 031. +* 0.3: 03. +* 0.2.3: 023. +* 0.2.2: 022. +* 0.2.1: 021. +* 0.2: 02. +* 0.1: 01. Notes @@ -991,33 +991,33 @@ releases. * Menu: -* 0.7.1-pre: 071-pre. -* 0.7: 07. -* 0.6.3: 063. -* 0.6.2: 062. -* 0.6.1: 061. -* 0.6: 06. -* 0.5.2: 052. -* 0.5.1: 051. -* 0.5: 05. -* 0.4.9: 049. -* 0.4.8: 048. -* 0.4.7: 047. -* 0.4.6: 046. -* 0.4.5: 045. -* 0.4.4: 044. -* 0.4.3: 043. -* 0.4.2: 042. -* 0.4.1: 041. -* 0.4: 04. -* 0.3.2: 032. -* 0.3.1: 031. -* 0.3: 03. -* 0.2.3: 023. -* 0.2.2: 022. -* 0.2.1: 021. -* 0.2: 02. -* 0.1: 01. +* 0.7.1-pre: 071-pre. +* 0.7: 07. +* 0.6.3: 063. +* 0.6.2: 062. +* 0.6.1: 061. +* 0.6: 06. +* 0.5.2: 052. +* 0.5.1: 051. +* 0.5: 05. +* 0.4.9: 049. +* 0.4.8: 048. +* 0.4.7: 047. +* 0.4.6: 046. +* 0.4.5: 045. +* 0.4.4: 044. +* 0.4.3: 043. +* 0.4.2: 042. +* 0.4.1: 041. +* 0.4: 04. +* 0.3.2: 032. +* 0.3.1: 031. +* 0.3: 03. +* 0.2.3: 023. +* 0.2.2: 022. +* 0.2.1: 021. +* 0.2: 02. +* 0.1: 01.  File: README.info, Node: 071-pre, Next: 07, Up: Changelog @@ -1030,6 +1030,8 @@ File: README.info, Node: 071-pre, Next: 07, Up: Changelog Emacs completion. (See #338 (https://github.com/alphapapa/org-ql/issues/338). Thanks to arozbiz (https://github.com/arozbiz) for reporting.) + • In ‘org-ql-completing-read’, format links for display, and use + ‘org-entry-get’ internally rather than ‘org-get-heading’.  File: README.info, Node: 07, Next: 063, Prev: 071-pre, Up: Changelog @@ -1717,71 +1719,71 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1812 -Node: Screenshots1935 -Node: Installation2053 -Node: Quelpa2567 -Node: Helm support3095 -Node: Usage3498 -Node: Commands3896 -Node: org-ql-find4340 -Node: org-ql-refile4806 -Node: org-ql-search5129 -Node: helm-org-ql6825 -Node: org-ql-view7203 -Node: org-ql-view-sidebar7733 -Node: org-ql-view-recent-items8113 -Node: org-ql-sparse-tree8609 -Node: Queries9409 -Node: Non-sexp query syntax10526 -Node: General predicates12285 -Node: Ancestor/descendant predicates19272 -Node: Date/time predicates20400 -Node: Functions / Macros23524 -Node: Agenda-like views23822 -Ref: Function ‘org-ql-block’23984 -Node: Listing / acting-on results25245 -Ref: Caching25453 -Ref: Function ‘org-ql-select’26366 -Ref: Function ‘org-ql-query’28792 -Ref: Macro ‘org-ql’ (deprecated)30566 -Node: Custom predicates30881 -Ref: Macro ‘org-ql-defpred’31105 -Node: Dynamic block34546 -Node: Links37270 -Node: Tips37957 -Node: Changelog38281 -Node: 071-pre39079 -Node: 0739416 -Node: 06342344 -Node: 06242875 -Node: 06143180 -Node: 0643748 -Node: 05246802 -Node: 05147102 -Node: 0547525 -Node: 04949054 -Node: 04849336 -Node: 04749685 -Node: 04650094 -Node: 04550502 -Node: 04450863 -Node: 04351222 -Node: 04251425 -Node: 04151586 -Node: 0451833 -Node: 03255934 -Node: 03156337 -Node: 0356534 -Node: 02359834 -Node: 02260068 -Node: 02160348 -Node: 0260553 -Node: 0164631 -Node: Notes64732 -Node: Comparison with Org Agenda searches64894 -Node: org-sidebar65783 -Node: License66062 +Node: Contents1785 +Node: Screenshots1908 +Node: Installation2026 +Node: Quelpa2540 +Node: Helm support3068 +Node: Usage3471 +Node: Commands3869 +Node: org-ql-find4313 +Node: org-ql-refile4779 +Node: org-ql-search5102 +Node: helm-org-ql6798 +Node: org-ql-view7176 +Node: org-ql-view-sidebar7706 +Node: org-ql-view-recent-items8086 +Node: org-ql-sparse-tree8582 +Node: Queries9382 +Node: Non-sexp query syntax10499 +Node: General predicates12258 +Node: Ancestor/descendant predicates19245 +Node: Date/time predicates20373 +Node: Functions / Macros23497 +Node: Agenda-like views23795 +Ref: Function org-ql-block23957 +Node: Listing / acting-on results25218 +Ref: Caching25426 +Ref: Function org-ql-select26339 +Ref: Function org-ql-query28765 +Ref: Macro org-ql (deprecated)30539 +Node: Custom predicates30854 +Ref: Macro org-ql-defpred31078 +Node: Dynamic block34519 +Node: Links37243 +Node: Tips37930 +Node: Changelog38254 +Node: 071-pre39025 +Node: 0739507 +Node: 06342435 +Node: 06242966 +Node: 06143271 +Node: 0643839 +Node: 05246893 +Node: 05147193 +Node: 0547616 +Node: 04949145 +Node: 04849427 +Node: 04749776 +Node: 04650185 +Node: 04550593 +Node: 04450954 +Node: 04351313 +Node: 04251516 +Node: 04151677 +Node: 0451924 +Node: 03256025 +Node: 03156428 +Node: 0356625 +Node: 02359925 +Node: 02260159 +Node: 02160439 +Node: 0260644 +Node: 0164722 +Node: Notes64823 +Node: Comparison with Org Agenda searches64985 +Node: org-sidebar65874 +Node: License66153  End Tag Table From eb5377320fcfd38354d6e9e3e655969ae3c0e052 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 25 May 2023 10:48:47 -0500 Subject: [PATCH 003/145] Comment: Add FIXME --- org-ql.el | 1 + 1 file changed, 1 insertion(+) diff --git a/org-ql.el b/org-ql.el index c0f548a..94f48c7 100644 --- a/org-ql.el +++ b/org-ql.el @@ -76,6 +76,7 @@ Tags are stored in match group 1. Match group 2 stores the tags without the enclosing colons.") (defvaralias 'org-ql-link-regexp + ;; FIXME: `org-link-bracket-re' is void until `org-link-make-regexps' is called. (if (bound-and-true-p org-link-bracket-re) 'org-link-bracket-re 'org-bracket-link-regexp) From 898addeee956b02118f1db421a1a6c21cd5bd866 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Mon, 4 Sep 2023 22:40:52 -0500 Subject: [PATCH 004/145] Docs: Tidy The circumstances which precipitated this expression of support for fellow developers thankfully passed some time ago. --- README.org | 1 - images/dont-tread-on-emacs-150.png | Bin 5660 -> 0 bytes 2 files changed, 1 deletion(-) delete mode 100644 images/dont-tread-on-emacs-150.png diff --git a/README.org b/README.org index 827f04f..92de36f 100644 --- a/README.org +++ b/README.org @@ -1,7 +1,6 @@ #+TITLE: org-ql # NOTE: Using =BEGIN_HTML= for this causes TeX/info export to fail, but this HTML block works. -# #+HTML: #+HTML: # NOTE: To avoid having this in the info manual, we use HTML rather than Org syntax; it still appears with the GitHub renderer. diff --git a/images/dont-tread-on-emacs-150.png b/images/dont-tread-on-emacs-150.png deleted file mode 100644 index 71f37362a5289714efa07aed1e7520198e8f8b87..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5660 zcmeAS@N?(olHy`uVBq!ia0y~yV3@|hz>vbh1|p+Reqdl=U@3O;4B_D5;Hcq9>0n@B z;4JWnEM{O()C6J1dq)rZF)%PlmbgZg1m~xflqVLYGL)B>>t*I;7bhncr0V4trO$q6 zBgMcVI@8m|F{EP7+qsoFGS_R5+ZVs})yvn*|2UyEU{lKLZL;2dk1ag-Z)VO}mLa5) zadDYz@D`7WOsq^>G6F<0nzy({ZQ;1Z;#qvPY?g)ZWs5=?_iZ_z({k=Es+fN|`+as= zdEdW{Dyp+Ye1l>pdY@yLIrC=r_q2P`H9!0A?{2wY^=!A8nOSzvj(dU|ZqB)JXp<(# zwhcL4O}aX>n-aKBFH^uJ^r^~yfyBg(AFNno_&ApbA9^{Za92u zn=5*!eu?DKox9FUO8I~Io4@zy%i_l=J*ItctQ2p|y^!6I8u+MT*)gG6vrc8?=%xOj zn5LEO9sXs;J8#E%|G&BFeLb@9gt0+%1gq0Vo>$p-Di@kg-IVR$@b>qs`=)aeXViTB ztpBOZ|Bu{}O$9d&?Q-u}cJkXap+1@HCwuqb>O5TfJjqzh@8kCQ|0SD)Z`t-dyruN^ zZOt?N>()ZAT~{(ot-70&t+n*?KCURK+9{Q(bA%SWezJ*e+72_`bZ-HUqs1|Mq!vA2 zo7g9p?>tGYe%tA{3zqKexxD|)ag9qxh2CNJRCW5^t$+5ozF^9wqVtRDc;LZYME*B1m*%T|d2+Nj3LmmiA;7VXc!X(^8bY zm1e4%7SHub^Gq$7!^gP)zVFKWp1E76yU&aH^_O97?$a;+Ea7vG^&XfeeC^%uQ};qc zP9J?<{`m9m%-gaNm*V{{Pn0z}#O1y9S#IiwUAk))DFlQUoxi^`>UWq~^d7ghy4RN) z8_tV)uc0&hWapJC_r$9?mWg+FNT$_T?7DX`LTvHjjbHl?t-4us$V-~(|L;FfzxEy5 z{mK6Rz5~6DN2=VDujcHu5<9T-^W!-({lStEanrl!8C(3%vX8y4CMnyg%)zusL%~z2 ziDi<8QWw)A4JB)rQ>SC5gzwSZVb_u%ae>#-n&Bgt|DZEAe-)9?j`?>_r`u#sV#cPFE3y3yo zOmIz7$}ka-t#hxFYVs+@4(t~)5OIbt`~Ia*FH?0wDG8Q&28)K zpOeqqIt4HNEO&fO#l}|C!@Ubt;(s0TKH}6Z-u-rW*3UcfcIVcqy|?X)EZns8c=F!K zFC+TA^LZ}ZiSY`3d&thU|NOy?k8^##`x@EIOFFvuR5V9)#CwH#h83^h7|5MmRO)`V z>Gvd^q8As$0_Cr&xTt6hQ2WS+Uv(U z({oDq3P(qjA8=VvZs7U;_TiFus}H}8%_v&2PW$NzXWgFCUSXb-=ymvy2kUd5cPWsbXyZ--pZu~|39Z1_|L2R~ ztukGmX=Y3_mmJ&w_pkPxy;5w6*&@BJ_qA-cZEv#w`RDhFb@4Y(>3tVEs#yHR#X8CA zutR;0cf{-NT^e_;zIl4N{+~ow^56C?PfX^9I4MsJ2n@Eo;=|{A^D^sml?Y_3Vb8BhoPELOCOy%H2iHjX>Dzg;D0zH>*&Y0D= zOfq9t-zv$J&1zBS&iFS7wEW4qU~Ot|zH`Nbj@HunYRlf-soDSTyiAyLJ?_=BTURxA zRWDwlwqcEEx=X+|x4)T|BI`Glg{{50dC_IfxSt<+*Tv3Wv|GQ;>bkD-E#+%ro)@{i zCtW+X=I<;2T@~+cuJ$?hRdTv+j$XWTS6D>nk-IlrFL6#?U;oo&{a)M7#G5xSMFnp; zB=w^EPUsK)|7TC{xjXxS-fJ%Bi*;95-xaJ{-@9Jx&Cd8Q&%)KVX-c?iubHFz=@Iw! zaM5pfW+wVn2gEsQMkO-N*=KOF`~Ln-j|zBurLTMKkJQLYl;p7a|A#j(MkYFNNBh0o zj?PnUcki4avULN4(5#dD|6P`jsVuIznYik;*U!!SD|)6$RWoHR)cEC>(GYU&$y;-G z&F@+!`=f%*S~oCkVvE@&al~u&n?3vMA{V>J>a{ZS z=P%y7v*qMNj)yDK&TolSHtXHMz~lWODtyMg?d}Dip>^KYJ>=j^M^pBEKlX?^5rx8tte%OoXy7vB8LHvQ-`v1>eC z8HFYFy8i#a*)jP(U0rwXh{qJ;^zH8dm z=Ly@BXNujO-W0Rj=GcjXIS&^~9GuXlx90zbmtPaSxw6I9^YGt`KkTd?b+dYfWMS{I zinB(S#2Y39hP=$gvx$)`r$n}uhg`T8c<`d|+aKE3>z?jAxK8t4 z#n$<+!_{BPdrrK4#4R#9qWgiE&o7xm#Igoff>7aq`W+*TQ># z9DY4#uffT*IU0L4TT>&&I$c^^wAwP&Dj)q_Yx6rk+(4I`oAJz_n?el2&vZDZHJE9AOm$oo z<(UHo3anD*@Ubp;KK8aK=#{p!#w5=5uG(v2{FJ3;tIhSCbZ$w2vF4?jJd&ZVmrZ!Q z9YjP|t+uUsyL$iOVEJF=EP-w!sVsp`BB?HcvkGTha{t_{;^{G|N#nG~r8A1&9mdxe zsVJWP@%glx?^Zvl*R>{Bs(*ate}61~W6?s}@4ef9>|P(Emi=NzTjRpl635Oge7?a) z)<<-{`@$oS7j4=jGr#;X-~XE*oF^~dn0e?S=cJV^nWn9?JST@;&bTSlWS~7|kHx3! zc_QVU=Oj03=(XmA9e=xerr>4WM9)o4I;TA*HK{zW_kRCF*L(Z!^D*9^dS0lw1S%Kwjs_Hxa)_4k^yCyFvme{@*BzCnIZLFZ{_Lmg*!Z+9_Ym7<76j58V<^Okk0 zDZ5No4w>>ZgKG=(KBt;ryOR!cYRmB(n_Tj>F!D5!Qkv^|Uik3ZJI8h!92Zn&ah&yC z+B+pBMIi9Z`TY|&2gBvCl7dESwkUxin}=kmjYAU+!4W^-GQvlj~>iKi+)(_0iW~AC>JkT>H4g>EX2O zC|>DJeN#`mNbr6W>h_)Jb^K(?rHrU)bJk5hJu|}l%XQ8sj;4l&289j{zRvSC&m8Af zubchBrSI+8-Yr|NZCq>W@OoQR)a_Rp_XFK)i&f`Mn)+6Ihm;QYul%0EZ(n%V#l3uf zWu^C?qJOzAf-!oW`|tN&e|_kA@#C*n>F3t%Jp4ASV7Kg!7_PYWlU#nLRV-ff zG-;NlQI<$(?^Ax=wpDJ1zOt8140vR9XFt90aPF6HJw|3`y_vISESqX>JA-Z7)cE`> zn+_aeIekbee-lIYv;1$jm_Dg-GBQ>!Q_YNgwuay5^pn5-a)%ykKDEAY$$CesR9WGS z@0NMxwv!JlMRY7`Q1U*psb!Ieg{+^=y&x}dEzR%j1-nld?))Qt?@hp!L%XC)VpV7R zPCUEx#M4X0?rn4CIi63wz{`7j(*_;k4bNKABE#Y`!v1ZJ+&oSH^|ka68KFfA3sQUc zB&5v{J^c20O>2z9BoUFL%}To`i1K&6Iri|wB8@zmF8=nz&W67K?@w@jxYuD??1@d> z{L<^|Hc8&N@pGl`#Uywyu{`v6R-WeKH9GmfJ(m~r@VT70yRB%oPWPMJ@(hj-UOnXu z33V4?{q|<9s)(1dm5}=+7OU@9lsGQjmR6g2f~nv^0JHl1TPN@T`KrAltM0AV{PT|0 z?nj#{N=khfr+s04x4roPz5`8`g2{_HlMJWM-M#Ahou-2|E>2 z85$b5E@s{V6J4pZz&gW=@-SRQ~VBKpQ#M%PkopPaiB~E4mrI=u9fFl$7^#JC-M{F+q>!e3tKBb>-Tx z6>BTM@7wg3|H@hJ=^iPTB}*6&8+`mJ6LP(x^JvJe+u9aCzvwC4zi`>4S=M@W$I*}^ zL($7yZv1zUognU`v#RJr0dxPJ<*E06Z&_paUC(rJ@go=Q<8pa%*UD}GMQE$bWk3D( zRWs`LDa()d{_OhtvZT-5Kj-n0WaIt8kyhWYEqd+Uzx$#|bGuyLvx|>!KfB{+bL~_! z`>Ttk%@ICN|NU*;X_97S*(Z}56BhISNGzwe%qfB1RXltyJIhKZ<=1~!I`02O`0tne zH_xii$3A^CQ&8>L=F~d3@hL3y_vUeUZcN&%}bZ z3tt}H<~={@($aoS?$EJowlq1sT7^nQV)d3l}{+6C?GzO1Y=+-d!XA?5N{L zJl!Q$>`%Ja-fm5lP=+TYAIFAmR5F|u42 zH*?PJ?++TQ?(GtIa_MN{w|o1)u(3_o>$`ky+XjvOb7iepRlNT5$JOuLe#>L$?r!gT zJ-zPM>Bs(C^ncDdYEhlma@c)##gB<;arU+*@8e=?Ie&j+uXtwuJwZY(KbB+NkDuFv zH=L@@nCQE^I5PR(t%d9NTAeuDuM=k@(RS3o{*v)|-PxvMDZgi>B}lxtV=`M z??&aj7kc!tPyT#o5-0EW*I}g~yKJ>tq?mY**oqZj&UEicJ-Bo8Vi~)l@~1ze3Vv->tov~P`pgdpZS`KN#CT`^MC&JvQ_)DkN?saFZn*cDgXSs_w2I5 zt!rj(@baEJr>08$`MDm358d;>f8OZ-X7L^y`#Fy{9=|R2#DSr9Z=#fxci@y>Ltibi z;GH#@P0sD&Tq$PhYw}O@-?1s$(kcFbefzw30=9P*_2$Sg-nTHt(IQgJvSbJ2#rAVSKo8sefE03!Z!<_nsTH`%5)eR$?Sgow|rUQ z);m{k@v`%o282CJDo^J%HH|wrPckvbZGo=+}>#XP7}VKc73PAE@5d&kg5#QF5AH#Y)Z zv!gBd+9vv3e)J=GZN*+b70vn4=BB@I-i>rV{>{tH?a>@->s@Q!SN*-EvfDbl;)8>2 z-u6T1>#wzEMqRl&{lb+u&-clO-g(0%*#ETn^uvWO79IVf^Y*PM%d1a`)zybMnEw0< zwhk2OtcZDh(S7^Fl9Qh=S;+Yq*p#F*?vsw*CVXqzh8xq$2@Gd$!yNSd&tH7{&4nKY T9~Ln%Ffe$!`njxgN@xNAk>vYn From a7af6d78b220f374221d802397fb2337238a3b89 Mon Sep 17 00:00:00 2001 From: Ankit Pandey Date: Wed, 21 Jun 2023 04:02:59 -0700 Subject: [PATCH 005/145] Fix: (org-ql-completing-read) Store markers as text property Fixes #350 --- org-ql-completing-read.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/org-ql-completing-read.el b/org-ql-completing-read.el index 7d335b3..952ebf1 100644 --- a/org-ql-completing-read.el +++ b/org-ql-completing-read.el @@ -123,7 +123,8 @@ single predicate)." (if-let ((suffix (gethash heading disambiguations))) (setf heading (format "%s <%s>" heading (cl-incf suffix))) (setf heading (format "%s <%s>" heading (puthash heading 2 disambiguations))))) - (puthash heading (point-marker) table))) + (let ((marker (point-marker))) + (puthash (propertize heading 'org-marker marker) marker table)))) (path (marker) (org-with-point-at marker (let* ((path (thread-first (org-get-outline-path nil t) @@ -140,7 +141,7 @@ single predicate)." (affix (completions) ;; (debug-message "AFFIX:%S" completions) (cl-loop for completion in completions - for marker = (gethash completion table) + for marker = (get-text-property 0 'org-marker completion) for prefix = (todo marker) for suffix = (concat (path marker) " " (snippet marker)) collect (list completion prefix suffix))) @@ -150,7 +151,7 @@ single predicate)." ;; Using `while-no-input' here doesn't make it as responsive as, ;; e.g. Helm while typing, but it seems to help a little when using the ;; org-rifle-style snippets. - (or (snippet (gethash candidate table)) ""))) + (or (snippet (get-text-property 0 'org-marker completion)) ""))) (snippet (marker) (when-let ((snippet @@ -161,7 +162,7 @@ single predicate)." 'face 'org-ql-completing-read-snippet))) (group (candidate transform) (pcase transform - (`nil (buffer-name (marker-buffer (gethash candidate table)))) + (`nil (buffer-name (marker-buffer (get-text-property 0 'org-marker candidate)))) (_ candidate))) (try (string _collection _pred point &optional _metadata) ;; (debug-message "TRY: STRING:%S" string) From 2d29d69133ae7d437afb4ce0a1f644b0bfd42d75 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 6 Sep 2023 16:08:54 -0500 Subject: [PATCH 006/145] Docs: Update changelog --- README.org | 1 + org-ql.info | 65 ++++++++++++++++++++++++++++------------------------- 2 files changed, 36 insertions(+), 30 deletions(-) diff --git a/README.org b/README.org index 92de36f..ad803be 100644 --- a/README.org +++ b/README.org @@ -546,6 +546,7 @@ Simple links may also be written manually in either sexp or non-sexp form, like: *Fixes* + Function ~org-ql-completing-read~ is more compatible with default Emacs completion. (See [[https://github.com/alphapapa/org-ql/issues/338][#338]]. Thanks to [[https://github.com/arozbiz][arozbiz]] for reporting.) ++ Function ~org-ql-completing-read~ would sometimes stop updating with changes in input. (See [[https://github.com/alphapapa/org-ql/issues/350][#350]]. Thanks to [[https://github.com/anpandey][Ankit Raj Pandey]] for reporting and fixing, and to [[https://github.com/minad][Daniel Mendler]] for advising.) + In ~org-ql-completing-read~, format links for display, and use ~org-entry-get~ internally rather than ~org-get-heading~. ** 0.7 diff --git a/org-ql.info b/org-ql.info index bc9c3be..5ecb26e 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1030,6 +1030,11 @@ File: README.info, Node: 071-pre, Next: 07, Up: Changelog Emacs completion. (See #338 (https://github.com/alphapapa/org-ql/issues/338). Thanks to arozbiz (https://github.com/arozbiz) for reporting.) + • Function ‘org-ql-completing-read’ would sometimes stop updating + with changes in input. (See #350 + (https://github.com/alphapapa/org-ql/issues/350). Thanks to Ankit + Raj Pandey (https://github.com/anpandey) for reporting and fixing, + and to Daniel Mendler (https://github.com/minad) for advising.) • In ‘org-ql-completing-read’, format links for display, and use ‘org-entry-get’ internally rather than ‘org-get-heading’. @@ -1754,36 +1759,36 @@ Node: Links37243 Node: Tips37930 Node: Changelog38254 Node: 071-pre39025 -Node: 0739507 -Node: 06342435 -Node: 06242966 -Node: 06143271 -Node: 0643839 -Node: 05246893 -Node: 05147193 -Node: 0547616 -Node: 04949145 -Node: 04849427 -Node: 04749776 -Node: 04650185 -Node: 04550593 -Node: 04450954 -Node: 04351313 -Node: 04251516 -Node: 04151677 -Node: 0451924 -Node: 03256025 -Node: 03156428 -Node: 0356625 -Node: 02359925 -Node: 02260159 -Node: 02160439 -Node: 0260644 -Node: 0164722 -Node: Notes64823 -Node: Comparison with Org Agenda searches64985 -Node: org-sidebar65874 -Node: License66153 +Node: 0739834 +Node: 06342762 +Node: 06243293 +Node: 06143598 +Node: 0644166 +Node: 05247220 +Node: 05147520 +Node: 0547943 +Node: 04949472 +Node: 04849754 +Node: 04750103 +Node: 04650512 +Node: 04550920 +Node: 04451281 +Node: 04351640 +Node: 04251843 +Node: 04152004 +Node: 0452251 +Node: 03256352 +Node: 03156755 +Node: 0356952 +Node: 02360252 +Node: 02260486 +Node: 02160766 +Node: 0260971 +Node: 0165049 +Node: Notes65150 +Node: Comparison with Org Agenda searches65312 +Node: org-sidebar66201 +Node: License66480  End Tag Table From 3c24958738089990692267265943c7fad29e59f3 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 6 Sep 2023 18:55:39 -0500 Subject: [PATCH 007/145] Fix: (org-ql-completing-read) Variable name --- org-ql-completing-read.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org-ql-completing-read.el b/org-ql-completing-read.el index 952ebf1..47b6c35 100644 --- a/org-ql-completing-read.el +++ b/org-ql-completing-read.el @@ -151,7 +151,7 @@ single predicate)." ;; Using `while-no-input' here doesn't make it as responsive as, ;; e.g. Helm while typing, but it seems to help a little when using the ;; org-rifle-style snippets. - (or (snippet (get-text-property 0 'org-marker completion)) ""))) + (or (snippet (get-text-property 0 'org-marker candidate)) ""))) (snippet (marker) (when-let ((snippet From ed81b7d7c81479a73f50a46c2f0e338ec264b924 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 6 Sep 2023 18:56:32 -0500 Subject: [PATCH 008/145] Tests: Require xr This is only a development dependency. --- tests/test-org-ql.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test-org-ql.el b/tests/test-org-ql.el index 5f9463f..9008179 100644 --- a/tests/test-org-ql.el +++ b/tests/test-org-ql.el @@ -33,6 +33,8 @@ (require 'org-ql-search) (require 'org-ql-view) +(require 'xr) + ;;;; Variables (defvar org-ql-test-buffer nil From d776e205d53adccd1d66a9c666fd885a2334262e Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 6 Sep 2023 18:57:36 -0500 Subject: [PATCH 009/145] Release: v0.7.1 --- README.org | 2 +- org-ql.el | 2 +- org-ql.info | 142 ++++++++++++++++++++++++++-------------------------- 3 files changed, 73 insertions(+), 73 deletions(-) diff --git a/README.org b/README.org index ad803be..13d6732 100644 --- a/README.org +++ b/README.org @@ -542,7 +542,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.7.1-pre +** 0.7.1 *Fixes* + Function ~org-ql-completing-read~ is more compatible with default Emacs completion. (See [[https://github.com/alphapapa/org-ql/issues/338][#338]]. Thanks to [[https://github.com/arozbiz][arozbiz]] for reporting.) diff --git a/org-ql.el b/org-ql.el index 94f48c7..991944e 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.7.1-pre +;; Version: 0.7.1 ;; Package-Requires: ((emacs "26.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 5ecb26e..900e0ce 100644 --- a/org-ql.info +++ b/org-ql.info @@ -71,7 +71,7 @@ Functions / Macros Changelog -* 0.7.1-pre: 071-pre. +* 0.7.1: 071. * 0.7: 07. * 0.6.3: 063. * 0.6.2: 062. @@ -991,7 +991,7 @@ releases. * Menu: -* 0.7.1-pre: 071-pre. +* 0.7.1: 071. * 0.7: 07. * 0.6.3: 063. * 0.6.2: 062. @@ -1020,10 +1020,10 @@ releases. * 0.1: 01.  -File: README.info, Node: 071-pre, Next: 07, Up: Changelog +File: README.info, Node: 071, Next: 07, Up: Changelog -5.1 0.7.1-pre -============= +5.1 0.7.1 +========= *Fixes* • Function ‘org-ql-completing-read’ is more compatible with default @@ -1039,7 +1039,7 @@ File: README.info, Node: 071-pre, Next: 07, Up: Changelog ‘org-entry-get’ internally rather than ‘org-get-heading’.  -File: README.info, Node: 07, Next: 063, Prev: 071-pre, Up: Changelog +File: README.info, Node: 07, Next: 063, Prev: 071, Up: Changelog 5.2 0.7 ======= @@ -1724,71 +1724,71 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1785 -Node: Screenshots1908 -Node: Installation2026 -Node: Quelpa2540 -Node: Helm support3068 -Node: Usage3471 -Node: Commands3869 -Node: org-ql-find4313 -Node: org-ql-refile4779 -Node: org-ql-search5102 -Node: helm-org-ql6798 -Node: org-ql-view7176 -Node: org-ql-view-sidebar7706 -Node: org-ql-view-recent-items8086 -Node: org-ql-sparse-tree8582 -Node: Queries9382 -Node: Non-sexp query syntax10499 -Node: General predicates12258 -Node: Ancestor/descendant predicates19245 -Node: Date/time predicates20373 -Node: Functions / Macros23497 -Node: Agenda-like views23795 -Ref: Function org-ql-block23957 -Node: Listing / acting-on results25218 -Ref: Caching25426 -Ref: Function org-ql-select26339 -Ref: Function org-ql-query28765 -Ref: Macro org-ql (deprecated)30539 -Node: Custom predicates30854 -Ref: Macro org-ql-defpred31078 -Node: Dynamic block34519 -Node: Links37243 -Node: Tips37930 -Node: Changelog38254 -Node: 071-pre39025 -Node: 0739834 -Node: 06342762 -Node: 06243293 -Node: 06143598 -Node: 0644166 -Node: 05247220 -Node: 05147520 -Node: 0547943 -Node: 04949472 -Node: 04849754 -Node: 04750103 -Node: 04650512 -Node: 04550920 -Node: 04451281 -Node: 04351640 -Node: 04251843 -Node: 04152004 -Node: 0452251 -Node: 03256352 -Node: 03156755 -Node: 0356952 -Node: 02360252 -Node: 02260486 -Node: 02160766 -Node: 0260971 -Node: 0165049 -Node: Notes65150 -Node: Comparison with Org Agenda searches65312 -Node: org-sidebar66201 -Node: License66480 +Node: Contents1777 +Node: Screenshots1900 +Node: Installation2018 +Node: Quelpa2532 +Node: Helm support3060 +Node: Usage3463 +Node: Commands3861 +Node: org-ql-find4305 +Node: org-ql-refile4771 +Node: org-ql-search5094 +Node: helm-org-ql6790 +Node: org-ql-view7168 +Node: org-ql-view-sidebar7698 +Node: org-ql-view-recent-items8078 +Node: org-ql-sparse-tree8574 +Node: Queries9374 +Node: Non-sexp query syntax10491 +Node: General predicates12250 +Node: Ancestor/descendant predicates19237 +Node: Date/time predicates20365 +Node: Functions / Macros23489 +Node: Agenda-like views23787 +Ref: Function org-ql-block23949 +Node: Listing / acting-on results25210 +Ref: Caching25418 +Ref: Function org-ql-select26331 +Ref: Function org-ql-query28757 +Ref: Macro org-ql (deprecated)30531 +Node: Custom predicates30846 +Ref: Macro org-ql-defpred31070 +Node: Dynamic block34511 +Node: Links37235 +Node: Tips37922 +Node: Changelog38246 +Node: 07139009 +Node: 0739806 +Node: 06342730 +Node: 06243261 +Node: 06143566 +Node: 0644134 +Node: 05247188 +Node: 05147488 +Node: 0547911 +Node: 04949440 +Node: 04849722 +Node: 04750071 +Node: 04650480 +Node: 04550888 +Node: 04451249 +Node: 04351608 +Node: 04251811 +Node: 04151972 +Node: 0452219 +Node: 03256320 +Node: 03156723 +Node: 0356920 +Node: 02360220 +Node: 02260454 +Node: 02160734 +Node: 0260939 +Node: 0165017 +Node: Notes65118 +Node: Comparison with Org Agenda searches65280 +Node: org-sidebar66169 +Node: License66448  End Tag Table From 3622b92403a53c360ea9ed9ca8692a157cec8a4c Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 6 Sep 2023 20:49:12 -0500 Subject: [PATCH 010/145] Meta: v0.7.2-pre --- README.org | 4 ++++ org-ql.el | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.org b/README.org index 13d6732..32d6662 100644 --- a/README.org +++ b/README.org @@ -542,6 +542,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.7.2-pre + +Nothing new yet. + ** 0.7.1 *Fixes* diff --git a/org-ql.el b/org-ql.el index 991944e..b92784e 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.7.1 +;; Version: 0.7.2-pre ;; Package-Requires: ((emacs "26.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 From f65b1d91a49468e176bd733d3b930ec4b7ed4cf1 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 6 Sep 2023 20:50:39 -0500 Subject: [PATCH 011/145] Fix: (org-ql--normalize-from-to-on) Tolerate "-" input Avoids errors while typing a query (e.g. a negative number) into org-ql-find, which interrupts completion altogether. --- README.org | 3 ++- org-ql.el | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.org b/README.org index 32d6662..92d5cb5 100644 --- a/README.org +++ b/README.org @@ -544,7 +544,8 @@ Simple links may also be written manually in either sexp or non-sexp form, like: ** 0.7.2-pre -Nothing new yet. +*Fixes* ++ Timestamp predicates are more tolerant of partial input (e.g. preventing errors while the user is typing a query into ~org-ql-find~). ** 0.7.1 diff --git a/org-ql.el b/org-ql.el index b92784e..e153138 100644 --- a/org-ql.el +++ b/org-ql.el @@ -1286,6 +1286,9 @@ result form." to on)) (when from (setq from (pcase from + ("-" + ;; Ignore, because it means the user is typing a negative number. + nil) ((or 'today "today") (->> (ts-now) (ts-apply :hour 0 :minute 0 :second 0))) ((pred numberp) (->> (ts-now) @@ -1302,6 +1305,9 @@ result form." ((pred ts-p) from)))) (when to (setq to (pcase to + ("-" + ;; Ignore, because it means the user is typing a negative number. + nil) ((or 'today "today") (->> (ts-now) (ts-apply :hour 23 :minute 59 :second 59))) ((pred numberp) (->> (ts-now) From 131407814ebfd8d409f23bc5cceeeb2b5da1a8d9 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Fri, 8 Sep 2023 02:22:40 -0500 Subject: [PATCH 012/145] Fix: (org-ql--def-query-string-to-sexp-fn) Ignore leading blanks --- README.org | 1 + org-ql.el | 2 +- org-ql.info | 204 ++++++++++++++++++++++++++++------------------------ 3 files changed, 112 insertions(+), 95 deletions(-) diff --git a/README.org b/README.org index 92d5cb5..4e499a6 100644 --- a/README.org +++ b/README.org @@ -546,6 +546,7 @@ Simple links may also be written manually in either sexp or non-sexp form, like: *Fixes* + Timestamp predicates are more tolerant of partial input (e.g. preventing errors while the user is typing a query into ~org-ql-find~). ++ Query parser ignores leading whitespace (e.g. preventing errors while the user is typing a query into ~org-ql-find~). ** 0.7.1 diff --git a/org-ql.el b/org-ql.el index e153138..2a54768 100644 --- a/org-ql.el +++ b/org-ql.el @@ -945,7 +945,7 @@ value of `org-ql-predicates')." ;; obscure bug in `peg': when one keyword is a substring of another, ;; and the shorter one is listed first, the shorter one fails to match. (-sort (-on #'> #'length)))) - (pexs `((query (+ (and term (* [blank])))) + (pexs `((query (and (* [blank]) (+ (and term (* [blank]))))) (term (or (and negation (list positive-term) ;; This is a bit confusing, but it seems to work. There's probably a better way. `(pred -- (list 'not (car pred)))) diff --git a/org-ql.info b/org-ql.info index 900e0ce..c120823 100644 --- a/org-ql.info +++ b/org-ql.info @@ -71,6 +71,7 @@ Functions / Macros Changelog +* 0.7.2-pre: 072-pre. * 0.7.1: 071. * 0.7: 07. * 0.6.3: 063. @@ -991,6 +992,7 @@ releases. * Menu: +* 0.7.2-pre: 072-pre. * 0.7.1: 071. * 0.7: 07. * 0.6.3: 063. @@ -1020,9 +1022,22 @@ releases. * 0.1: 01.  -File: README.info, Node: 071, Next: 07, Up: Changelog +File: README.info, Node: 072-pre, Next: 071, Up: Changelog -5.1 0.7.1 +5.1 0.7.2-pre +============= + +*Fixes* + • Timestamp predicates are more tolerant of partial input (e.g. + preventing errors while the user is typing a query into + ‘org-ql-find’). + • Query parser ignores leading whitespace (e.g. preventing errors + while the user is typing a query into ‘org-ql-find’). + + +File: README.info, Node: 071, Next: 07, Prev: 072-pre, Up: Changelog + +5.2 0.7.1 ========= *Fixes* @@ -1041,7 +1056,7 @@ File: README.info, Node: 071, Next: 07, Up: Changelog  File: README.info, Node: 07, Next: 063, Prev: 071, Up: Changelog -5.2 0.7 +5.3 0.7 ======= *Added* @@ -1101,7 +1116,7 @@ File: README.info, Node: 07, Next: 063, Prev: 071, Up: Changelog  File: README.info, Node: 063, Next: 062, Prev: 07, Up: Changelog -5.3 0.6.3 +5.4 0.6.3 ========= *Fixed* @@ -1117,7 +1132,7 @@ File: README.info, Node: 063, Next: 062, Prev: 07, Up: Changelog  File: README.info, Node: 062, Next: 061, Prev: 063, Up: Changelog -5.4 0.6.2 +5.5 0.6.2 ========= *Fixed* @@ -1128,7 +1143,7 @@ File: README.info, Node: 062, Next: 061, Prev: 063, Up: Changelog  File: README.info, Node: 061, Next: 06, Prev: 062, Up: Changelog -5.5 0.6.1 +5.6 0.6.1 ========= *Fixed* @@ -1146,7 +1161,7 @@ File: README.info, Node: 061, Next: 06, Prev: 062, Up: Changelog  File: README.info, Node: 06, Next: 052, Prev: 061, Up: Changelog -5.6 0.6 +5.7 0.6 ======= *Added* @@ -1213,7 +1228,7 @@ File: README.info, Node: 06, Next: 052, Prev: 061, Up: Changelog  File: README.info, Node: 052, Next: 051, Prev: 06, Up: Changelog -5.7 0.5.2 +5.8 0.5.2 ========= *Fixed* @@ -1224,7 +1239,7 @@ File: README.info, Node: 052, Next: 051, Prev: 06, Up: Changelog  File: README.info, Node: 051, Next: 05, Prev: 052, Up: Changelog -5.8 0.5.1 +5.9 0.5.1 ========= *Fixed* @@ -1237,8 +1252,8 @@ File: README.info, Node: 051, Next: 05, Prev: 052, Up: Changelog  File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog -5.9 0.5 -======= +5.10 0.5 +======== *Added* • View dispatcher using ‘transient.el’ (like Magit), bound to ‘v’ in @@ -1278,7 +1293,7 @@ File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog  File: README.info, Node: 049, Next: 048, Prev: 05, Up: Changelog -5.10 0.4.9 +5.11 0.4.9 ========== *Fixed* @@ -1289,7 +1304,7 @@ File: README.info, Node: 049, Next: 048, Prev: 05, Up: Changelog  File: README.info, Node: 048, Next: 047, Prev: 049, Up: Changelog -5.11 0.4.8 +5.12 0.4.8 ========== *Fixed* @@ -1301,7 +1316,7 @@ File: README.info, Node: 048, Next: 047, Prev: 049, Up: Changelog  File: README.info, Node: 047, Next: 046, Prev: 048, Up: Changelog -5.12 0.4.7 +5.13 0.4.7 ========== *Fixed* @@ -1314,7 +1329,7 @@ File: README.info, Node: 047, Next: 046, Prev: 048, Up: Changelog  File: README.info, Node: 046, Next: 045, Prev: 047, Up: Changelog -5.13 0.4.6 +5.14 0.4.6 ========== *Fixed* @@ -1327,7 +1342,7 @@ File: README.info, Node: 046, Next: 045, Prev: 047, Up: Changelog  File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog -5.14 0.4.5 +5.15 0.4.5 ========== *Fixed* @@ -1339,7 +1354,7 @@ File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog  File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog -5.15 0.4.4 +5.16 0.4.4 ========== *Fixed* @@ -1351,7 +1366,7 @@ File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog  File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog -5.16 0.4.3 +5.17 0.4.3 ========== *Fixed* @@ -1361,7 +1376,7 @@ File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog  File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog -5.17 0.4.2 +5.18 0.4.2 ========== *Fixed* @@ -1370,7 +1385,7 @@ File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog  File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog -5.18 0.4.1 +5.19 0.4.1 ========== *Fixed* @@ -1380,7 +1395,7 @@ File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog  File: README.info, Node: 04, Next: 032, Prev: 041, Up: Changelog -5.19 0.4 +5.20 0.4 ======== _Note:_ The next release, 0.5, may include changes which will require @@ -1461,7 +1476,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.20 0.3.2 +5.21 0.3.2 ========== *Fixed* @@ -1474,7 +1489,7 @@ File: README.info, Node: 032, Next: 031, Prev: 04, Up: Changelog  File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog -5.21 0.3.1 +5.22 0.3.1 ========== *Fixed* @@ -1484,7 +1499,7 @@ File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog  File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog -5.22 0.3 +5.23 0.3 ======== *Added* @@ -1552,7 +1567,7 @@ File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog  File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog -5.23 0.2.3 +5.24 0.2.3 ========== *Fixed* @@ -1562,7 +1577,7 @@ File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog  File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog -5.24 0.2.2 +5.25 0.2.2 ========== *Fixed* @@ -1573,7 +1588,7 @@ File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog  File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog -5.25 0.2.1 +5.26 0.2.1 ========== *Fixed* @@ -1583,7 +1598,7 @@ File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog  File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog -5.26 0.2 +5.27 0.2 ======== *Added* @@ -1666,7 +1681,7 @@ File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog  File: README.info, Node: 01, Prev: 02, Up: Changelog -5.27 0.1 +5.28 0.1 ======== First tagged release. @@ -1724,71 +1739,72 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1777 -Node: Screenshots1900 -Node: Installation2018 -Node: Quelpa2532 -Node: Helm support3060 -Node: Usage3463 -Node: Commands3861 -Node: org-ql-find4305 -Node: org-ql-refile4771 -Node: org-ql-search5094 -Node: helm-org-ql6790 -Node: org-ql-view7168 -Node: org-ql-view-sidebar7698 -Node: org-ql-view-recent-items8078 -Node: org-ql-sparse-tree8574 -Node: Queries9374 -Node: Non-sexp query syntax10491 -Node: General predicates12250 -Node: Ancestor/descendant predicates19237 -Node: Date/time predicates20365 -Node: Functions / Macros23489 -Node: Agenda-like views23787 -Ref: Function org-ql-block23949 -Node: Listing / acting-on results25210 -Ref: Caching25418 -Ref: Function org-ql-select26331 -Ref: Function org-ql-query28757 -Ref: Macro org-ql (deprecated)30531 -Node: Custom predicates30846 -Ref: Macro org-ql-defpred31070 -Node: Dynamic block34511 -Node: Links37235 -Node: Tips37922 -Node: Changelog38246 -Node: 07139009 -Node: 0739806 -Node: 06342730 -Node: 06243261 -Node: 06143566 -Node: 0644134 -Node: 05247188 -Node: 05147488 -Node: 0547911 -Node: 04949440 -Node: 04849722 -Node: 04750071 -Node: 04650480 -Node: 04550888 -Node: 04451249 -Node: 04351608 -Node: 04251811 -Node: 04151972 -Node: 0452219 -Node: 03256320 -Node: 03156723 -Node: 0356920 -Node: 02360220 -Node: 02260454 -Node: 02160734 -Node: 0260939 -Node: 0165017 -Node: Notes65118 -Node: Comparison with Org Agenda searches65280 -Node: org-sidebar66169 -Node: License66448 +Node: Contents1799 +Node: Screenshots1922 +Node: Installation2040 +Node: Quelpa2554 +Node: Helm support3082 +Node: Usage3485 +Node: Commands3883 +Node: org-ql-find4327 +Node: org-ql-refile4793 +Node: org-ql-search5116 +Node: helm-org-ql6812 +Node: org-ql-view7190 +Node: org-ql-view-sidebar7720 +Node: org-ql-view-recent-items8100 +Node: org-ql-sparse-tree8596 +Node: Queries9396 +Node: Non-sexp query syntax10513 +Node: General predicates12272 +Node: Ancestor/descendant predicates19259 +Node: Date/time predicates20387 +Node: Functions / Macros23511 +Node: Agenda-like views23809 +Ref: Function org-ql-block23971 +Node: Listing / acting-on results25232 +Ref: Caching25440 +Ref: Function org-ql-select26353 +Ref: Function org-ql-query28779 +Ref: Macro org-ql (deprecated)30553 +Node: Custom predicates30868 +Ref: Macro org-ql-defpred31092 +Node: Dynamic block34533 +Node: Links37257 +Node: Tips37944 +Node: Changelog38268 +Node: 072-pre39053 +Node: 07139446 +Node: 0740259 +Node: 06343183 +Node: 06243714 +Node: 06144019 +Node: 0644587 +Node: 05247641 +Node: 05147941 +Node: 0548364 +Node: 04949895 +Node: 04850177 +Node: 04750526 +Node: 04650935 +Node: 04551343 +Node: 04451704 +Node: 04352063 +Node: 04252266 +Node: 04152427 +Node: 0452674 +Node: 03256775 +Node: 03157178 +Node: 0357375 +Node: 02360675 +Node: 02260909 +Node: 02161189 +Node: 0261394 +Node: 0165472 +Node: Notes65573 +Node: Comparison with Org Agenda searches65735 +Node: org-sidebar66624 +Node: License66903  End Tag Table From 95abce2340efabecc6f07626eb3f28159929709f Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 14 Sep 2023 08:10:49 -0500 Subject: [PATCH 013/145] Fix: (org-ql-completing-read) :query-prefix prevented selection COMPLETING-READ, when used with its REQUIRE-MATCH argument, would not allow a result to be selected when ORG-QL-FIND was called with its QUERY-PREFIX argument. This change moves where the query is modified to include the prefix, putting it into the RUN-QUERY function instead of the COLLECTION function. It seems to solve the problem, and the function seems to still work when used without QUERY-PREFIX. However, due to the complexity of all this (we really need a SELECTING-READ API), it wouldn't surprise me if something is later found to have been broken by it... Fixes #351. Reported-by: Daniel Fleischer --- README.org | 1 + org-ql-completing-read.el | 4 +-- org-ql.info | 66 +++++++++++++++++++++------------------ 3 files changed, 38 insertions(+), 33 deletions(-) diff --git a/README.org b/README.org index 4e499a6..cc926a5 100644 --- a/README.org +++ b/README.org @@ -547,6 +547,7 @@ Simple links may also be written manually in either sexp or non-sexp form, like: *Fixes* + Timestamp predicates are more tolerant of partial input (e.g. preventing errors while the user is typing a query into ~org-ql-find~). + Query parser ignores leading whitespace (e.g. preventing errors while the user is typing a query into ~org-ql-find~). ++ Use of ~org-ql-find~ with ~:query-prefix~ argument prevented selection of results. ([[https://github.com/alphapapa/org-ql/issues/351][#351]]. Thanks to [[https://github.com/danielfleischer][Daniel Fleischer]] for reporting.) ** 0.7.1 diff --git a/org-ql-completing-read.el b/org-ql-completing-read.el index 47b6c35..aa6b887 100644 --- a/org-ql-completing-read.el +++ b/org-ql-completing-read.el @@ -172,8 +172,6 @@ single predicate)." ;; (debug-message "all-completions RETURNS: %S" (all-completions string table pred)) (all-completions string table pred)) (collection (input _pred flag) - (when query-prefix - (setf input (concat query-prefix input))) (pcase flag ('metadata (list 'metadata (cons 'group-function #'group) @@ -224,6 +222,8 @@ single predicate)." `(boundaries 0 . ,(length suffix))))) (run-query (input) ;; (debug-message "RUN-QUERY:%S" input) + (when query-prefix + (setf input (concat query-prefix input))) (unless (or (string-empty-p input) (equal last-input input)) ;; (debug-message "RUN-QUERY:%S RUNNING" input) diff --git a/org-ql.info b/org-ql.info index c120823..f2cf801 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1033,6 +1033,10 @@ File: README.info, Node: 072-pre, Next: 071, Up: Changelog ‘org-ql-find’). • Query parser ignores leading whitespace (e.g. preventing errors while the user is typing a query into ‘org-ql-find’). + • Use of ‘org-ql-find’ with ‘:query-prefix’ argument prevented + selection of results. (#351 + (https://github.com/alphapapa/org-ql/issues/351). Thanks to Daniel + Fleischer (https://github.com/danielfleischer) for reporting.)  File: README.info, Node: 071, Next: 07, Prev: 072-pre, Up: Changelog @@ -1774,37 +1778,37 @@ Node: Links37257 Node: Tips37944 Node: Changelog38268 Node: 072-pre39053 -Node: 07139446 -Node: 0740259 -Node: 06343183 -Node: 06243714 -Node: 06144019 -Node: 0644587 -Node: 05247641 -Node: 05147941 -Node: 0548364 -Node: 04949895 -Node: 04850177 -Node: 04750526 -Node: 04650935 -Node: 04551343 -Node: 04451704 -Node: 04352063 -Node: 04252266 -Node: 04152427 -Node: 0452674 -Node: 03256775 -Node: 03157178 -Node: 0357375 -Node: 02360675 -Node: 02260909 -Node: 02161189 -Node: 0261394 -Node: 0165472 -Node: Notes65573 -Node: Comparison with Org Agenda searches65735 -Node: org-sidebar66624 -Node: License66903 +Node: 07139697 +Node: 0740510 +Node: 06343434 +Node: 06243965 +Node: 06144270 +Node: 0644838 +Node: 05247892 +Node: 05148192 +Node: 0548615 +Node: 04950146 +Node: 04850428 +Node: 04750777 +Node: 04651186 +Node: 04551594 +Node: 04451955 +Node: 04352314 +Node: 04252517 +Node: 04152678 +Node: 0452925 +Node: 03257026 +Node: 03157429 +Node: 0357626 +Node: 02360926 +Node: 02261160 +Node: 02161440 +Node: 0261645 +Node: 0165723 +Node: Notes65824 +Node: Comparison with Org Agenda searches65986 +Node: org-sidebar66875 +Node: License67154  End Tag Table From 8412d1a23d135cf80f850e6a49f9bbbebcb60100 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Fri, 22 Sep 2023 22:08:57 -0500 Subject: [PATCH 014/145] Tidy: Indentation For Emacs 29.1. --- org-ql-completing-read.el | 258 +++++++++++++++++++------------------- 1 file changed, 129 insertions(+), 129 deletions(-) diff --git a/org-ql-completing-read.el b/org-ql-completing-read.el index aa6b887..1c7aa71 100644 --- a/org-ql-completing-read.el +++ b/org-ql-completing-read.el @@ -111,145 +111,145 @@ single predicate)." (cl-labels (;; (debug-message ;; (f &rest args) (apply #'message (concat "ORG-QL-COMPLETING-READ: " f) args)) (action - () (font-lock-ensure (point-at-bol) (point-at-eol)) - ;; FIXME: We want the fontified heading, and `org-heading-components' returns it - ;; without properties, so we have to use `org-get-heading', which added additional - ;; optional arguments in a certain Org version, so in those versions, it will - ;; return priority cookies and comment strings. - (let ((heading (org-link-display-format (org-entry-get (point) "ITEM")))) - (when (gethash heading table) - ;; Disambiguate heading (even adding the path isn't enough, because that could - ;; also be duplicated). - (if-let ((suffix (gethash heading disambiguations))) - (setf heading (format "%s <%s>" heading (cl-incf suffix))) - (setf heading (format "%s <%s>" heading (puthash heading 2 disambiguations))))) - (let ((marker (point-marker))) - (puthash (propertize heading 'org-marker marker) marker table)))) + () (font-lock-ensure (point-at-bol) (point-at-eol)) + ;; FIXME: We want the fontified heading, and `org-heading-components' returns it + ;; without properties, so we have to use `org-get-heading', which added additional + ;; optional arguments in a certain Org version, so in those versions, it will + ;; return priority cookies and comment strings. + (let ((heading (org-link-display-format (org-entry-get (point) "ITEM")))) + (when (gethash heading table) + ;; Disambiguate heading (even adding the path isn't enough, because that could + ;; also be duplicated). + (if-let ((suffix (gethash heading disambiguations))) + (setf heading (format "%s <%s>" heading (cl-incf suffix))) + (setf heading (format "%s <%s>" heading (puthash heading 2 disambiguations))))) + (let ((marker (point-marker))) + (puthash (propertize heading 'org-marker marker) marker table)))) (path (marker) - (org-with-point-at marker - (let* ((path (thread-first (org-get-outline-path nil t) - (org-format-outline-path window-width nil "") - (org-split-string ""))) - (formatted-path (if org-ql-completing-read-reverse-paths - (concat "\\" (string-join (reverse path) "\\")) - (concat "/" (string-join path "/"))))) - formatted-path))) + (org-with-point-at marker + (let* ((path (thread-first (org-get-outline-path nil t) + (org-format-outline-path window-width nil "") + (org-split-string ""))) + (formatted-path (if org-ql-completing-read-reverse-paths + (concat "\\" (string-join (reverse path) "\\")) + (concat "/" (string-join path "/"))))) + formatted-path))) (todo - (marker) (if-let (it (org-entry-get marker "TODO")) - (concat (propertize it 'face (org-get-todo-face it)) " ") - "")) + (marker) (if-let (it (org-entry-get marker "TODO")) + (concat (propertize it 'face (org-get-todo-face it)) " ") + "")) (affix (completions) - ;; (debug-message "AFFIX:%S" completions) - (cl-loop for completion in completions - for marker = (get-text-property 0 'org-marker completion) - for prefix = (todo marker) - for suffix = (concat (path marker) " " (snippet marker)) - collect (list completion prefix suffix))) + ;; (debug-message "AFFIX:%S" completions) + (cl-loop for completion in completions + for marker = (get-text-property 0 'org-marker completion) + for prefix = (todo marker) + for suffix = (concat (path marker) " " (snippet marker)) + collect (list completion prefix suffix))) (annotate (candidate) - ;; (debug-message "ANNOTATE:%S" candidate) - (while-no-input - ;; Using `while-no-input' here doesn't make it as responsive as, - ;; e.g. Helm while typing, but it seems to help a little when using the - ;; org-rifle-style snippets. - (or (snippet (get-text-property 0 'org-marker candidate)) ""))) + ;; (debug-message "ANNOTATE:%S" candidate) + (while-no-input + ;; Using `while-no-input' here doesn't make it as responsive as, + ;; e.g. Helm while typing, but it seems to help a little when using the + ;; org-rifle-style snippets. + (or (snippet (get-text-property 0 'org-marker candidate)) ""))) (snippet - (marker) (when-let - ((snippet - (org-with-point-at marker - (or (funcall org-ql-completing-read-snippet-function snippet-regexp) - (org-ql-completing-read--snippet-simple))))) - (propertize (concat " " snippet) - 'face 'org-ql-completing-read-snippet))) + (marker) (when-let + ((snippet + (org-with-point-at marker + (or (funcall org-ql-completing-read-snippet-function snippet-regexp) + (org-ql-completing-read--snippet-simple))))) + (propertize (concat " " snippet) + 'face 'org-ql-completing-read-snippet))) (group (candidate transform) - (pcase transform - (`nil (buffer-name (marker-buffer (get-text-property 0 'org-marker candidate)))) - (_ candidate))) + (pcase transform + (`nil (buffer-name (marker-buffer (get-text-property 0 'org-marker candidate)))) + (_ candidate))) (try (string _collection _pred point &optional _metadata) - ;; (debug-message "TRY: STRING:%S" string) - (cons string point)) + ;; (debug-message "TRY: STRING:%S" string) + (cons string point)) (all (string table pred _point) - ;; (debug-message "all: STRING:%S" string) - ;; (debug-message "all-completions RETURNS: %S" (all-completions string table pred)) - (all-completions string table pred)) + ;; (debug-message "all: STRING:%S" string) + ;; (debug-message "all-completions RETURNS: %S" (all-completions string table pred)) + (all-completions string table pred)) (collection (input _pred flag) - (pcase flag - ('metadata (list 'metadata - (cons 'group-function #'group) - (cons 'affixation-function #'affix) - (cons 'annotation-function #'annotate))) - (`t - ;; (debug-message "COLLECTION:t INPUT:%S KEYS:%S" - ;; input (hash-table-keys table)) - ;; It's not ideal to call `run-query' unconditionally here, but due to - ;; the complexity of the "Programmed Completion" API, it's basically - ;; necessary, and org-ql's caching should make it nearly free. - (run-query input) - (hash-table-keys table)) - ('lambda - ;; (debug-message "COLLECTION:lambda INPUT:%S KEYS:%S" - ;; input (hash-table-keys table)) - (if (not (hash-table-empty-p table)) - (when (gethash input table) - t) - (run-query input) - (when (gethash input table) - ;; (debug-message "COLLECTION:lambda INPUT:%S FOUND" input) - t))) - (`nil - ;; (debug-message "COLLECTION:nil INPUT:%S" input) - (if (not (hash-table-empty-p table)) - (when (gethash input table) - t) - (run-query input) - ;; (debug-message "COLLECTION:nil INPUT:%S KEYS:%S" - ;; input (hash-table-keys table)) - (cond ((hash-table-empty-p table) - nil) - ((gethash input table) - t) - (t - ;; FIXME: "it should return the longest common prefix - ;; substring of all matches otherwise"...but there's no - ;; function to compute that? At least returning an empty - ;; string doesn't seem to break anything. - input)))) - (`(boundaries . ,suffix) - ;; (debug-message "COLLECTION:boundaries INPUT:%S SUFFIX:%S KEYS:%S" - ;; input suffix (hash-table-keys table)) - ;; FIXME: This is unlikely to be correct, but I'm not even sure if it - ;; can be correct in this case since the input (e.g. "todo: foo") - ;; usually won't match a completion candidate directly. - `(boundaries 0 . ,(length suffix))))) + (pcase flag + ('metadata (list 'metadata + (cons 'group-function #'group) + (cons 'affixation-function #'affix) + (cons 'annotation-function #'annotate))) + (`t + ;; (debug-message "COLLECTION:t INPUT:%S KEYS:%S" + ;; input (hash-table-keys table)) + ;; It's not ideal to call `run-query' unconditionally here, but due to + ;; the complexity of the "Programmed Completion" API, it's basically + ;; necessary, and org-ql's caching should make it nearly free. + (run-query input) + (hash-table-keys table)) + ('lambda + ;; (debug-message "COLLECTION:lambda INPUT:%S KEYS:%S" + ;; input (hash-table-keys table)) + (if (not (hash-table-empty-p table)) + (when (gethash input table) + t) + (run-query input) + (when (gethash input table) + ;; (debug-message "COLLECTION:lambda INPUT:%S FOUND" input) + t))) + (`nil + ;; (debug-message "COLLECTION:nil INPUT:%S" input) + (if (not (hash-table-empty-p table)) + (when (gethash input table) + t) + (run-query input) + ;; (debug-message "COLLECTION:nil INPUT:%S KEYS:%S" + ;; input (hash-table-keys table)) + (cond ((hash-table-empty-p table) + nil) + ((gethash input table) + t) + (t + ;; FIXME: "it should return the longest common prefix + ;; substring of all matches otherwise"...but there's no + ;; function to compute that? At least returning an empty + ;; string doesn't seem to break anything. + input)))) + (`(boundaries . ,suffix) + ;; (debug-message "COLLECTION:boundaries INPUT:%S SUFFIX:%S KEYS:%S" + ;; input suffix (hash-table-keys table)) + ;; FIXME: This is unlikely to be correct, but I'm not even sure if it + ;; can be correct in this case since the input (e.g. "todo: foo") + ;; usually won't match a completion candidate directly. + `(boundaries 0 . ,(length suffix))))) (run-query (input) - ;; (debug-message "RUN-QUERY:%S" input) - (when query-prefix - (setf input (concat query-prefix input))) - (unless (or (string-empty-p input) - (equal last-input input)) - ;; (debug-message "RUN-QUERY:%S RUNNING" input) - (setf last-input input) - ;; Clear hash table each time the user changes the input. - (clrhash table) - (clrhash disambiguations) - (when query-filter - (setf input (funcall query-filter input))) - (pcase org-ql-completing-read-snippet-function - ('org-ql-completing-read--snippet-regexp - (setf query-tokens - ;; Remove any tokens that specify predicates or are too short. - (--select (not (or (string-match-p (rx bos (1+ (not (any ":"))) ":") it) - (< (length it) org-ql-completing-read-snippet-minimum-token-length))) - (split-string input nil t (rx space))) - snippet-regexp - (when query-tokens - ;; Limiting each context word to 15 characters prevents - ;; excessively long, non-word strings from ending up in - ;; snippets, which can adversely affect performance. - (rx-to-string `(seq (optional (repeat 1 3 (repeat 1 15 (not space)) (0+ space))) - bow (or ,@query-tokens) (0+ (not space)) - (optional (repeat 1 3 (0+ space) (repeat 1 15 (not space)))))))))) - (org-ql-select buffers-files (org-ql--query-string-to-sexp input) - :action #'action)))) + ;; (debug-message "RUN-QUERY:%S" input) + (when query-prefix + (setf input (concat query-prefix input))) + (unless (or (string-empty-p input) + (equal last-input input)) + ;; (debug-message "RUN-QUERY:%S RUNNING" input) + (setf last-input input) + ;; Clear hash table each time the user changes the input. + (clrhash table) + (clrhash disambiguations) + (when query-filter + (setf input (funcall query-filter input))) + (pcase org-ql-completing-read-snippet-function + ('org-ql-completing-read--snippet-regexp + (setf query-tokens + ;; Remove any tokens that specify predicates or are too short. + (--select (not (or (string-match-p (rx bos (1+ (not (any ":"))) ":") it) + (< (length it) org-ql-completing-read-snippet-minimum-token-length))) + (split-string input nil t (rx space))) + snippet-regexp + (when query-tokens + ;; Limiting each context word to 15 characters prevents + ;; excessively long, non-word strings from ending up in + ;; snippets, which can adversely affect performance. + (rx-to-string `(seq (optional (repeat 1 3 (repeat 1 15 (not space)) (0+ space))) + bow (or ,@query-tokens) (0+ (not space)) + (optional (repeat 1 3 (0+ space) (repeat 1 15 (not space)))))))))) + (org-ql-select buffers-files (org-ql--query-string-to-sexp input) + :action #'action)))) ;; NOTE: It seems that the `completing-read' machinery can call, abort, and re-call the ;; collection function while the user is typing, which can interrupt the machinery Org uses to ;; prepare an Org buffer when an Org file is loaded. This results in, e.g. the buffer being From be20dc3d5b47f4b01de3db571c936dc4c156e2cb Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Tue, 26 Sep 2023 13:41:07 -0500 Subject: [PATCH 015/145] Fix: (org-ql-find) Use org-with-point-at I keep pointing out to other people that they should use org-with-point-at, but I still have places in my own code where I need to use it, too! --- README.org | 1 + org-ql-find.el | 3 +-- org-ql.info | 63 +++++++++++++++++++++++++------------------------- 3 files changed, 34 insertions(+), 33 deletions(-) diff --git a/README.org b/README.org index cc926a5..c2dbe85 100644 --- a/README.org +++ b/README.org @@ -548,6 +548,7 @@ Simple links may also be written manually in either sexp or non-sexp form, like: + Timestamp predicates are more tolerant of partial input (e.g. preventing errors while the user is typing a query into ~org-ql-find~). + Query parser ignores leading whitespace (e.g. preventing errors while the user is typing a query into ~org-ql-find~). + Use of ~org-ql-find~ with ~:query-prefix~ argument prevented selection of results. ([[https://github.com/alphapapa/org-ql/issues/351][#351]]. Thanks to [[https://github.com/danielfleischer][Daniel Fleischer]] for reporting.) ++ Handle narrowed buffers correctly in ~org-ql-find~. ** 0.7.1 diff --git a/org-ql-find.el b/org-ql-find.el index 9483c61..dd9fea9 100644 --- a/org-ql-find.el +++ b/org-ql-find.el @@ -83,8 +83,7 @@ single predicate)." :query-prefix query-prefix :query-filter query-filter :prompt prompt))) - (with-current-buffer (marker-buffer marker) - (goto-char marker) + (org-with-point-at marker (display-buffer (current-buffer) org-ql-find-display-buffer-action) (select-window (get-buffer-window (current-buffer))) (run-hook-with-args 'org-ql-find-goto-hook)))) diff --git a/org-ql.info b/org-ql.info index f2cf801..61ea89d 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1037,6 +1037,7 @@ File: README.info, Node: 072-pre, Next: 071, Up: Changelog selection of results. (#351 (https://github.com/alphapapa/org-ql/issues/351). Thanks to Daniel Fleischer (https://github.com/danielfleischer) for reporting.) + • Handle narrowed buffers correctly in ‘org-ql-find’.  File: README.info, Node: 071, Next: 07, Prev: 072-pre, Up: Changelog @@ -1778,37 +1779,37 @@ Node: Links37257 Node: Tips37944 Node: Changelog38268 Node: 072-pre39053 -Node: 07139697 -Node: 0740510 -Node: 06343434 -Node: 06243965 -Node: 06144270 -Node: 0644838 -Node: 05247892 -Node: 05148192 -Node: 0548615 -Node: 04950146 -Node: 04850428 -Node: 04750777 -Node: 04651186 -Node: 04551594 -Node: 04451955 -Node: 04352314 -Node: 04252517 -Node: 04152678 -Node: 0452925 -Node: 03257026 -Node: 03157429 -Node: 0357626 -Node: 02360926 -Node: 02261160 -Node: 02161440 -Node: 0261645 -Node: 0165723 -Node: Notes65824 -Node: Comparison with Org Agenda searches65986 -Node: org-sidebar66875 -Node: License67154 +Node: 07139760 +Node: 0740573 +Node: 06343497 +Node: 06244028 +Node: 06144333 +Node: 0644901 +Node: 05247955 +Node: 05148255 +Node: 0548678 +Node: 04950209 +Node: 04850491 +Node: 04750840 +Node: 04651249 +Node: 04551657 +Node: 04452018 +Node: 04352377 +Node: 04252580 +Node: 04152741 +Node: 0452988 +Node: 03257089 +Node: 03157492 +Node: 0357689 +Node: 02360989 +Node: 02261223 +Node: 02161503 +Node: 0261708 +Node: 0165786 +Node: Notes65887 +Node: Comparison with Org Agenda searches66049 +Node: org-sidebar66938 +Node: License67217  End Tag Table From 56e203110b3823ff738379fcb910f78eb52d35c5 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Tue, 26 Sep 2023 20:48:59 -0500 Subject: [PATCH 016/145] Fix: (org-ql-completing-read) Warn about empty headings --- README.org | 1 + org-ql-completing-read.el | 22 ++++++++----- org-ql.info | 65 ++++++++++++++++++++------------------- 3 files changed, 49 insertions(+), 39 deletions(-) diff --git a/README.org b/README.org index c2dbe85..052f8b9 100644 --- a/README.org +++ b/README.org @@ -549,6 +549,7 @@ Simple links may also be written manually in either sexp or non-sexp form, like: + Query parser ignores leading whitespace (e.g. preventing errors while the user is typing a query into ~org-ql-find~). + Use of ~org-ql-find~ with ~:query-prefix~ argument prevented selection of results. ([[https://github.com/alphapapa/org-ql/issues/351][#351]]. Thanks to [[https://github.com/danielfleischer][Daniel Fleischer]] for reporting.) + Handle narrowed buffers correctly in ~org-ql-find~. ++ Warn about empty headings in ~org-ql-completing-read~ (the Org format allows a heading line to have no text, but it's useless for this purpose, and usually indicates unnoticed corruption). ** 0.7.1 diff --git a/org-ql-completing-read.el b/org-ql-completing-read.el index 1c7aa71..0c4e70e 100644 --- a/org-ql-completing-read.el +++ b/org-ql-completing-read.el @@ -117,14 +117,20 @@ single predicate)." ;; optional arguments in a certain Org version, so in those versions, it will ;; return priority cookies and comment strings. (let ((heading (org-link-display-format (org-entry-get (point) "ITEM")))) - (when (gethash heading table) - ;; Disambiguate heading (even adding the path isn't enough, because that could - ;; also be duplicated). - (if-let ((suffix (gethash heading disambiguations))) - (setf heading (format "%s <%s>" heading (cl-incf suffix))) - (setf heading (format "%s <%s>" heading (puthash heading 2 disambiguations))))) - (let ((marker (point-marker))) - (puthash (propertize heading 'org-marker marker) marker table)))) + (if (string-empty-p heading) + ;; A heading's string can be empty, but we can't use one because it + ;; wouldn't be useful to the user; and if one is found, it's very + ;; likely to indicate an unnoticed mistake or corruption in the + ;; file: so display a warning and don't record it as a candidate. + (warn "Empty heading at %S in %S" (point) (buffer-name)) + (when (gethash heading table) + ;; Disambiguate heading (even adding the path isn't enough, because that could + ;; also be duplicated). + (if-let ((suffix (gethash heading disambiguations))) + (setf heading (format "%s <%s>" heading (cl-incf suffix))) + (setf heading (format "%s <%s>" heading (puthash heading 2 disambiguations))))) + (let ((marker (point-marker))) + (puthash (propertize heading 'org-marker marker) marker table))))) (path (marker) (org-with-point-at marker (let* ((path (thread-first (org-get-outline-path nil t) diff --git a/org-ql.info b/org-ql.info index 61ea89d..066a184 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1038,6 +1038,9 @@ File: README.info, Node: 072-pre, Next: 071, Up: Changelog (https://github.com/alphapapa/org-ql/issues/351). Thanks to Daniel Fleischer (https://github.com/danielfleischer) for reporting.) • Handle narrowed buffers correctly in ‘org-ql-find’. + • Warn about empty headings in ‘org-ql-completing-read’ (the Org + format allows a heading line to have no text, but it’s useless for + this purpose, and usually indicates unnoticed corruption).  File: README.info, Node: 071, Next: 07, Prev: 072-pre, Up: Changelog @@ -1779,37 +1782,37 @@ Node: Links37257 Node: Tips37944 Node: Changelog38268 Node: 072-pre39053 -Node: 07139760 -Node: 0740573 -Node: 06343497 -Node: 06244028 -Node: 06144333 -Node: 0644901 -Node: 05247955 -Node: 05148255 -Node: 0548678 -Node: 04950209 -Node: 04850491 -Node: 04750840 -Node: 04651249 -Node: 04551657 -Node: 04452018 -Node: 04352377 -Node: 04252580 -Node: 04152741 -Node: 0452988 -Node: 03257089 -Node: 03157492 -Node: 0357689 -Node: 02360989 -Node: 02261223 -Node: 02161503 -Node: 0261708 -Node: 0165786 -Node: Notes65887 -Node: Comparison with Org Agenda searches66049 -Node: org-sidebar66938 -Node: License67217 +Node: 07139972 +Node: 0740785 +Node: 06343709 +Node: 06244240 +Node: 06144545 +Node: 0645113 +Node: 05248167 +Node: 05148467 +Node: 0548890 +Node: 04950421 +Node: 04850703 +Node: 04751052 +Node: 04651461 +Node: 04551869 +Node: 04452230 +Node: 04352589 +Node: 04252792 +Node: 04152953 +Node: 0453200 +Node: 03257301 +Node: 03157704 +Node: 0357901 +Node: 02361201 +Node: 02261435 +Node: 02161715 +Node: 0261920 +Node: 0165998 +Node: Notes66099 +Node: Comparison with Org Agenda searches66261 +Node: org-sidebar67150 +Node: License67429  End Tag Table From f9d4f6241546166f98b5b3b74db4f4532620235a Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 27 Sep 2023 00:21:21 -0500 Subject: [PATCH 017/145] Release: v0.7.2 --- README.org | 2 +- org-ql.el | 2 +- org-ql.info | 144 ++++++++++++++++++++++++++-------------------------- 3 files changed, 74 insertions(+), 74 deletions(-) diff --git a/README.org b/README.org index 052f8b9..6ff4a0f 100644 --- a/README.org +++ b/README.org @@ -542,7 +542,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.7.2-pre +** 0.7.2 *Fixes* + Timestamp predicates are more tolerant of partial input (e.g. preventing errors while the user is typing a query into ~org-ql-find~). diff --git a/org-ql.el b/org-ql.el index 2a54768..9a3878b 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.7.2-pre +;; Version: 0.7.2 ;; Package-Requires: ((emacs "26.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 066a184..c1e5e13 100644 --- a/org-ql.info +++ b/org-ql.info @@ -71,7 +71,7 @@ Functions / Macros Changelog -* 0.7.2-pre: 072-pre. +* 0.7.2: 072. * 0.7.1: 071. * 0.7: 07. * 0.6.3: 063. @@ -992,7 +992,7 @@ releases. * Menu: -* 0.7.2-pre: 072-pre. +* 0.7.2: 072. * 0.7.1: 071. * 0.7: 07. * 0.6.3: 063. @@ -1022,10 +1022,10 @@ releases. * 0.1: 01.  -File: README.info, Node: 072-pre, Next: 071, Up: Changelog +File: README.info, Node: 072, Next: 071, Up: Changelog -5.1 0.7.2-pre -============= +5.1 0.7.2 +========= *Fixes* • Timestamp predicates are more tolerant of partial input (e.g. @@ -1043,7 +1043,7 @@ File: README.info, Node: 072-pre, Next: 071, Up: Changelog this purpose, and usually indicates unnoticed corruption).  -File: README.info, Node: 071, Next: 07, Prev: 072-pre, Up: Changelog +File: README.info, Node: 071, Next: 07, Prev: 072, Up: Changelog 5.2 0.7.1 ========= @@ -1747,72 +1747,72 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1799 -Node: Screenshots1922 -Node: Installation2040 -Node: Quelpa2554 -Node: Helm support3082 -Node: Usage3485 -Node: Commands3883 -Node: org-ql-find4327 -Node: org-ql-refile4793 -Node: org-ql-search5116 -Node: helm-org-ql6812 -Node: org-ql-view7190 -Node: org-ql-view-sidebar7720 -Node: org-ql-view-recent-items8100 -Node: org-ql-sparse-tree8596 -Node: Queries9396 -Node: Non-sexp query syntax10513 -Node: General predicates12272 -Node: Ancestor/descendant predicates19259 -Node: Date/time predicates20387 -Node: Functions / Macros23511 -Node: Agenda-like views23809 -Ref: Function org-ql-block23971 -Node: Listing / acting-on results25232 -Ref: Caching25440 -Ref: Function org-ql-select26353 -Ref: Function org-ql-query28779 -Ref: Macro org-ql (deprecated)30553 -Node: Custom predicates30868 -Ref: Macro org-ql-defpred31092 -Node: Dynamic block34533 -Node: Links37257 -Node: Tips37944 -Node: Changelog38268 -Node: 072-pre39053 -Node: 07139972 -Node: 0740785 -Node: 06343709 -Node: 06244240 -Node: 06144545 -Node: 0645113 -Node: 05248167 -Node: 05148467 -Node: 0548890 -Node: 04950421 -Node: 04850703 -Node: 04751052 -Node: 04651461 -Node: 04551869 -Node: 04452230 -Node: 04352589 -Node: 04252792 -Node: 04152953 -Node: 0453200 -Node: 03257301 -Node: 03157704 -Node: 0357901 -Node: 02361201 -Node: 02261435 -Node: 02161715 -Node: 0261920 -Node: 0165998 -Node: Notes66099 -Node: Comparison with Org Agenda searches66261 -Node: org-sidebar67150 -Node: License67429 +Node: Contents1791 +Node: Screenshots1914 +Node: Installation2032 +Node: Quelpa2546 +Node: Helm support3074 +Node: Usage3477 +Node: Commands3875 +Node: org-ql-find4319 +Node: org-ql-refile4785 +Node: org-ql-search5108 +Node: helm-org-ql6804 +Node: org-ql-view7182 +Node: org-ql-view-sidebar7712 +Node: org-ql-view-recent-items8092 +Node: org-ql-sparse-tree8588 +Node: Queries9388 +Node: Non-sexp query syntax10505 +Node: General predicates12264 +Node: Ancestor/descendant predicates19251 +Node: Date/time predicates20379 +Node: Functions / Macros23503 +Node: Agenda-like views23801 +Ref: Function org-ql-block23963 +Node: Listing / acting-on results25224 +Ref: Caching25432 +Ref: Function org-ql-select26345 +Ref: Function org-ql-query28771 +Ref: Macro org-ql (deprecated)30545 +Node: Custom predicates30860 +Ref: Macro org-ql-defpred31084 +Node: Dynamic block34525 +Node: Links37249 +Node: Tips37936 +Node: Changelog38260 +Node: 07239037 +Node: 07139944 +Node: 0740753 +Node: 06343677 +Node: 06244208 +Node: 06144513 +Node: 0645081 +Node: 05248135 +Node: 05148435 +Node: 0548858 +Node: 04950389 +Node: 04850671 +Node: 04751020 +Node: 04651429 +Node: 04551837 +Node: 04452198 +Node: 04352557 +Node: 04252760 +Node: 04152921 +Node: 0453168 +Node: 03257269 +Node: 03157672 +Node: 0357869 +Node: 02361169 +Node: 02261403 +Node: 02161683 +Node: 0261888 +Node: 0165966 +Node: Notes66067 +Node: Comparison with Org Agenda searches66229 +Node: org-sidebar67118 +Node: License67397  End Tag Table From 0a0291288e17cd85b67cc95d21dc3dc875d6597b Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 27 Sep 2023 13:36:18 -0500 Subject: [PATCH 018/145] Meta: v0.8-pre --- README.org | 4 ++++ org-ql.el | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.org b/README.org index 6ff4a0f..97cb1af 100644 --- a/README.org +++ b/README.org @@ -542,6 +542,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-pre + +Nothing new yet. + ** 0.7.2 *Fixes* diff --git a/org-ql.el b/org-ql.el index 9a3878b..cf669c4 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.7.2 +;; Version: 0.8-pre ;; Package-Requires: ((emacs "26.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 From 0e702ecb484673f8f8d85884f038fc0e84cb9bd3 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Mon, 4 Sep 2023 14:49:10 -0500 Subject: [PATCH 019/145] Change: Resolve Org element properties on 9.7+ See #364. --- org-ql-view.el | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/org-ql-view.el b/org-ql-view.el index d771d12..bbdada9 100644 --- a/org-ql-view.el +++ b/org-ql-view.el @@ -818,6 +818,20 @@ When opened, the link searches the buffer it's opened from." ;;;; Faces/properties +(defalias 'org-ql-view--resolve-element-properties + ;; It would be preferable to define this as an inline function, but + ;; that would mean that users would have to recompile org-ql when + ;; upgrading to Org 9.7 or else get weird errors. + ;; TODO(someday): Define `org-ql-view--resolve-element-properties' as inline. + (if (version<= "9.7" org-version) + (lambda (node) + "Resolve NODE's properties using `org-element-properties-resolve'." + ;; Silence warnings about `org-element-properties-resolve' + ;; being unresolved on earlier Org versions. + (with-no-warnings + (org-element-properties-resolve node 'force-undefer))) + #'identity)) + (defun org-ql-view--format-element (element) ;; This essentially needs to do what `org-agenda-format-item' does, ;; which is a lot. We are a long way from that, but it's a start. @@ -827,6 +841,7 @@ returned by `org-element-parse-buffer'. If ELEMENT is nil, return an empty string." (if (not element) "" + (setf element (org-ql-view--resolve-element-properties element)) (let* ((properties (cadr element)) ;; Remove the :parent property, which so bloats the size of ;; the properties list that it makes it essentially From 9e72bf694725adb9f1d256a4d52d6ceb7d71c6f1 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Tue, 12 Sep 2023 17:28:31 -0500 Subject: [PATCH 020/145] Fix: (org-ql-view--format-element) Check habit in source buffer See #364. --- org-ql-view.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/org-ql-view.el b/org-ql-view.el index bbdada9..c81bcd7 100644 --- a/org-ql-view.el +++ b/org-ql-view.el @@ -892,7 +892,8 @@ return an empty string." (char-to-string) (format "[#%s]") (org-ql-view--add-priority-face))) - (habit-property (org-with-point-at (org-element-property :begin element) + (habit-property (org-with-point-at (or (org-element-property :org-hd-marker element) + (org-element-property :org-marker element)) (when (org-is-habit-p) (org-habit-parse-todo)))) (due-string (pcase (org-element-property :relative-due-date element) From 5c9d4cdb485da19546bd2a7eb5407ebe528ce1cc Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 27 Sep 2023 13:40:30 -0500 Subject: [PATCH 021/145] Docs: Update changelog --- README.org | 3 +- org-ql.info | 207 ++++++++++++++++++++++++++++------------------------ 2 files changed, 113 insertions(+), 97 deletions(-) diff --git a/README.org b/README.org index 97cb1af..3b50485 100644 --- a/README.org +++ b/README.org @@ -544,7 +544,8 @@ Simple links may also be written manually in either sexp or non-sexp form, like: ** 0.8-pre -Nothing new yet. +*Compatibility* ++ Org v9.7's ~org-element~ API changes required some adjustments. ([[https://github.com/alphapapa/org-ql/issues/364][#364]]. Thanks to several users for reporting, and to [[https://github.com/yantar92][Ihor Radchenko]] for his feedback.) ** 0.7.2 diff --git a/org-ql.info b/org-ql.info index c1e5e13..10eeb2f 100644 --- a/org-ql.info +++ b/org-ql.info @@ -71,6 +71,7 @@ Functions / Macros Changelog +* 0.8-pre: 08-pre. * 0.7.2: 072. * 0.7.1: 071. * 0.7: 07. @@ -992,6 +993,7 @@ releases. * Menu: +* 0.8-pre: 08-pre. * 0.7.2: 072. * 0.7.1: 071. * 0.7: 07. @@ -1022,9 +1024,21 @@ releases. * 0.1: 01.  -File: README.info, Node: 072, Next: 071, Up: Changelog +File: README.info, Node: 08-pre, Next: 072, Up: Changelog -5.1 0.7.2 +5.1 0.8-pre +=========== + +*Compatibility* + • Org v9.7’s ‘org-element’ API changes required some adjustments. + (#364 (https://github.com/alphapapa/org-ql/issues/364). Thanks to + several users for reporting, and to Ihor Radchenko + (https://github.com/yantar92) for his feedback.) + + +File: README.info, Node: 072, Next: 071, Prev: 08-pre, Up: Changelog + +5.2 0.7.2 ========= *Fixes* @@ -1045,7 +1059,7 @@ File: README.info, Node: 072, Next: 071, Up: Changelog  File: README.info, Node: 071, Next: 07, Prev: 072, Up: Changelog -5.2 0.7.1 +5.3 0.7.1 ========= *Fixes* @@ -1064,7 +1078,7 @@ File: README.info, Node: 071, Next: 07, Prev: 072, Up: Changelog  File: README.info, Node: 07, Next: 063, Prev: 071, Up: Changelog -5.3 0.7 +5.4 0.7 ======= *Added* @@ -1124,7 +1138,7 @@ File: README.info, Node: 07, Next: 063, Prev: 071, Up: Changelog  File: README.info, Node: 063, Next: 062, Prev: 07, Up: Changelog -5.4 0.6.3 +5.5 0.6.3 ========= *Fixed* @@ -1140,7 +1154,7 @@ File: README.info, Node: 063, Next: 062, Prev: 07, Up: Changelog  File: README.info, Node: 062, Next: 061, Prev: 063, Up: Changelog -5.5 0.6.2 +5.6 0.6.2 ========= *Fixed* @@ -1151,7 +1165,7 @@ File: README.info, Node: 062, Next: 061, Prev: 063, Up: Changelog  File: README.info, Node: 061, Next: 06, Prev: 062, Up: Changelog -5.6 0.6.1 +5.7 0.6.1 ========= *Fixed* @@ -1169,7 +1183,7 @@ File: README.info, Node: 061, Next: 06, Prev: 062, Up: Changelog  File: README.info, Node: 06, Next: 052, Prev: 061, Up: Changelog -5.7 0.6 +5.8 0.6 ======= *Added* @@ -1236,7 +1250,7 @@ File: README.info, Node: 06, Next: 052, Prev: 061, Up: Changelog  File: README.info, Node: 052, Next: 051, Prev: 06, Up: Changelog -5.8 0.5.2 +5.9 0.5.2 ========= *Fixed* @@ -1247,8 +1261,8 @@ File: README.info, Node: 052, Next: 051, Prev: 06, Up: Changelog  File: README.info, Node: 051, Next: 05, Prev: 052, Up: Changelog -5.9 0.5.1 -========= +5.10 0.5.1 +========== *Fixed* • Custom sorting functions could corrupt the cache, causing items to @@ -1260,7 +1274,7 @@ File: README.info, Node: 051, Next: 05, Prev: 052, Up: Changelog  File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog -5.10 0.5 +5.11 0.5 ======== *Added* @@ -1301,7 +1315,7 @@ File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog  File: README.info, Node: 049, Next: 048, Prev: 05, Up: Changelog -5.11 0.4.9 +5.12 0.4.9 ========== *Fixed* @@ -1312,7 +1326,7 @@ File: README.info, Node: 049, Next: 048, Prev: 05, Up: Changelog  File: README.info, Node: 048, Next: 047, Prev: 049, Up: Changelog -5.12 0.4.8 +5.13 0.4.8 ========== *Fixed* @@ -1324,7 +1338,7 @@ File: README.info, Node: 048, Next: 047, Prev: 049, Up: Changelog  File: README.info, Node: 047, Next: 046, Prev: 048, Up: Changelog -5.13 0.4.7 +5.14 0.4.7 ========== *Fixed* @@ -1337,7 +1351,7 @@ File: README.info, Node: 047, Next: 046, Prev: 048, Up: Changelog  File: README.info, Node: 046, Next: 045, Prev: 047, Up: Changelog -5.14 0.4.6 +5.15 0.4.6 ========== *Fixed* @@ -1350,7 +1364,7 @@ File: README.info, Node: 046, Next: 045, Prev: 047, Up: Changelog  File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog -5.15 0.4.5 +5.16 0.4.5 ========== *Fixed* @@ -1362,7 +1376,7 @@ File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog  File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog -5.16 0.4.4 +5.17 0.4.4 ========== *Fixed* @@ -1374,7 +1388,7 @@ File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog  File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog -5.17 0.4.3 +5.18 0.4.3 ========== *Fixed* @@ -1384,7 +1398,7 @@ File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog  File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog -5.18 0.4.2 +5.19 0.4.2 ========== *Fixed* @@ -1393,7 +1407,7 @@ File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog  File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog -5.19 0.4.1 +5.20 0.4.1 ========== *Fixed* @@ -1403,7 +1417,7 @@ File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog  File: README.info, Node: 04, Next: 032, Prev: 041, Up: Changelog -5.20 0.4 +5.21 0.4 ======== _Note:_ The next release, 0.5, may include changes which will require @@ -1484,7 +1498,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.21 0.3.2 +5.22 0.3.2 ========== *Fixed* @@ -1497,7 +1511,7 @@ File: README.info, Node: 032, Next: 031, Prev: 04, Up: Changelog  File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog -5.22 0.3.1 +5.23 0.3.1 ========== *Fixed* @@ -1507,7 +1521,7 @@ File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog  File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog -5.23 0.3 +5.24 0.3 ======== *Added* @@ -1575,7 +1589,7 @@ File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog  File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog -5.24 0.2.3 +5.25 0.2.3 ========== *Fixed* @@ -1585,7 +1599,7 @@ File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog  File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog -5.25 0.2.2 +5.26 0.2.2 ========== *Fixed* @@ -1596,7 +1610,7 @@ File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog  File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog -5.26 0.2.1 +5.27 0.2.1 ========== *Fixed* @@ -1606,7 +1620,7 @@ File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog  File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog -5.27 0.2 +5.28 0.2 ======== *Added* @@ -1689,7 +1703,7 @@ File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog  File: README.info, Node: 01, Prev: 02, Up: Changelog -5.28 0.1 +5.29 0.1 ======== First tagged release. @@ -1747,72 +1761,73 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1791 -Node: Screenshots1914 -Node: Installation2032 -Node: Quelpa2546 -Node: Helm support3074 -Node: Usage3477 -Node: Commands3875 -Node: org-ql-find4319 -Node: org-ql-refile4785 -Node: org-ql-search5108 -Node: helm-org-ql6804 -Node: org-ql-view7182 -Node: org-ql-view-sidebar7712 -Node: org-ql-view-recent-items8092 -Node: org-ql-sparse-tree8588 -Node: Queries9388 -Node: Non-sexp query syntax10505 -Node: General predicates12264 -Node: Ancestor/descendant predicates19251 -Node: Date/time predicates20379 -Node: Functions / Macros23503 -Node: Agenda-like views23801 -Ref: Function org-ql-block23963 -Node: Listing / acting-on results25224 -Ref: Caching25432 -Ref: Function org-ql-select26345 -Ref: Function org-ql-query28771 -Ref: Macro org-ql (deprecated)30545 -Node: Custom predicates30860 -Ref: Macro org-ql-defpred31084 -Node: Dynamic block34525 -Node: Links37249 -Node: Tips37936 -Node: Changelog38260 -Node: 07239037 -Node: 07139944 -Node: 0740753 -Node: 06343677 -Node: 06244208 -Node: 06144513 -Node: 0645081 -Node: 05248135 -Node: 05148435 -Node: 0548858 -Node: 04950389 -Node: 04850671 -Node: 04751020 -Node: 04651429 -Node: 04551837 -Node: 04452198 -Node: 04352557 -Node: 04252760 -Node: 04152921 -Node: 0453168 -Node: 03257269 -Node: 03157672 -Node: 0357869 -Node: 02361169 -Node: 02261403 -Node: 02161683 -Node: 0261888 -Node: 0165966 -Node: Notes66067 -Node: Comparison with Org Agenda searches66229 -Node: org-sidebar67118 -Node: License67397 +Node: Contents1810 +Node: Screenshots1933 +Node: Installation2051 +Node: Quelpa2565 +Node: Helm support3093 +Node: Usage3496 +Node: Commands3894 +Node: org-ql-find4338 +Node: org-ql-refile4804 +Node: org-ql-search5127 +Node: helm-org-ql6823 +Node: org-ql-view7201 +Node: org-ql-view-sidebar7731 +Node: org-ql-view-recent-items8111 +Node: org-ql-sparse-tree8607 +Node: Queries9407 +Node: Non-sexp query syntax10524 +Node: General predicates12283 +Node: Ancestor/descendant predicates19270 +Node: Date/time predicates20398 +Node: Functions / Macros23522 +Node: Agenda-like views23820 +Ref: Function org-ql-block23982 +Node: Listing / acting-on results25243 +Ref: Caching25451 +Ref: Function org-ql-select26364 +Ref: Function org-ql-query28790 +Ref: Macro org-ql (deprecated)30564 +Node: Custom predicates30879 +Ref: Macro org-ql-defpred31103 +Node: Dynamic block34544 +Node: Links37268 +Node: Tips37955 +Node: Changelog38279 +Node: 08-pre39075 +Node: 07239440 +Node: 07140362 +Node: 0741171 +Node: 06344095 +Node: 06244626 +Node: 06144931 +Node: 0645499 +Node: 05248553 +Node: 05148853 +Node: 0549278 +Node: 04950809 +Node: 04851091 +Node: 04751440 +Node: 04651849 +Node: 04552257 +Node: 04452618 +Node: 04352977 +Node: 04253180 +Node: 04153341 +Node: 0453588 +Node: 03257689 +Node: 03158092 +Node: 0358289 +Node: 02361589 +Node: 02261823 +Node: 02162103 +Node: 0262308 +Node: 0166386 +Node: Notes66487 +Node: Comparison with Org Agenda searches66649 +Node: org-sidebar67538 +Node: License67817  End Tag Table From 641ec0ac5094d075d46a95fc18747085bed45a49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Antol=C3=ADn=20Camarena?= Date: Fri, 8 Sep 2023 13:55:36 -0600 Subject: [PATCH 022/145] Add category metadatum to org-ql-completing-read This is all that is needed to gain support for Embark actions on org-ql-find candidates. --- org-ql-completing-read.el | 1 + 1 file changed, 1 insertion(+) diff --git a/org-ql-completing-read.el b/org-ql-completing-read.el index 0c4e70e..e224e4b 100644 --- a/org-ql-completing-read.el +++ b/org-ql-completing-read.el @@ -180,6 +180,7 @@ single predicate)." (collection (input _pred flag) (pcase flag ('metadata (list 'metadata + (cons 'category 'org-heading) (cons 'group-function #'group) (cons 'affixation-function #'affix) (cons 'annotation-function #'annotate))) From a41dfe25ea2ae56dba66a13bf48749df63cf537d Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 27 Sep 2023 15:02:40 -0500 Subject: [PATCH 023/145] Docs: Update changelog, usage --- README.org | 9 ++++ org-ql.info | 144 ++++++++++++++++++++++++++++++---------------------- 2 files changed, 93 insertions(+), 60 deletions(-) diff --git a/README.org b/README.org index 3b50485..fe5e9af 100644 --- a/README.org +++ b/README.org @@ -114,6 +114,8 @@ These commands jump to a heading selected using Emacs's built-in completion faci - ~org-ql-find-in-agenda~ searches in ~(org-agenda-files)~. - ~org-ql-find-in-org-directory~ searches in ~org-directory~. +Note that these commands are compatible with [[https://github.com/oantolin/embark][Embark]]: the ~embark-act~ command can be called on a completion candidate (i.e. a search result) to act on it immediately, without having to visit the entry in its source Org buffer. + [[images/org-ql-find.png]] *** org-ql-refile @@ -146,6 +148,8 @@ Read ~QUERY~ and search with ~org-ql~. Interactively, prompt for these variable *Note:* The view buffer is currently put in ~org-agenda-mode~, which means that /some/ Org Agenda commands work, such as jumping to entries and changing item priorities (without necessarily updating the view). This feature is experimental and not guaranteed to work correctly with all commands. (It works to the extent it does because the appropriate text properties are placed on each item, imitating an Agenda buffer.) +*Note:* Also, this buffer is compatible with [[https://github.com/oantolin/embark][Embark]]: the ~embark-act~ command can be called on an entry to act on it immediately, without having to visit the entry in its source Org buffer. + *** helm-org-ql /Note: This command uses [[#non-sexp-query-syntax][non-sexp queries]]. It is available separately in the package =helm-org-ql=./ @@ -544,7 +548,12 @@ Simple links may also be written manually in either sexp or non-sexp form, like: ** 0.8-pre +*Additions* + ++ Function ~org-ql-completing-read~, used by command ~org-ql-find~, now specifies the completion category as ~org-heading~, providing compatibility with [[https://github.com/oantolin/embark][Embark]]. (This is a powerful feature, as it means any ~org-ql-find~ result can be acted on from inside the search results with Embark, which provides common actions from Org Agenda and Org speed keys bindings.) ([[https://github.com/alphapapa/org-ql/issues/299][#299]]. Thanks to [[https://github.com/oantolin][Omar Antolín Camarena]], [[https://github.com/minad][Daniel Mendler]], and [[https://github.com/akirak][Akira Komamura]].) + *Compatibility* + + Org v9.7's ~org-element~ API changes required some adjustments. ([[https://github.com/alphapapa/org-ql/issues/364][#364]]. Thanks to several users for reporting, and to [[https://github.com/yantar92][Ihor Radchenko]] for his feedback.) ** 0.7.2 diff --git a/org-ql.info b/org-ql.info index 10eeb2f..2101987 100644 --- a/org-ql.info +++ b/org-ql.info @@ -229,6 +229,11 @@ completion facilities with an Org QL query: • ‘org-ql-find-in-agenda’ searches in ‘(org-agenda-files)’. • ‘org-ql-find-in-org-directory’ searches in ‘org-directory’. + Note that these commands are compatible with Embark +(https://github.com/oantolin/embark): the ‘embark-act’ command can be +called on a completion candidate (i.e. a search result) to act on it +immediately, without having to visit the entry in its source Org buffer. +  File: README.info, Node: org-ql-refile, Next: org-ql-search, Prev: org-ql-find, Up: Commands @@ -282,6 +287,11 @@ This feature is experimental and not guaranteed to work correctly with all commands. (It works to the extent it does because the appropriate text properties are placed on each item, imitating an Agenda buffer.) + *Note:* Also, this buffer is compatible with Embark +(https://github.com/oantolin/embark): the ‘embark-act’ command can be +called on an entry to act on it immediately, without having to visit the +entry in its source Org buffer. +  File: README.info, Node: helm-org-ql, Next: org-ql-view, Prev: org-ql-search, Up: Commands @@ -1029,7 +1039,21 @@ File: README.info, Node: 08-pre, Next: 072, Up: Changelog 5.1 0.8-pre =========== -*Compatibility* +*Additions* + + • Function ‘org-ql-completing-read’, used by command ‘org-ql-find’, + now specifies the completion category as ‘org-heading’, providing + compatibility with Embark (https://github.com/oantolin/embark). + (This is a powerful feature, as it means any ‘org-ql-find’ result + can be acted on from inside the search results with Embark, which + provides common actions from Org Agenda and Org speed keys + bindings.) (#299 (https://github.com/alphapapa/org-ql/issues/299). + Thanks to Omar Antolín Camarena (https://github.com/oantolin), + Daniel Mendler (https://github.com/minad), and Akira Komamura + (https://github.com/akirak).) + + *Compatibility* + • Org v9.7’s ‘org-element’ API changes required some adjustments. (#364 (https://github.com/alphapapa/org-ql/issues/364). Thanks to several users for reporting, and to Ihor Radchenko @@ -1769,65 +1793,65 @@ Node: Helm support3093 Node: Usage3496 Node: Commands3894 Node: org-ql-find4338 -Node: org-ql-refile4804 -Node: org-ql-search5127 -Node: helm-org-ql6823 -Node: org-ql-view7201 -Node: org-ql-view-sidebar7731 -Node: org-ql-view-recent-items8111 -Node: org-ql-sparse-tree8607 -Node: Queries9407 -Node: Non-sexp query syntax10524 -Node: General predicates12283 -Node: Ancestor/descendant predicates19270 -Node: Date/time predicates20398 -Node: Functions / Macros23522 -Node: Agenda-like views23820 -Ref: Function org-ql-block23982 -Node: Listing / acting-on results25243 -Ref: Caching25451 -Ref: Function org-ql-select26364 -Ref: Function org-ql-query28790 -Ref: Macro org-ql (deprecated)30564 -Node: Custom predicates30879 -Ref: Macro org-ql-defpred31103 -Node: Dynamic block34544 -Node: Links37268 -Node: Tips37955 -Node: Changelog38279 -Node: 08-pre39075 -Node: 07239440 -Node: 07140362 -Node: 0741171 -Node: 06344095 -Node: 06244626 -Node: 06144931 -Node: 0645499 -Node: 05248553 -Node: 05148853 -Node: 0549278 -Node: 04950809 -Node: 04851091 -Node: 04751440 -Node: 04651849 -Node: 04552257 -Node: 04452618 -Node: 04352977 -Node: 04253180 -Node: 04153341 -Node: 0453588 -Node: 03257689 -Node: 03158092 -Node: 0358289 -Node: 02361589 -Node: 02261823 -Node: 02162103 -Node: 0262308 -Node: 0166386 -Node: Notes66487 -Node: Comparison with Org Agenda searches66649 -Node: org-sidebar67538 -Node: License67817 +Node: org-ql-refile5077 +Node: org-ql-search5400 +Node: helm-org-ql7331 +Node: org-ql-view7709 +Node: org-ql-view-sidebar8239 +Node: org-ql-view-recent-items8619 +Node: org-ql-sparse-tree9115 +Node: Queries9915 +Node: Non-sexp query syntax11032 +Node: General predicates12791 +Node: Ancestor/descendant predicates19778 +Node: Date/time predicates20906 +Node: Functions / Macros24030 +Node: Agenda-like views24328 +Ref: Function org-ql-block24490 +Node: Listing / acting-on results25751 +Ref: Caching25959 +Ref: Function org-ql-select26872 +Ref: Function org-ql-query29298 +Ref: Macro org-ql (deprecated)31072 +Node: Custom predicates31387 +Ref: Macro org-ql-defpred31611 +Node: Dynamic block35052 +Node: Links37776 +Node: Tips38463 +Node: Changelog38787 +Node: 08-pre39583 +Node: 07240645 +Node: 07141567 +Node: 0742376 +Node: 06345300 +Node: 06245831 +Node: 06146136 +Node: 0646704 +Node: 05249758 +Node: 05150058 +Node: 0550483 +Node: 04952014 +Node: 04852296 +Node: 04752645 +Node: 04653054 +Node: 04553462 +Node: 04453823 +Node: 04354182 +Node: 04254385 +Node: 04154546 +Node: 0454793 +Node: 03258894 +Node: 03159297 +Node: 0359494 +Node: 02362794 +Node: 02263028 +Node: 02163308 +Node: 0263513 +Node: 0167591 +Node: Notes67692 +Node: Comparison with Org Agenda searches67854 +Node: org-sidebar68743 +Node: License69022  End Tag Table From ab720689e9385795efa34d787fcfb7d0e5d0bb38 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sat, 30 Sep 2023 20:09:12 -0500 Subject: [PATCH 024/145] Change: (org-ql-find) Interactively, search relevant buffers --- README.org | 1 + org-ql-find.el | 16 +++++++----- org-ql.info | 67 ++++++++++++++++++++++++++------------------------ 3 files changed, 46 insertions(+), 38 deletions(-) diff --git a/README.org b/README.org index fe5e9af..5a6febd 100644 --- a/README.org +++ b/README.org @@ -551,6 +551,7 @@ Simple links may also be written manually in either sexp or non-sexp form, like: *Additions* + Function ~org-ql-completing-read~, used by command ~org-ql-find~, now specifies the completion category as ~org-heading~, providing compatibility with [[https://github.com/oantolin/embark][Embark]]. (This is a powerful feature, as it means any ~org-ql-find~ result can be acted on from inside the search results with Embark, which provides common actions from Org Agenda and Org speed keys bindings.) ([[https://github.com/alphapapa/org-ql/issues/299][#299]]. Thanks to [[https://github.com/oantolin][Omar Antolín Camarena]], [[https://github.com/minad][Daniel Mendler]], and [[https://github.com/akirak][Akira Komamura]].) ++ Command ~org-ql-find~ may be called in an ~org-agenda~ or ~org-ql-view~ buffer to search the buffers which contributed to the agenda/view buffer. *Compatibility* diff --git a/org-ql-find.el b/org-ql-find.el index dd9fea9..b5db3c8 100644 --- a/org-ql-find.el +++ b/org-ql-find.el @@ -54,8 +54,11 @@ See function `display-buffer'." (cl-defun org-ql-find (buffers-files &key query-prefix query-filter (prompt "Find entry: ")) "Go to an Org entry in BUFFERS-FILES selected by searching entries with `org-ql'. -Interactively, with universal prefix, select multiple buffers to -search with completion and PROMPT. +Interactively, search the buffers and files relevant to the +current buffer (i.e. in `org-agenda-mode', the value of +`org-ql-view-buffers-files' or `org-agenda-contributing-files'; +in `org-mode', that buffer). With universal prefix, select +multiple buffers to search with completion and PROMPT. QUERY-PREFIX may be a string to prepend to the query (e.g. use \"heading:\" to only search headings, easily creating a custom @@ -75,10 +78,11 @@ single predicate)." when (eq 'org-mode (buffer-local-value 'major-mode buffer)) collect (buffer-name buffer)) nil t)) - (progn - (unless (eq major-mode 'org-mode) - (user-error "This is not an Org buffer: %S" (current-buffer))) - (current-buffer))))) + (pcase major-mode + ((pred (derived-mode-p 'org-agenda-mode)) (or org-ql-view-buffers-files + org-agenda-contributing-files)) + ((pred (derived-mode-p 'org-mode)) (current-buffer)) + (_ (user-error "This is not an Org-related buffer: %S" (current-buffer))))))) (let ((marker (org-ql-completing-read buffers-files :query-prefix query-prefix :query-filter query-filter diff --git a/org-ql.info b/org-ql.info index 2101987..f9a2e71 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1051,6 +1051,9 @@ File: README.info, Node: 08-pre, Next: 072, Up: Changelog Thanks to Omar Antolín Camarena (https://github.com/oantolin), Daniel Mendler (https://github.com/minad), and Akira Komamura (https://github.com/akirak).) + • Command ‘org-ql-find’ may be called in an ‘org-agenda’ or + ‘org-ql-view’ buffer to search the buffers which contributed to the + agenda/view buffer. *Compatibility* @@ -1820,38 +1823,38 @@ Node: Links37776 Node: Tips38463 Node: Changelog38787 Node: 08-pre39583 -Node: 07240645 -Node: 07141567 -Node: 0742376 -Node: 06345300 -Node: 06245831 -Node: 06146136 -Node: 0646704 -Node: 05249758 -Node: 05150058 -Node: 0550483 -Node: 04952014 -Node: 04852296 -Node: 04752645 -Node: 04653054 -Node: 04553462 -Node: 04453823 -Node: 04354182 -Node: 04254385 -Node: 04154546 -Node: 0454793 -Node: 03258894 -Node: 03159297 -Node: 0359494 -Node: 02362794 -Node: 02263028 -Node: 02163308 -Node: 0263513 -Node: 0167591 -Node: Notes67692 -Node: Comparison with Org Agenda searches67854 -Node: org-sidebar68743 -Node: License69022 +Node: 07240820 +Node: 07141742 +Node: 0742551 +Node: 06345475 +Node: 06246006 +Node: 06146311 +Node: 0646879 +Node: 05249933 +Node: 05150233 +Node: 0550658 +Node: 04952189 +Node: 04852471 +Node: 04752820 +Node: 04653229 +Node: 04553637 +Node: 04453998 +Node: 04354357 +Node: 04254560 +Node: 04154721 +Node: 0454968 +Node: 03259069 +Node: 03159472 +Node: 0359669 +Node: 02362969 +Node: 02263203 +Node: 02163483 +Node: 0263688 +Node: 0167766 +Node: Notes67867 +Node: Comparison with Org Agenda searches68029 +Node: org-sidebar68918 +Node: License69197  End Tag Table From 6d5b614fc5844420b3c3f5e0aec184e1e9027c04 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Mon, 2 Oct 2023 22:52:25 -0500 Subject: [PATCH 025/145] Fix: (org-ql-find) Interactive form Fixes silly mistake in ab720689e9385795efa34d787fcfb7d0e5d0bb38. --- org-ql-find.el | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/org-ql-find.el b/org-ql-find.el index b5db3c8..154f934 100644 --- a/org-ql-find.el +++ b/org-ql-find.el @@ -78,11 +78,10 @@ single predicate)." when (eq 'org-mode (buffer-local-value 'major-mode buffer)) collect (buffer-name buffer)) nil t)) - (pcase major-mode - ((pred (derived-mode-p 'org-agenda-mode)) (or org-ql-view-buffers-files - org-agenda-contributing-files)) - ((pred (derived-mode-p 'org-mode)) (current-buffer)) - (_ (user-error "This is not an Org-related buffer: %S" (current-buffer))))))) + (cond ((derived-mode-p 'org-agenda-mode) (or org-ql-view-buffers-files + org-agenda-contributing-files)) + ((derived-mode-p 'org-mode) (current-buffer)) + (t (user-error "This is not an Org-related buffer: %S" (current-buffer))))))) (let ((marker (org-ql-completing-read buffers-files :query-prefix query-prefix :query-filter query-filter From ac2d43588aa96f0b7fe88f518d6fca4fd65b5aa0 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 19 Oct 2023 21:43:53 -0500 Subject: [PATCH 026/145] Add: (org-ql-find-path) --- README.org | 2 + org-ql-find.el | 7 +++ org-ql.info | 121 +++++++++++++++++++++++++------------------------ 3 files changed, 71 insertions(+), 59 deletions(-) diff --git a/README.org b/README.org index 5a6febd..d7d3587 100644 --- a/README.org +++ b/README.org @@ -111,6 +111,7 @@ Lisp code examples are in [[examples.org]]. These commands jump to a heading selected using Emacs's built-in completion facilities with an Org QL query: - ~org-ql-find~ searches in the current buffer. +- ~org-ql-find-path~ searches outline paths in the current buffer. - ~org-ql-find-in-agenda~ searches in ~(org-agenda-files)~. - ~org-ql-find-in-org-directory~ searches in ~org-directory~. @@ -552,6 +553,7 @@ Simple links may also be written manually in either sexp or non-sexp form, like: + Function ~org-ql-completing-read~, used by command ~org-ql-find~, now specifies the completion category as ~org-heading~, providing compatibility with [[https://github.com/oantolin/embark][Embark]]. (This is a powerful feature, as it means any ~org-ql-find~ result can be acted on from inside the search results with Embark, which provides common actions from Org Agenda and Org speed keys bindings.) ([[https://github.com/alphapapa/org-ql/issues/299][#299]]. Thanks to [[https://github.com/oantolin][Omar Antolín Camarena]], [[https://github.com/minad][Daniel Mendler]], and [[https://github.com/akirak][Akira Komamura]].) + Command ~org-ql-find~ may be called in an ~org-agenda~ or ~org-ql-view~ buffer to search the buffers which contributed to the agenda/view buffer. ++ Command ~org-ql-find-path~, which searches outline paths in the current buffer. *Compatibility* diff --git a/org-ql-find.el b/org-ql-find.el index 154f934..c1848ea 100644 --- a/org-ql-find.el +++ b/org-ql-find.el @@ -132,6 +132,13 @@ which see (but only the files are used)." (interactive) (org-ql-find (org-ql-search-directories-files))) +;;;###autoload +(defun org-ql-find-path () + "Call `org-ql-find' to search outline paths in the current buffer." + (interactive) + (let ((org-ql-default-predicate 'outline-path)) + (org-ql-find (current-buffer)))) + (provide 'org-ql-find) ;;; org-ql-find.el ends here diff --git a/org-ql.info b/org-ql.info index f9a2e71..fae9944 100644 --- a/org-ql.info +++ b/org-ql.info @@ -226,6 +226,7 @@ _Note: These commands use ._ completion facilities with an Org QL query: • ‘org-ql-find’ searches in the current buffer. + • ‘org-ql-find-path’ searches outline paths in the current buffer. • ‘org-ql-find-in-agenda’ searches in ‘(org-agenda-files)’. • ‘org-ql-find-in-org-directory’ searches in ‘org-directory’. @@ -1054,6 +1055,8 @@ File: README.info, Node: 08-pre, Next: 072, Up: Changelog • Command ‘org-ql-find’ may be called in an ‘org-agenda’ or ‘org-ql-view’ buffer to search the buffers which contributed to the agenda/view buffer. + • Command ‘org-ql-find-path’, which searches outline paths in the + current buffer. *Compatibility* @@ -1796,65 +1799,65 @@ Node: Helm support3093 Node: Usage3496 Node: Commands3894 Node: org-ql-find4338 -Node: org-ql-refile5077 -Node: org-ql-search5400 -Node: helm-org-ql7331 -Node: org-ql-view7709 -Node: org-ql-view-sidebar8239 -Node: org-ql-view-recent-items8619 -Node: org-ql-sparse-tree9115 -Node: Queries9915 -Node: Non-sexp query syntax11032 -Node: General predicates12791 -Node: Ancestor/descendant predicates19778 -Node: Date/time predicates20906 -Node: Functions / Macros24030 -Node: Agenda-like views24328 -Ref: Function org-ql-block24490 -Node: Listing / acting-on results25751 -Ref: Caching25959 -Ref: Function org-ql-select26872 -Ref: Function org-ql-query29298 -Ref: Macro org-ql (deprecated)31072 -Node: Custom predicates31387 -Ref: Macro org-ql-defpred31611 -Node: Dynamic block35052 -Node: Links37776 -Node: Tips38463 -Node: Changelog38787 -Node: 08-pre39583 -Node: 07240820 -Node: 07141742 -Node: 0742551 -Node: 06345475 -Node: 06246006 -Node: 06146311 -Node: 0646879 -Node: 05249933 -Node: 05150233 -Node: 0550658 -Node: 04952189 -Node: 04852471 -Node: 04752820 -Node: 04653229 -Node: 04553637 -Node: 04453998 -Node: 04354357 -Node: 04254560 -Node: 04154721 -Node: 0454968 -Node: 03259069 -Node: 03159472 -Node: 0359669 -Node: 02362969 -Node: 02263203 -Node: 02163483 -Node: 0263688 -Node: 0167766 -Node: Notes67867 -Node: Comparison with Org Agenda searches68029 -Node: org-sidebar68918 -Node: License69197 +Node: org-ql-refile5153 +Node: org-ql-search5476 +Node: helm-org-ql7407 +Node: org-ql-view7785 +Node: org-ql-view-sidebar8315 +Node: org-ql-view-recent-items8695 +Node: org-ql-sparse-tree9191 +Node: Queries9991 +Node: Non-sexp query syntax11108 +Node: General predicates12867 +Node: Ancestor/descendant predicates19854 +Node: Date/time predicates20982 +Node: Functions / Macros24106 +Node: Agenda-like views24404 +Ref: Function org-ql-block24566 +Node: Listing / acting-on results25827 +Ref: Caching26035 +Ref: Function org-ql-select26948 +Ref: Function org-ql-query29374 +Ref: Macro org-ql (deprecated)31148 +Node: Custom predicates31463 +Ref: Macro org-ql-defpred31687 +Node: Dynamic block35128 +Node: Links37852 +Node: Tips38539 +Node: Changelog38863 +Node: 08-pre39659 +Node: 07240992 +Node: 07141914 +Node: 0742723 +Node: 06345647 +Node: 06246178 +Node: 06146483 +Node: 0647051 +Node: 05250105 +Node: 05150405 +Node: 0550830 +Node: 04952361 +Node: 04852643 +Node: 04752992 +Node: 04653401 +Node: 04553809 +Node: 04454170 +Node: 04354529 +Node: 04254732 +Node: 04154893 +Node: 0455140 +Node: 03259241 +Node: 03159644 +Node: 0359841 +Node: 02363141 +Node: 02263375 +Node: 02163655 +Node: 0263860 +Node: 0167938 +Node: Notes68039 +Node: Comparison with Org Agenda searches68201 +Node: org-sidebar69090 +Node: License69369  End Tag Table From daad25e079c5245289ac88313b423858d3793637 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 19 Oct 2023 21:45:22 -0500 Subject: [PATCH 027/145] Meta: v0.7.3-pre --- README.org | 4 ++ org-ql.el | 2 +- org-ql.info | 203 +++++++++++++++++++++++++++------------------------- 3 files changed, 112 insertions(+), 97 deletions(-) diff --git a/README.org b/README.org index 6ff4a0f..d454d6b 100644 --- a/README.org +++ b/README.org @@ -542,6 +542,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.7.3-pre + +Nothing new yet. + ** 0.7.2 *Fixes* diff --git a/org-ql.el b/org-ql.el index 9a3878b..862d20f 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.7.2 +;; Version: 0.7.3-pre ;; Package-Requires: ((emacs "26.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 c1e5e13..66fb70a 100644 --- a/org-ql.info +++ b/org-ql.info @@ -71,6 +71,7 @@ Functions / Macros Changelog +* 0.7.3-pre: 073-pre. * 0.7.2: 072. * 0.7.1: 071. * 0.7: 07. @@ -992,6 +993,7 @@ releases. * Menu: +* 0.7.3-pre: 073-pre. * 0.7.2: 072. * 0.7.1: 071. * 0.7: 07. @@ -1022,9 +1024,17 @@ releases. * 0.1: 01.  -File: README.info, Node: 072, Next: 071, Up: Changelog +File: README.info, Node: 073-pre, Next: 072, Up: Changelog -5.1 0.7.2 +5.1 0.7.3-pre +============= + +Nothing new yet. + + +File: README.info, Node: 072, Next: 071, Prev: 073-pre, Up: Changelog + +5.2 0.7.2 ========= *Fixes* @@ -1045,7 +1055,7 @@ File: README.info, Node: 072, Next: 071, Up: Changelog  File: README.info, Node: 071, Next: 07, Prev: 072, Up: Changelog -5.2 0.7.1 +5.3 0.7.1 ========= *Fixes* @@ -1064,7 +1074,7 @@ File: README.info, Node: 071, Next: 07, Prev: 072, Up: Changelog  File: README.info, Node: 07, Next: 063, Prev: 071, Up: Changelog -5.3 0.7 +5.4 0.7 ======= *Added* @@ -1124,7 +1134,7 @@ File: README.info, Node: 07, Next: 063, Prev: 071, Up: Changelog  File: README.info, Node: 063, Next: 062, Prev: 07, Up: Changelog -5.4 0.6.3 +5.5 0.6.3 ========= *Fixed* @@ -1140,7 +1150,7 @@ File: README.info, Node: 063, Next: 062, Prev: 07, Up: Changelog  File: README.info, Node: 062, Next: 061, Prev: 063, Up: Changelog -5.5 0.6.2 +5.6 0.6.2 ========= *Fixed* @@ -1151,7 +1161,7 @@ File: README.info, Node: 062, Next: 061, Prev: 063, Up: Changelog  File: README.info, Node: 061, Next: 06, Prev: 062, Up: Changelog -5.6 0.6.1 +5.7 0.6.1 ========= *Fixed* @@ -1169,7 +1179,7 @@ File: README.info, Node: 061, Next: 06, Prev: 062, Up: Changelog  File: README.info, Node: 06, Next: 052, Prev: 061, Up: Changelog -5.7 0.6 +5.8 0.6 ======= *Added* @@ -1236,7 +1246,7 @@ File: README.info, Node: 06, Next: 052, Prev: 061, Up: Changelog  File: README.info, Node: 052, Next: 051, Prev: 06, Up: Changelog -5.8 0.5.2 +5.9 0.5.2 ========= *Fixed* @@ -1247,8 +1257,8 @@ File: README.info, Node: 052, Next: 051, Prev: 06, Up: Changelog  File: README.info, Node: 051, Next: 05, Prev: 052, Up: Changelog -5.9 0.5.1 -========= +5.10 0.5.1 +========== *Fixed* • Custom sorting functions could corrupt the cache, causing items to @@ -1260,7 +1270,7 @@ File: README.info, Node: 051, Next: 05, Prev: 052, Up: Changelog  File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog -5.10 0.5 +5.11 0.5 ======== *Added* @@ -1301,7 +1311,7 @@ File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog  File: README.info, Node: 049, Next: 048, Prev: 05, Up: Changelog -5.11 0.4.9 +5.12 0.4.9 ========== *Fixed* @@ -1312,7 +1322,7 @@ File: README.info, Node: 049, Next: 048, Prev: 05, Up: Changelog  File: README.info, Node: 048, Next: 047, Prev: 049, Up: Changelog -5.12 0.4.8 +5.13 0.4.8 ========== *Fixed* @@ -1324,7 +1334,7 @@ File: README.info, Node: 048, Next: 047, Prev: 049, Up: Changelog  File: README.info, Node: 047, Next: 046, Prev: 048, Up: Changelog -5.13 0.4.7 +5.14 0.4.7 ========== *Fixed* @@ -1337,7 +1347,7 @@ File: README.info, Node: 047, Next: 046, Prev: 048, Up: Changelog  File: README.info, Node: 046, Next: 045, Prev: 047, Up: Changelog -5.14 0.4.6 +5.15 0.4.6 ========== *Fixed* @@ -1350,7 +1360,7 @@ File: README.info, Node: 046, Next: 045, Prev: 047, Up: Changelog  File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog -5.15 0.4.5 +5.16 0.4.5 ========== *Fixed* @@ -1362,7 +1372,7 @@ File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog  File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog -5.16 0.4.4 +5.17 0.4.4 ========== *Fixed* @@ -1374,7 +1384,7 @@ File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog  File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog -5.17 0.4.3 +5.18 0.4.3 ========== *Fixed* @@ -1384,7 +1394,7 @@ File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog  File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog -5.18 0.4.2 +5.19 0.4.2 ========== *Fixed* @@ -1393,7 +1403,7 @@ File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog  File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog -5.19 0.4.1 +5.20 0.4.1 ========== *Fixed* @@ -1403,7 +1413,7 @@ File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog  File: README.info, Node: 04, Next: 032, Prev: 041, Up: Changelog -5.20 0.4 +5.21 0.4 ======== _Note:_ The next release, 0.5, may include changes which will require @@ -1484,7 +1494,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.21 0.3.2 +5.22 0.3.2 ========== *Fixed* @@ -1497,7 +1507,7 @@ File: README.info, Node: 032, Next: 031, Prev: 04, Up: Changelog  File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog -5.22 0.3.1 +5.23 0.3.1 ========== *Fixed* @@ -1507,7 +1517,7 @@ File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog  File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog -5.23 0.3 +5.24 0.3 ======== *Added* @@ -1575,7 +1585,7 @@ File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog  File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog -5.24 0.2.3 +5.25 0.2.3 ========== *Fixed* @@ -1585,7 +1595,7 @@ File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog  File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog -5.25 0.2.2 +5.26 0.2.2 ========== *Fixed* @@ -1596,7 +1606,7 @@ File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog  File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog -5.26 0.2.1 +5.27 0.2.1 ========== *Fixed* @@ -1606,7 +1616,7 @@ File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog  File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog -5.27 0.2 +5.28 0.2 ======== *Added* @@ -1689,7 +1699,7 @@ File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog  File: README.info, Node: 01, Prev: 02, Up: Changelog -5.28 0.1 +5.29 0.1 ======== First tagged release. @@ -1747,72 +1757,73 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1791 -Node: Screenshots1914 -Node: Installation2032 -Node: Quelpa2546 -Node: Helm support3074 -Node: Usage3477 -Node: Commands3875 -Node: org-ql-find4319 -Node: org-ql-refile4785 -Node: org-ql-search5108 -Node: helm-org-ql6804 -Node: org-ql-view7182 -Node: org-ql-view-sidebar7712 -Node: org-ql-view-recent-items8092 -Node: org-ql-sparse-tree8588 -Node: Queries9388 -Node: Non-sexp query syntax10505 -Node: General predicates12264 -Node: Ancestor/descendant predicates19251 -Node: Date/time predicates20379 -Node: Functions / Macros23503 -Node: Agenda-like views23801 -Ref: Function org-ql-block23963 -Node: Listing / acting-on results25224 -Ref: Caching25432 -Ref: Function org-ql-select26345 -Ref: Function org-ql-query28771 -Ref: Macro org-ql (deprecated)30545 -Node: Custom predicates30860 -Ref: Macro org-ql-defpred31084 -Node: Dynamic block34525 -Node: Links37249 -Node: Tips37936 -Node: Changelog38260 -Node: 07239037 -Node: 07139944 -Node: 0740753 -Node: 06343677 -Node: 06244208 -Node: 06144513 -Node: 0645081 -Node: 05248135 -Node: 05148435 -Node: 0548858 -Node: 04950389 -Node: 04850671 -Node: 04751020 -Node: 04651429 -Node: 04551837 -Node: 04452198 -Node: 04352557 -Node: 04252760 -Node: 04152921 -Node: 0453168 -Node: 03257269 -Node: 03157672 -Node: 0357869 -Node: 02361169 -Node: 02261403 -Node: 02161683 -Node: 0261888 -Node: 0165966 -Node: Notes66067 -Node: Comparison with Org Agenda searches66229 -Node: org-sidebar67118 -Node: License67397 +Node: Contents1813 +Node: Screenshots1936 +Node: Installation2054 +Node: Quelpa2568 +Node: Helm support3096 +Node: Usage3499 +Node: Commands3897 +Node: org-ql-find4341 +Node: org-ql-refile4807 +Node: org-ql-search5130 +Node: helm-org-ql6826 +Node: org-ql-view7204 +Node: org-ql-view-sidebar7734 +Node: org-ql-view-recent-items8114 +Node: org-ql-sparse-tree8610 +Node: Queries9410 +Node: Non-sexp query syntax10527 +Node: General predicates12286 +Node: Ancestor/descendant predicates19273 +Node: Date/time predicates20401 +Node: Functions / Macros23525 +Node: Agenda-like views23823 +Ref: Function org-ql-block23985 +Node: Listing / acting-on results25246 +Ref: Caching25454 +Ref: Function org-ql-select26367 +Ref: Function org-ql-query28793 +Ref: Macro org-ql (deprecated)30567 +Node: Custom predicates30882 +Ref: Macro org-ql-defpred31106 +Node: Dynamic block34547 +Node: Links37271 +Node: Tips37958 +Node: Changelog38282 +Node: 073-pre39081 +Node: 07239193 +Node: 07140116 +Node: 0740925 +Node: 06343849 +Node: 06244380 +Node: 06144685 +Node: 0645253 +Node: 05248307 +Node: 05148607 +Node: 0549032 +Node: 04950563 +Node: 04850845 +Node: 04751194 +Node: 04651603 +Node: 04552011 +Node: 04452372 +Node: 04352731 +Node: 04252934 +Node: 04153095 +Node: 0453342 +Node: 03257443 +Node: 03157846 +Node: 0358043 +Node: 02361343 +Node: 02261577 +Node: 02161857 +Node: 0262062 +Node: 0166140 +Node: Notes66241 +Node: Comparison with Org Agenda searches66403 +Node: org-sidebar67292 +Node: License67571  End Tag Table From 4476759dc97b87b7601cea9b1368d0a48e42cea3 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 19 Oct 2023 21:47:34 -0500 Subject: [PATCH 028/145] Fix: (org-ql--outline-path) Disable case-fold-search --- README.org | 3 ++- org-ql.el | 7 +++--- org-ql.info | 70 ++++++++++++++++++++++++++++------------------------- 3 files changed, 43 insertions(+), 37 deletions(-) diff --git a/README.org b/README.org index d454d6b..c2376c6 100644 --- a/README.org +++ b/README.org @@ -544,7 +544,8 @@ Simple links may also be written manually in either sexp or non-sexp form, like: ** 0.7.3-pre -Nothing new yet. +*Fixes* ++ Disable ~case-fold-search~ when collecting headings in outline paths. (Headings that started with a word that is also a to-do keyword but with different capitalization would be matched incorrectly.) ** 0.7.2 diff --git a/org-ql.el b/org-ql.el index 862d20f..b4d8cd9 100644 --- a/org-ql.el +++ b/org-ql.el @@ -624,9 +624,10 @@ Returns cons (INHERITED-TAGS . LOCAL-TAGS)." "Return outline path for heading at point." (save-excursion (let ((heading (save-match-data - (if (looking-at org-complex-heading-regexp) - (or (match-string 4) "") - "")))) + (let (case-fold-search) + (if (looking-at org-complex-heading-regexp) + (or (match-string-no-properties 4) "") + ""))))) (if (org-up-heading-safe) ;; MAYBE: It seems wrong to call the cache function from ;; inside this function, like a violation of separation of diff --git a/org-ql.info b/org-ql.info index 66fb70a..cae7ef3 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1029,7 +1029,11 @@ File: README.info, Node: 073-pre, Next: 072, Up: Changelog 5.1 0.7.3-pre ============= -Nothing new yet. +*Fixes* + • Disable ‘case-fold-search’ when collecting headings in outline + paths. (Headings that started with a word that is also a to-do + keyword but with different capitalization would be matched + incorrectly.)  File: README.info, Node: 072, Next: 071, Prev: 073-pre, Up: Changelog @@ -1792,38 +1796,38 @@ Node: Links37271 Node: Tips37958 Node: Changelog38282 Node: 073-pre39081 -Node: 07239193 -Node: 07140116 -Node: 0740925 -Node: 06343849 -Node: 06244380 -Node: 06144685 -Node: 0645253 -Node: 05248307 -Node: 05148607 -Node: 0549032 -Node: 04950563 -Node: 04850845 -Node: 04751194 -Node: 04651603 -Node: 04552011 -Node: 04452372 -Node: 04352731 -Node: 04252934 -Node: 04153095 -Node: 0453342 -Node: 03257443 -Node: 03157846 -Node: 0358043 -Node: 02361343 -Node: 02261577 -Node: 02161857 -Node: 0262062 -Node: 0166140 -Node: Notes66241 -Node: Comparison with Org Agenda searches66403 -Node: org-sidebar67292 -Node: License67571 +Node: 07239410 +Node: 07140333 +Node: 0741142 +Node: 06344066 +Node: 06244597 +Node: 06144902 +Node: 0645470 +Node: 05248524 +Node: 05148824 +Node: 0549249 +Node: 04950780 +Node: 04851062 +Node: 04751411 +Node: 04651820 +Node: 04552228 +Node: 04452589 +Node: 04352948 +Node: 04253151 +Node: 04153312 +Node: 0453559 +Node: 03257660 +Node: 03158063 +Node: 0358260 +Node: 02361560 +Node: 02261794 +Node: 02162074 +Node: 0262279 +Node: 0166357 +Node: Notes66458 +Node: Comparison with Org Agenda searches66620 +Node: org-sidebar67509 +Node: License67788  End Tag Table From 09c35915043a69c73fa08dfc73a2bc7f5823698c Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 19 Oct 2023 21:50:30 -0500 Subject: [PATCH 029/145] Fix: Saving of org-ql-view views It didn't seem that calling custom-save-all was necessary in the past, but it appears that it is now. Closes #378. Reported-by: Pentaquark1 --- README.org | 1 + org-ql-view.el | 6 +++-- org-ql.info | 67 ++++++++++++++++++++++++++------------------------ 3 files changed, 40 insertions(+), 34 deletions(-) diff --git a/README.org b/README.org index c2376c6..4bc9605 100644 --- a/README.org +++ b/README.org @@ -546,6 +546,7 @@ Simple links may also be written manually in either sexp or non-sexp form, like: *Fixes* + Disable ~case-fold-search~ when collecting headings in outline paths. (Headings that started with a word that is also a to-do keyword but with different capitalization would be matched incorrectly.) ++ Saving of ~org-ql-view~ views. ([[https://github.com/alphapapa/org-ql/issues/378][#378]]. Thanks to [[https://github.com/Pentaquark1][Pentaquark1]] for reporting.) ** 0.7.2 diff --git a/org-ql-view.el b/org-ql-view.el index d771d12..ea568d4 100644 --- a/org-ql-view.el +++ b/org-ql-view.el @@ -352,7 +352,8 @@ update search arguments." (yes-or-no-p (format "Overwrite view \"%s\"?" name))) (setf (map-elt org-ql-views name nil #'equal) plist) (customize-set-variable 'org-ql-views org-ql-views) - (customize-mark-to-save 'org-ql-views)))) + (customize-mark-to-save 'org-ql-views) + (custom-save-all)))) (defun org-ql-view-delete () "Delete current view (with confirmation)." @@ -362,7 +363,8 @@ update search arguments." (--remove (equal (car it) org-ql-view-title) org-ql-views)) (customize-set-variable 'org-ql-views org-ql-views) - (customize-mark-to-save 'org-ql-views))) + (customize-mark-to-save 'org-ql-views) + (custom-save-all))) (defun org-ql-view-customize () "Customize view at point in `org-ql-view-sidebar' buffer." diff --git a/org-ql.info b/org-ql.info index cae7ef3..891b2e0 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1034,6 +1034,9 @@ File: README.info, Node: 073-pre, Next: 072, Up: Changelog paths. (Headings that started with a word that is also a to-do keyword but with different capitalization would be matched incorrectly.) + • Saving of ‘org-ql-view’ views. (#378 + (https://github.com/alphapapa/org-ql/issues/378). Thanks to + Pentaquark1 (https://github.com/Pentaquark1) for reporting.)  File: README.info, Node: 072, Next: 071, Prev: 073-pre, Up: Changelog @@ -1796,38 +1799,38 @@ Node: Links37271 Node: Tips37958 Node: Changelog38282 Node: 073-pre39081 -Node: 07239410 -Node: 07140333 -Node: 0741142 -Node: 06344066 -Node: 06244597 -Node: 06144902 -Node: 0645470 -Node: 05248524 -Node: 05148824 -Node: 0549249 -Node: 04950780 -Node: 04851062 -Node: 04751411 -Node: 04651820 -Node: 04552228 -Node: 04452589 -Node: 04352948 -Node: 04253151 -Node: 04153312 -Node: 0453559 -Node: 03257660 -Node: 03158063 -Node: 0358260 -Node: 02361560 -Node: 02261794 -Node: 02162074 -Node: 0262279 -Node: 0166357 -Node: Notes66458 -Node: Comparison with Org Agenda searches66620 -Node: org-sidebar67509 -Node: License67788 +Node: 07239591 +Node: 07140514 +Node: 0741323 +Node: 06344247 +Node: 06244778 +Node: 06145083 +Node: 0645651 +Node: 05248705 +Node: 05149005 +Node: 0549430 +Node: 04950961 +Node: 04851243 +Node: 04751592 +Node: 04652001 +Node: 04552409 +Node: 04452770 +Node: 04353129 +Node: 04253332 +Node: 04153493 +Node: 0453740 +Node: 03257841 +Node: 03158244 +Node: 0358441 +Node: 02361741 +Node: 02261975 +Node: 02162255 +Node: 0262460 +Node: 0166538 +Node: Notes66639 +Node: Comparison with Org Agenda searches66801 +Node: org-sidebar67690 +Node: License67969  End Tag Table From de80f9a7645176a973434132320eb11683019e2a Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Mon, 23 Oct 2023 01:23:48 -0500 Subject: [PATCH 030/145] Comment: Add TODO --- org-ql-find.el | 1 + 1 file changed, 1 insertion(+) diff --git a/org-ql-find.el b/org-ql-find.el index dd9fea9..e3b9a49 100644 --- a/org-ql-find.el +++ b/org-ql-find.el @@ -41,6 +41,7 @@ (defcustom org-ql-find-goto-hook '(org-show-entry org-reveal) "Functions called when selecting an entry." + ;; TODO: Add common choices, including `org-tree-to-indirect-buffer'. :type 'hook) (defcustom org-ql-find-display-buffer-action '(display-buffer-same-window) From 631cd80ce870b5bec6609eea8f0f4123876bf1cf Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Mon, 23 Oct 2023 01:23:54 -0500 Subject: [PATCH 031/145] Fix: (org-ql-find) Go to selected entry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #380. Reported-by: Omar Antolín Camarena --- README.org | 1 + org-ql-find.el | 9 ++++--- org-ql.info | 67 ++++++++++++++++++++++++++------------------------ 3 files changed, 41 insertions(+), 36 deletions(-) diff --git a/README.org b/README.org index 4bc9605..4ad1187 100644 --- a/README.org +++ b/README.org @@ -547,6 +547,7 @@ Simple links may also be written manually in either sexp or non-sexp form, like: *Fixes* + Disable ~case-fold-search~ when collecting headings in outline paths. (Headings that started with a word that is also a to-do keyword but with different capitalization would be matched incorrectly.) + Saving of ~org-ql-view~ views. ([[https://github.com/alphapapa/org-ql/issues/378][#378]]. Thanks to [[https://github.com/Pentaquark1][Pentaquark1]] for reporting.) ++ Command ~org-ql-find~ didn't move point to the selected entry. ([[https://github.com/alphapapa/org-ql/issues/380][#380]]. Thanks to [[https://github.com/oantolin][Omar Antolín Camarena]] for reporting.) ** 0.7.2 diff --git a/org-ql-find.el b/org-ql-find.el index e3b9a49..768f0af 100644 --- a/org-ql-find.el +++ b/org-ql-find.el @@ -84,10 +84,11 @@ single predicate)." :query-prefix query-prefix :query-filter query-filter :prompt prompt))) - (org-with-point-at marker - (display-buffer (current-buffer) org-ql-find-display-buffer-action) - (select-window (get-buffer-window (current-buffer))) - (run-hook-with-args 'org-ql-find-goto-hook)))) + (set-buffer (marker-buffer marker)) + (goto-char marker) + (display-buffer (current-buffer) org-ql-find-display-buffer-action) + (select-window (get-buffer-window (current-buffer))) + (run-hook-with-args 'org-ql-find-goto-hook))) ;;;###autoload (defun org-ql-refile (marker) diff --git a/org-ql.info b/org-ql.info index 891b2e0..eef7814 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1037,6 +1037,9 @@ File: README.info, Node: 073-pre, Next: 072, Up: Changelog • Saving of ‘org-ql-view’ views. (#378 (https://github.com/alphapapa/org-ql/issues/378). Thanks to Pentaquark1 (https://github.com/Pentaquark1) for reporting.) + • Command ‘org-ql-find’ didn’t move point to the selected entry. + (#380 (https://github.com/alphapapa/org-ql/issues/380). Thanks to + Omar Antolín Camarena (https://github.com/oantolin) for reporting.)  File: README.info, Node: 072, Next: 071, Prev: 073-pre, Up: Changelog @@ -1799,38 +1802,38 @@ Node: Links37271 Node: Tips37958 Node: Changelog38282 Node: 073-pre39081 -Node: 07239591 -Node: 07140514 -Node: 0741323 -Node: 06344247 -Node: 06244778 -Node: 06145083 -Node: 0645651 -Node: 05248705 -Node: 05149005 -Node: 0549430 -Node: 04950961 -Node: 04851243 -Node: 04751592 -Node: 04652001 -Node: 04552409 -Node: 04452770 -Node: 04353129 -Node: 04253332 -Node: 04153493 -Node: 0453740 -Node: 03257841 -Node: 03158244 -Node: 0358441 -Node: 02361741 -Node: 02261975 -Node: 02162255 -Node: 0262460 -Node: 0166538 -Node: Notes66639 -Node: Comparison with Org Agenda searches66801 -Node: org-sidebar67690 -Node: License67969 +Node: 07239813 +Node: 07140736 +Node: 0741545 +Node: 06344469 +Node: 06245000 +Node: 06145305 +Node: 0645873 +Node: 05248927 +Node: 05149227 +Node: 0549652 +Node: 04951183 +Node: 04851465 +Node: 04751814 +Node: 04652223 +Node: 04552631 +Node: 04452992 +Node: 04353351 +Node: 04253554 +Node: 04153715 +Node: 0453962 +Node: 03258063 +Node: 03158466 +Node: 0358663 +Node: 02361963 +Node: 02262197 +Node: 02162477 +Node: 0262682 +Node: 0166760 +Node: Notes66861 +Node: Comparison with Org Agenda searches67023 +Node: org-sidebar67912 +Node: License68191  End Tag Table From 28c4215704031e05190c17932b5e683bb462d9e5 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Mon, 23 Oct 2023 18:52:04 -0500 Subject: [PATCH 032/145] Release: v0.7.3 --- README.org | 2 +- org-ql.el | 2 +- org-ql.info | 146 ++++++++++++++++++++++++++-------------------------- 3 files changed, 75 insertions(+), 75 deletions(-) diff --git a/README.org b/README.org index 4ad1187..b8893e0 100644 --- a/README.org +++ b/README.org @@ -542,7 +542,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.7.3-pre +** 0.7.3 *Fixes* + Disable ~case-fold-search~ when collecting headings in outline paths. (Headings that started with a word that is also a to-do keyword but with different capitalization would be matched incorrectly.) diff --git a/org-ql.el b/org-ql.el index b4d8cd9..1bf1900 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.7.3-pre +;; Version: 0.7.3 ;; Package-Requires: ((emacs "26.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 eef7814..94eb443 100644 --- a/org-ql.info +++ b/org-ql.info @@ -71,7 +71,7 @@ Functions / Macros Changelog -* 0.7.3-pre: 073-pre. +* 0.7.3: 073. * 0.7.2: 072. * 0.7.1: 071. * 0.7: 07. @@ -993,7 +993,7 @@ releases. * Menu: -* 0.7.3-pre: 073-pre. +* 0.7.3: 073. * 0.7.2: 072. * 0.7.1: 071. * 0.7: 07. @@ -1024,10 +1024,10 @@ releases. * 0.1: 01.  -File: README.info, Node: 073-pre, Next: 072, Up: Changelog +File: README.info, Node: 073, Next: 072, Up: Changelog -5.1 0.7.3-pre -============= +5.1 0.7.3 +========= *Fixes* • Disable ‘case-fold-search’ when collecting headings in outline @@ -1042,7 +1042,7 @@ File: README.info, Node: 073-pre, Next: 072, Up: Changelog Omar Antolín Camarena (https://github.com/oantolin) for reporting.)  -File: README.info, Node: 072, Next: 071, Prev: 073-pre, Up: Changelog +File: README.info, Node: 072, Next: 071, Prev: 073, Up: Changelog 5.2 0.7.2 ========= @@ -1767,73 +1767,73 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1813 -Node: Screenshots1936 -Node: Installation2054 -Node: Quelpa2568 -Node: Helm support3096 -Node: Usage3499 -Node: Commands3897 -Node: org-ql-find4341 -Node: org-ql-refile4807 -Node: org-ql-search5130 -Node: helm-org-ql6826 -Node: org-ql-view7204 -Node: org-ql-view-sidebar7734 -Node: org-ql-view-recent-items8114 -Node: org-ql-sparse-tree8610 -Node: Queries9410 -Node: Non-sexp query syntax10527 -Node: General predicates12286 -Node: Ancestor/descendant predicates19273 -Node: Date/time predicates20401 -Node: Functions / Macros23525 -Node: Agenda-like views23823 -Ref: Function org-ql-block23985 -Node: Listing / acting-on results25246 -Ref: Caching25454 -Ref: Function org-ql-select26367 -Ref: Function org-ql-query28793 -Ref: Macro org-ql (deprecated)30567 -Node: Custom predicates30882 -Ref: Macro org-ql-defpred31106 -Node: Dynamic block34547 -Node: Links37271 -Node: Tips37958 -Node: Changelog38282 -Node: 073-pre39081 -Node: 07239813 -Node: 07140736 -Node: 0741545 -Node: 06344469 -Node: 06245000 -Node: 06145305 -Node: 0645873 -Node: 05248927 -Node: 05149227 -Node: 0549652 -Node: 04951183 -Node: 04851465 -Node: 04751814 -Node: 04652223 -Node: 04552631 -Node: 04452992 -Node: 04353351 -Node: 04253554 -Node: 04153715 -Node: 0453962 -Node: 03258063 -Node: 03158466 -Node: 0358663 -Node: 02361963 -Node: 02262197 -Node: 02162477 -Node: 0262682 -Node: 0166760 -Node: Notes66861 -Node: Comparison with Org Agenda searches67023 -Node: org-sidebar67912 -Node: License68191 +Node: Contents1805 +Node: Screenshots1928 +Node: Installation2046 +Node: Quelpa2560 +Node: Helm support3088 +Node: Usage3491 +Node: Commands3889 +Node: org-ql-find4333 +Node: org-ql-refile4799 +Node: org-ql-search5122 +Node: helm-org-ql6818 +Node: org-ql-view7196 +Node: org-ql-view-sidebar7726 +Node: org-ql-view-recent-items8106 +Node: org-ql-sparse-tree8602 +Node: Queries9402 +Node: Non-sexp query syntax10519 +Node: General predicates12278 +Node: Ancestor/descendant predicates19265 +Node: Date/time predicates20393 +Node: Functions / Macros23517 +Node: Agenda-like views23815 +Ref: Function org-ql-block23977 +Node: Listing / acting-on results25238 +Ref: Caching25446 +Ref: Function org-ql-select26359 +Ref: Function org-ql-query28785 +Ref: Macro org-ql (deprecated)30559 +Node: Custom predicates30874 +Ref: Macro org-ql-defpred31098 +Node: Dynamic block34539 +Node: Links37263 +Node: Tips37950 +Node: Changelog38274 +Node: 07339065 +Node: 07239785 +Node: 07140704 +Node: 0741513 +Node: 06344437 +Node: 06244968 +Node: 06145273 +Node: 0645841 +Node: 05248895 +Node: 05149195 +Node: 0549620 +Node: 04951151 +Node: 04851433 +Node: 04751782 +Node: 04652191 +Node: 04552599 +Node: 04452960 +Node: 04353319 +Node: 04253522 +Node: 04153683 +Node: 0453930 +Node: 03258031 +Node: 03158434 +Node: 0358631 +Node: 02361931 +Node: 02262165 +Node: 02162445 +Node: 0262650 +Node: 0166728 +Node: Notes66829 +Node: Comparison with Org Agenda searches66991 +Node: org-sidebar67880 +Node: License68159  End Tag Table From deada67e1d2ecd95f19c73d65ca258d08e27ac87 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sun, 5 Feb 2023 21:30:32 -0600 Subject: [PATCH 033/145] WIP: org-ql-open-link Need to tidy up and generalize org-ql-completing-read a bit more, but this is basically working, and should be very useful. --- org-ql-completing-read.el | 31 +++++++++++++++++++++++++++ org-ql-find.el | 44 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) diff --git a/org-ql-completing-read.el b/org-ql-completing-read.el index e224e4b..d3c3f2a 100644 --- a/org-ql-completing-read.el +++ b/org-ql-completing-read.el @@ -75,10 +75,38 @@ For an experience like `org-rifle', use a newline." ;;;; Functions +(defun org-ql-completing-read-action (table) + "Default action for `org-ql-completing-read'." + (font-lock-ensure (point-at-bol) (point-at-eol)) + (let* ((path (thread-first (org-get-outline-path t t) + (org-format-outline-path window-width nil "") + (org-split-string ""))) + (path (if org-ql-completing-read-reverse-paths + (string-join (nreverse path) "\\") + (string-join path "/")))) + (puthash path (point-marker) table) + path)) + +(defun org-ql-completing-read-annotate (candidate table) + "FIXME: Docstring." + (while-no-input + ;; Using `while-no-input' here doesn't make it as + ;; responsive as, e.g. Helm while typing, but it seems to + ;; help a little when using the org-rifle-style snippets. + (or (org-ql-completing-read-snippet (gethash candidate table)) ""))) + +(defun org-ql-completing-read-snippet (marker) + (org-with-point-at marker + (or (funcall org-ql-completing-read-snippet-function snippet-regexp) + (org-ql-completing-read--snippet-simple)))) + ;;;;; Completing read ;;;###autoload (cl-defun org-ql-completing-read (buffers-files &key query-prefix query-filter + (action #'org-ql-completing-read-action) + (annotate #'org-ql-completing-read-annotate) + (collection-filter #'identity) (prompt "Find entry: ")) "Return marker at Org entry in BUFFERS-FILES selected with `org-ql'. PROMPT is shown to the user. @@ -266,6 +294,9 @@ single predicate)." ;; `completing-read' machinery, which interrupts it, so we must work around this problem by ;; ensuring all of the BUFFERS-FILES are loaded and initialized before calling ;; `completing-read'. + (funcall collection-filter + (org-ql-select buffers-files (org-ql--query-string-to-sexp str) + :action #'action))))))) (unless (listp buffers-files) ;; Since we map across this argument, we ensure it's a list. (setf buffers-files (list buffers-files))) diff --git a/org-ql-find.el b/org-ql-find.el index 1b85b77..34e39ee 100644 --- a/org-ql-find.el +++ b/org-ql-find.el @@ -141,6 +141,50 @@ which see (but only the files are used)." (let ((org-ql-default-predicate 'outline-path)) (org-ql-find (current-buffer)))) +;;;###autoload +(cl-defun org-ql-open-link (buffers-files &key query-prefix query-filter + (prompt "Open link: ")) + "FIXME: Docstring." + (interactive + ;; FIXME: Factor this out. + (list (if current-prefix-arg + (mapcar #'get-buffer + (completing-read-multiple + "Buffers: " + (cl-loop for buffer in (buffer-list) + when (eq 'org-mode (buffer-local-value 'major-mode buffer)) + collect (buffer-name buffer)) + nil t)) + (progn + (unless (eq major-mode 'org-mode) + (user-error "This is not an Org buffer: %S" (current-buffer))) + (current-buffer))))) + (let* ((org-ql-completing-read-snippet-function nil) + (marker (org-ql-completing-read buffers-files + :query-prefix "rifle:" + :query-filter (lambda (input) + (replace-regexp-in-string (rx (1+ space)) "," input t t)) + :prompt prompt + :collection-filter #'flatten-list + :action (lambda (table) + (save-excursion + (cl-loop while (re-search-forward org-link-any-re (org-entry-end-position) t) + for link = (string-trim (match-string 0)) + do (progn + (set-text-properties 0 (length link) '(face org-link) link) + (setf link (org-link-display-format link)) + (puthash link (copy-marker (match-beginning 0)) table)) + collect link))) + :annotate (lambda (candidate table) + (org-with-point-at (gethash candidate table) + (concat " " + (org-format-outline-path (reverse (org-get-outline-path 'with-self)) + nil nil "\\") + "::" + (abbreviate-file-name (buffer-file-name)))))))) + (org-with-point-at marker + (org-open-at-point marker)))) + (provide 'org-ql-find) ;;; org-ql-find.el ends here From 28f5aa3100497f2ff847cb825628b1f03509dc82 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 16 Mar 2023 07:11:11 -0500 Subject: [PATCH 034/145] WIP: Many improvements Now need to do some kind of sorting... --- org-ql-completing-read.el | 106 +++++++++++++++++++------------------- org-ql-find.el | 40 +++++++------- 2 files changed, 74 insertions(+), 72 deletions(-) diff --git a/org-ql-completing-read.el b/org-ql-completing-read.el index d3c3f2a..127a866 100644 --- a/org-ql-completing-read.el +++ b/org-ql-completing-read.el @@ -73,41 +73,46 @@ For an experience like `org-rifle', use a newline." (defface org-ql-completing-read-snippet '((t (:inherit font-lock-comment-face))) "Snippets.") +(defvar org-ql-completing-read-input-regexp nil + "Current regexp for `org-ql-completing-read' input. +To be used in, e.g. annotation functions.") + ;;;; Functions -(defun org-ql-completing-read-action (table) - "Default action for `org-ql-completing-read'." +(defun org-ql-completing-read-action () + "Default action for `org-ql-completing-read'. +Returns (STRING . MARKER) cons." (font-lock-ensure (point-at-bol) (point-at-eol)) - (let* ((path (thread-first (org-get-outline-path t t) - (org-format-outline-path window-width nil "") - (org-split-string ""))) - (path (if org-ql-completing-read-reverse-paths - (string-join (nreverse path) "\\") - (string-join path "/")))) - (puthash path (point-marker) table) - path)) + (cons (org-entry-get nil "ITEM") (point-marker))) -(defun org-ql-completing-read-annotate (candidate table) - "FIXME: Docstring." +(defun org-ql-completing-read-snippet (marker) (while-no-input ;; Using `while-no-input' here doesn't make it as ;; responsive as, e.g. Helm while typing, but it seems to ;; help a little when using the org-rifle-style snippets. - (or (org-ql-completing-read-snippet (gethash candidate table)) ""))) - -(defun org-ql-completing-read-snippet (marker) - (org-with-point-at marker - (or (funcall org-ql-completing-read-snippet-function snippet-regexp) - (org-ql-completing-read--snippet-simple)))) + (org-with-point-at marker + (or (funcall org-ql-completing-read-snippet-function) + (org-ql-completing-read--snippet-simple))))) ;;;;; Completing read ;;;###autoload -(cl-defun org-ql-completing-read (buffers-files &key query-prefix query-filter - (action #'org-ql-completing-read-action) - (annotate #'org-ql-completing-read-annotate) - (collection-filter #'identity) - (prompt "Find entry: ")) +(cl-defun org-ql-completing-read + (buffers-files &key query-prefix query-filter + (action #'org-ql-completing-read-action) + (annotate #'org-ql-completing-read-snippet) + (snippet #'org-ql-completing-read-snippet) + (path (lambda (marker) + (org-with-point-at marker + (let* ((path (thread-first (org-get-outline-path nil t) + (org-format-outline-path (window-width) nil "") + (org-split-string ""))) + (formatted-path (if org-ql-completing-read-reverse-paths + (concat "\\" (string-join (reverse path) "\\")) + (concat "/" (string-join path "/"))))) + formatted-path)))) + (action-filter #'list) + (prompt "Find entry: ")) "Return marker at Org entry in BUFFERS-FILES selected with `org-ql'. PROMPT is shown to the user. @@ -135,7 +140,7 @@ single predicate)." (let ((table (make-hash-table :test #'equal)) (disambiguations (make-hash-table :test #'equal)) (window-width (window-width)) - last-input org-outline-path-cache query-tokens snippet-regexp) + last-input org-outline-path-cache query-tokens) (cl-labels (;; (debug-message ;; (f &rest args) (apply #'message (concat "ORG-QL-COMPLETING-READ: " f) args)) (action @@ -177,7 +182,7 @@ single predicate)." (cl-loop for completion in completions for marker = (get-text-property 0 'org-marker completion) for prefix = (todo marker) - for suffix = (concat (path marker) " " (snippet marker)) + for suffix = (concat (funcall path marker) " " (funcall snippet marker)) collect (list completion prefix suffix))) (annotate (candidate) ;; (debug-message "ANNOTATE:%S" candidate) @@ -268,35 +273,30 @@ single predicate)." (clrhash disambiguations) (when query-filter (setf input (funcall query-filter input))) - (pcase org-ql-completing-read-snippet-function - ('org-ql-completing-read--snippet-regexp - (setf query-tokens - ;; Remove any tokens that specify predicates or are too short. - (--select (not (or (string-match-p (rx bos (1+ (not (any ":"))) ":") it) - (< (length it) org-ql-completing-read-snippet-minimum-token-length))) - (split-string input nil t (rx space))) - snippet-regexp - (when query-tokens - ;; Limiting each context word to 15 characters prevents - ;; excessively long, non-word strings from ending up in - ;; snippets, which can adversely affect performance. - (rx-to-string `(seq (optional (repeat 1 3 (repeat 1 15 (not space)) (0+ space))) - bow (or ,@query-tokens) (0+ (not space)) - (optional (repeat 1 3 (0+ space) (repeat 1 15 (not space)))))))))) + (setf query-tokens + ;; Remove any tokens that specify predicates or are too short. + (--select (not (or (string-match-p (rx bos (1+ (not (any ":"))) ":") it) + (< (length it) org-ql-completing-read-snippet-minimum-token-length))) + (split-string input nil t (rx space))) + org-ql-completing-read-input-regexp + (when query-tokens + ;; Limiting each context word to 15 characters prevents + ;; excessively long, non-word strings from ending up in + ;; snippets, which can adversely affect performance. + (rx-to-string `(seq (optional (repeat 1 3 (repeat 1 15 (not space)) (0+ space))) + bow (or ,@query-tokens) (0+ (not space)) + (optional (repeat 1 3 (0+ space) (repeat 1 15 (not space)))))))) + ;; NOTE: It seems that the `completing-read' machinery can call, abort, and re-call the + ;; collection function while the user is typing, which can interrupt the machinery Org uses to + ;; prepare an Org buffer when an Org file is loaded. This results in, e.g. the buffer being + ;; left in fundamental-mode, unprepared to be used as an Org buffer, which breaks many things + ;; and is very confusing for the user. Ideally, of course, we would solve this in + ;; `org-ql-select', and we already attempt to, but that function is called by the + ;; `completing-read' machinery, which interrupts it, so we must work around this problem by + ;; ensuring all of the BUFFERS-FILES are loaded and initialized before calling + ;; `completing-read'. (org-ql-select buffers-files (org-ql--query-string-to-sexp input) :action #'action)))) - ;; NOTE: It seems that the `completing-read' machinery can call, abort, and re-call the - ;; collection function while the user is typing, which can interrupt the machinery Org uses to - ;; prepare an Org buffer when an Org file is loaded. This results in, e.g. the buffer being - ;; left in fundamental-mode, unprepared to be used as an Org buffer, which breaks many things - ;; and is very confusing for the user. Ideally, of course, we would solve this in - ;; `org-ql-select', and we already attempt to, but that function is called by the - ;; `completing-read' machinery, which interrupts it, so we must work around this problem by - ;; ensuring all of the BUFFERS-FILES are loaded and initialized before calling - ;; `completing-read'. - (funcall collection-filter - (org-ql-select buffers-files (org-ql--query-string-to-sexp str) - :action #'action))))))) (unless (listp buffers-files) ;; Since we map across this argument, we ensure it's a list. (setf buffers-files (list buffers-files))) @@ -318,7 +318,7 @@ single predicate)." (car (hash-table-values table)) (user-error "No results for input")))))) -(defun org-ql-completing-read--snippet-simple (&optional _regexp) +(defun org-ql-completing-read--snippet-simple () "Return a snippet of the current entry. Returns up to `org-ql-completing-read-snippet-length' characters." (save-excursion diff --git a/org-ql-find.el b/org-ql-find.el index 34e39ee..c750f17 100644 --- a/org-ql-find.el +++ b/org-ql-find.el @@ -159,31 +159,33 @@ which see (but only the files are used)." (unless (eq major-mode 'org-mode) (user-error "This is not an Org buffer: %S" (current-buffer))) (current-buffer))))) - (let* ((org-ql-completing-read-snippet-function nil) - (marker (org-ql-completing-read buffers-files - :query-prefix "rifle:" - :query-filter (lambda (input) - (replace-regexp-in-string (rx (1+ space)) "," input t t)) + (let* ((marker (org-ql-completing-read buffers-files + :query-prefix query-prefix + :query-filter query-filter :prompt prompt - :collection-filter #'flatten-list - :action (lambda (table) + :action-filter #'identity + :action (lambda () (save-excursion - (cl-loop while (re-search-forward org-link-any-re (org-entry-end-position) t) + (cl-loop with limit = (org-entry-end-position) + while (re-search-forward org-link-any-re limit t) for link = (string-trim (match-string 0)) do (progn (set-text-properties 0 (length link) '(face org-link) link) - (setf link (org-link-display-format link)) - (puthash link (copy-marker (match-beginning 0)) table)) - collect link))) - :annotate (lambda (candidate table) - (org-with-point-at (gethash candidate table) - (concat " " - (org-format-outline-path (reverse (org-get-outline-path 'with-self)) - nil nil "\\") - "::" - (abbreviate-file-name (buffer-file-name)))))))) + (setf link (org-link-display-format link))) + collect (cons link (copy-marker (match-beginning 0)))))) + :snippet (lambda (&rest _) + "") + :path (lambda (marker) + (org-with-point-at marker + (let* ((path (thread-first (org-get-outline-path t t) + (org-format-outline-path (window-width) nil "") + (org-split-string ""))) + (formatted-path (if org-ql-completing-read-reverse-paths + (concat "\\" (string-join (reverse path) "\\")) + (concat "/" (string-join path "/"))))) + formatted-path)))))) (org-with-point-at marker - (org-open-at-point marker)))) + (org-open-at-point)))) (provide 'org-ql-find) From e030627aeb75d654e42e3e250ff108f950946a75 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 16 Mar 2023 07:39:29 -0500 Subject: [PATCH 035/145] WIP: Add display-sort-function --- org-ql-completing-read.el | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/org-ql-completing-read.el b/org-ql-completing-read.el index 127a866..0456a29 100644 --- a/org-ql-completing-read.el +++ b/org-ql-completing-read.el @@ -216,7 +216,16 @@ single predicate)." (cons 'category 'org-heading) (cons 'group-function #'group) (cons 'affixation-function #'affix) - (cons 'annotation-function #'annotate))) + (cons 'annotation-function #'annotate) + (cons 'display-sort-function + (lambda (strings) + (let ((quoted-tokens (mapcar #'regexp-quote query-tokens))) + (sort strings + (lambda (a b) + (cl-labels ((matches + (s) (cl-loop for token in quoted-tokens + count (string-match-p token s)))) + (> (matches a) (matches b)))))))))) (`t ;; (debug-message "COLLECTION:t INPUT:%S KEYS:%S" ;; input (hash-table-keys table)) From 6c18f133e9d29796fac0af75cc10e0ba8900b173 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 16 Mar 2023 07:44:10 -0500 Subject: [PATCH 036/145] Tidy: Function, docstrings, commented code --- org-ql-completing-read.el | 69 +++++++++++++++++++++++---------------- 1 file changed, 40 insertions(+), 29 deletions(-) diff --git a/org-ql-completing-read.el b/org-ql-completing-read.el index 0456a29..e787972 100644 --- a/org-ql-completing-read.el +++ b/org-ql-completing-read.el @@ -86,6 +86,11 @@ Returns (STRING . MARKER) cons." (cons (org-entry-get nil "ITEM") (point-marker))) (defun org-ql-completing-read-snippet (marker) + "Return snippet for entry at MARKER. +Returns value returned by function +`org-ql-completing-read-snippet-function' or +`org-ql-completing-read--snippet-simple', whichever returns a +value, or nil." (while-no-input ;; Using `while-no-input' here doesn't make it as ;; responsive as, e.g. Helm while typing, but it seems to @@ -94,6 +99,17 @@ Returns (STRING . MARKER) cons." (or (funcall org-ql-completing-read-snippet-function) (org-ql-completing-read--snippet-simple))))) +(defun org-ql-completing-read-path (marker) + "Return formatted outline path for entry at MARKER." + (org-with-point-at marker + (let* ((path (thread-first (org-get-outline-path nil t) + (org-format-outline-path (window-width) nil "") + (org-split-string ""))) + (formatted-path (if org-ql-completing-read-reverse-paths + (concat "\\" (string-join (reverse path) "\\")) + (concat "/" (string-join path "/"))))) + formatted-path))) + ;;;;; Completing read ;;;###autoload @@ -102,18 +118,10 @@ Returns (STRING . MARKER) cons." (action #'org-ql-completing-read-action) (annotate #'org-ql-completing-read-snippet) (snippet #'org-ql-completing-read-snippet) - (path (lambda (marker) - (org-with-point-at marker - (let* ((path (thread-first (org-get-outline-path nil t) - (org-format-outline-path (window-width) nil "") - (org-split-string ""))) - (formatted-path (if org-ql-completing-read-reverse-paths - (concat "\\" (string-join (reverse path) "\\")) - (concat "/" (string-join path "/"))))) - formatted-path)))) + (path #'org-ql-completing-read-path) (action-filter #'list) (prompt "Find entry: ")) - "Return marker at Org entry in BUFFERS-FILES selected with `org-ql'. + "Return marker at entry in BUFFERS-FILES selected with `org-ql'. PROMPT is shown to the user. QUERY-PREFIX may be a string to prepend to the query entered by @@ -139,31 +147,34 @@ single predicate)." ;; (message "ORG-QL-COMPLETING-READ: Starts.") (let ((table (make-hash-table :test #'equal)) (disambiguations (make-hash-table :test #'equal)) - (window-width (window-width)) last-input org-outline-path-cache query-tokens) (cl-labels (;; (debug-message ;; (f &rest args) (apply #'message (concat "ORG-QL-COMPLETING-READ: " f) args)) - (action - () (font-lock-ensure (point-at-bol) (point-at-eol)) - ;; FIXME: We want the fontified heading, and `org-heading-components' returns it + (action () + (font-lock-ensure (point-at-bol) (point-at-eol)) + ;; FIXME: We want the fontified string, and `org-heading-components' returns it ;; without properties, so we have to use `org-get-heading', which added additional ;; optional arguments in a certain Org version, so in those versions, it will ;; return priority cookies and comment strings. - (let ((heading (org-link-display-format (org-entry-get (point) "ITEM")))) - (if (string-empty-p heading) - ;; A heading's string can be empty, but we can't use one because it - ;; wouldn't be useful to the user; and if one is found, it's very - ;; likely to indicate an unnoticed mistake or corruption in the - ;; file: so display a warning and don't record it as a candidate. - (warn "Empty heading at %S in %S" (point) (buffer-name)) - (when (gethash heading table) - ;; Disambiguate heading (even adding the path isn't enough, because that could - ;; also be duplicated). - (if-let ((suffix (gethash heading disambiguations))) - (setf heading (format "%s <%s>" heading (cl-incf suffix))) - (setf heading (format "%s <%s>" heading (puthash heading 2 disambiguations))))) - (let ((marker (point-marker))) - (puthash (propertize heading 'org-marker marker) marker table))))) + + ;; This function needs to handle multiple candidates per + ;; call, so we loop over a list of values by default. + (pcase-dolist (`(,string . ,marker) (funcall action-filter (funcall action))) + (when string + (if (string-empty-p string) + ;; A heading's string can be empty, but we can't use one because it + ;; wouldn't be useful to the user; and if one is found, it's very + ;; likely to indicate an unnoticed mistake or corruption in the + ;; file: so display a warning and don't record it as a candidate. + (warn "Empty heading at %S" marker) + (when (gethash string table) + ;; Disambiguate string (even adding the path isn't enough, because that could + ;; also be duplicated). + (if-let ((suffix (gethash string disambiguations))) + (setf string (format "%s <%s>" string (cl-incf suffix))) + (setf string (format "%s <%s>" string (puthash string 2 disambiguations))))) + (puthash (propertize string 'org-marker marker) marker table))))) + (path (marker) (org-with-point-at marker (let* ((path (thread-first (org-get-outline-path nil t) From 3f08d45ace858f184dcc96511df05738ffcd1d89 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Fri, 22 Sep 2023 22:03:30 -0500 Subject: [PATCH 037/145] Fix: (org-ql-completing-read-action) Format link --- org-ql-completing-read.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org-ql-completing-read.el b/org-ql-completing-read.el index e787972..7870247 100644 --- a/org-ql-completing-read.el +++ b/org-ql-completing-read.el @@ -83,7 +83,7 @@ To be used in, e.g. annotation functions.") "Default action for `org-ql-completing-read'. Returns (STRING . MARKER) cons." (font-lock-ensure (point-at-bol) (point-at-eol)) - (cons (org-entry-get nil "ITEM") (point-marker))) + (cons (org-link-display-format (org-entry-get nil "ITEM")) (point-marker))) (defun org-ql-completing-read-snippet (marker) "Return snippet for entry at MARKER. From 9aba73a28b7c09822f016caae41408b8963ac104 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Fri, 22 Sep 2023 22:57:28 -0500 Subject: [PATCH 038/145] WIP --- org-ql-completing-read.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/org-ql-completing-read.el b/org-ql-completing-read.el index 7870247..d67ca86 100644 --- a/org-ql-completing-read.el +++ b/org-ql-completing-read.el @@ -147,6 +147,7 @@ single predicate)." ;; (message "ORG-QL-COMPLETING-READ: Starts.") (let ((table (make-hash-table :test #'equal)) (disambiguations (make-hash-table :test #'equal)) + (window-width (window-width)) last-input org-outline-path-cache query-tokens) (cl-labels (;; (debug-message ;; (f &rest args) (apply #'message (concat "ORG-QL-COMPLETING-READ: " f) args)) @@ -206,7 +207,7 @@ single predicate)." (marker) (when-let ((snippet (org-with-point-at marker - (or (funcall org-ql-completing-read-snippet-function snippet-regexp) + (or (funcall org-ql-completing-read-snippet-function org-ql-completing-read-input-regexp) (org-ql-completing-read--snippet-simple))))) (propertize (concat " " snippet) 'face 'org-ql-completing-read-snippet))) From 7ecb4a8b10bcfebc50107df6892faf10987c9478 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Fri, 22 Sep 2023 22:58:05 -0500 Subject: [PATCH 039/145] Tidy --- org-ql-completing-read.el | 5 ----- 1 file changed, 5 deletions(-) diff --git a/org-ql-completing-read.el b/org-ql-completing-read.el index d67ca86..23a5aea 100644 --- a/org-ql-completing-read.el +++ b/org-ql-completing-read.el @@ -153,11 +153,6 @@ single predicate)." ;; (f &rest args) (apply #'message (concat "ORG-QL-COMPLETING-READ: " f) args)) (action () (font-lock-ensure (point-at-bol) (point-at-eol)) - ;; FIXME: We want the fontified string, and `org-heading-components' returns it - ;; without properties, so we have to use `org-get-heading', which added additional - ;; optional arguments in a certain Org version, so in those versions, it will - ;; return priority cookies and comment strings. - ;; This function needs to handle multiple candidates per ;; call, so we loop over a list of values by default. (pcase-dolist (`(,string . ,marker) (funcall action-filter (funcall action))) From 40b25ac3193a5ce4dc79e24537270c754b42647a Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Fri, 22 Sep 2023 23:12:06 -0500 Subject: [PATCH 040/145] Fix: (org-ql-completing-read-snippet) while-no-input --- org-ql-completing-read.el | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/org-ql-completing-read.el b/org-ql-completing-read.el index 23a5aea..7807c64 100644 --- a/org-ql-completing-read.el +++ b/org-ql-completing-read.el @@ -91,13 +91,17 @@ Returns value returned by function `org-ql-completing-read-snippet-function' or `org-ql-completing-read--snippet-simple', whichever returns a value, or nil." - (while-no-input - ;; Using `while-no-input' here doesn't make it as - ;; responsive as, e.g. Helm while typing, but it seems to - ;; help a little when using the org-rifle-style snippets. - (org-with-point-at marker - (or (funcall org-ql-completing-read-snippet-function) - (org-ql-completing-read--snippet-simple))))) + (pcase (while-no-input + ;; Using `while-no-input' here doesn't make it as + ;; responsive as, e.g. Helm while typing, but it seems to + ;; help a little when using the org-rifle-style snippets. + (org-with-point-at marker + (or (funcall org-ql-completing-read-snippet-function) + (org-ql-completing-read--snippet-simple)))) + (`t + ;; Interrupted: return nil (which can be concatted). + nil) + (else else))) (defun org-ql-completing-read-path (marker) "Return formatted outline path for entry at MARKER." From a802579f865b7975eb67345ea6091a0a2dd9b6d2 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 25 Oct 2023 03:19:29 -0500 Subject: [PATCH 041/145] Tidy --- org-ql-completing-read.el | 40 +++++++++++++++++++-------------------- org-ql-find.el | 7 ++++++- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/org-ql-completing-read.el b/org-ql-completing-read.el index 7807c64..8284502 100644 --- a/org-ql-completing-read.el +++ b/org-ql-completing-read.el @@ -81,7 +81,7 @@ To be used in, e.g. annotation functions.") (defun org-ql-completing-read-action () "Default action for `org-ql-completing-read'. -Returns (STRING . MARKER) cons." +Returns (STRING . MARKER) cons for entry at point." (font-lock-ensure (point-at-bol) (point-at-eol)) (cons (org-link-display-format (org-entry-get nil "ITEM")) (point-marker))) @@ -98,21 +98,19 @@ value, or nil." (org-with-point-at marker (or (funcall org-ql-completing-read-snippet-function) (org-ql-completing-read--snippet-simple)))) - (`t - ;; Interrupted: return nil (which can be concatted). + (`t ;; Interrupted: return nil (which can be concatted). nil) (else else))) (defun org-ql-completing-read-path (marker) "Return formatted outline path for entry at MARKER." (org-with-point-at marker - (let* ((path (thread-first (org-get-outline-path nil t) - (org-format-outline-path (window-width) nil "") - (org-split-string ""))) - (formatted-path (if org-ql-completing-read-reverse-paths - (concat "\\" (string-join (reverse path) "\\")) - (concat "/" (string-join path "/"))))) - formatted-path))) + (let ((path (thread-first (org-get-outline-path nil t) + (org-format-outline-path (window-width) nil "") + (org-split-string "")))) + (if org-ql-completing-read-reverse-paths + (concat "\\" (string-join (reverse path) "\\")) + (concat "/" (string-join path "/")))))) ;;;;; Completing read @@ -166,7 +164,7 @@ single predicate)." ;; wouldn't be useful to the user; and if one is found, it's very ;; likely to indicate an unnoticed mistake or corruption in the ;; file: so display a warning and don't record it as a candidate. - (warn "Empty heading at %S" marker) + (display-warning 'org-ql-completing-read (format-message "Empty heading at %S" marker)) (when (gethash string table) ;; Disambiguate string (even adding the path isn't enough, because that could ;; also be duplicated). @@ -297,7 +295,7 @@ single predicate)." ;; Remove any tokens that specify predicates or are too short. (--select (not (or (string-match-p (rx bos (1+ (not (any ":"))) ":") it) (< (length it) org-ql-completing-read-snippet-minimum-token-length))) - (split-string input nil t (rx space))) + (split-string input nil t (rx blank))) org-ql-completing-read-input-regexp (when query-tokens ;; Limiting each context word to 15 characters prevents @@ -306,20 +304,20 @@ single predicate)." (rx-to-string `(seq (optional (repeat 1 3 (repeat 1 15 (not space)) (0+ space))) bow (or ,@query-tokens) (0+ (not space)) (optional (repeat 1 3 (0+ space) (repeat 1 15 (not space)))))))) - ;; NOTE: It seems that the `completing-read' machinery can call, abort, and re-call the - ;; collection function while the user is typing, which can interrupt the machinery Org uses to - ;; prepare an Org buffer when an Org file is loaded. This results in, e.g. the buffer being - ;; left in fundamental-mode, unprepared to be used as an Org buffer, which breaks many things - ;; and is very confusing for the user. Ideally, of course, we would solve this in - ;; `org-ql-select', and we already attempt to, but that function is called by the - ;; `completing-read' machinery, which interrupts it, so we must work around this problem by - ;; ensuring all of the BUFFERS-FILES are loaded and initialized before calling - ;; `completing-read'. (org-ql-select buffers-files (org-ql--query-string-to-sexp input) :action #'action)))) (unless (listp buffers-files) ;; Since we map across this argument, we ensure it's a list. (setf buffers-files (list buffers-files))) + ;; NOTE: It seems that the `completing-read' machinery can call, abort, and re-call the + ;; collection function while the user is typing, which can interrupt the machinery Org uses to + ;; prepare an Org buffer when an Org file is loaded. This results in, e.g. the buffer being + ;; left in fundamental-mode, unprepared to be used as an Org buffer, which breaks many things + ;; and is very confusing for the user. Ideally, of course, we would solve this in + ;; `org-ql-select', and we already attempt to, but that function is called by the + ;; `completing-read' machinery, which interrupts it, so we must work around this problem by + ;; ensuring all of the BUFFERS-FILES are loaded and initialized before calling + ;; `completing-read'. (mapc #'org-ql--ensure-buffer buffers-files) (let* ((completion-styles '(org-ql-completing-read)) (completion-styles-alist (list (list 'org-ql-completing-read #'try #'all "Org QL Find"))) diff --git a/org-ql-find.el b/org-ql-find.el index c750f17..394b3a4 100644 --- a/org-ql-find.el +++ b/org-ql-find.el @@ -144,7 +144,12 @@ which see (but only the files are used)." ;;;###autoload (cl-defun org-ql-open-link (buffers-files &key query-prefix query-filter (prompt "Open link: ")) - "FIXME: Docstring." + "Open a link selected with `org-ql-completing-read'. +Links found in entries matching the input query are offered as +candidates, and the selected one is opened with +`org-open-at-point'. Arguments BUFFERS-FILES, QUERY-FILTER, +QUERY-PREFIX, and PROMPT are passed to `org-ql-completing-read', +which see." (interactive ;; FIXME: Factor this out. (list (if current-prefix-arg From 58d29d0fff1160a0d9c6c95d46a8467c5309b0f8 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 25 Oct 2023 03:21:03 -0500 Subject: [PATCH 042/145] Comment: Add FIXME --- org-ql-completing-read.el | 1 + 1 file changed, 1 insertion(+) diff --git a/org-ql-completing-read.el b/org-ql-completing-read.el index 8284502..3f25345 100644 --- a/org-ql-completing-read.el +++ b/org-ql-completing-read.el @@ -118,6 +118,7 @@ value, or nil." (cl-defun org-ql-completing-read (buffers-files &key query-prefix query-filter (action #'org-ql-completing-read-action) + ;; FIXME: Unused argument. (annotate #'org-ql-completing-read-snippet) (snippet #'org-ql-completing-read-snippet) (path #'org-ql-completing-read-path) From 2319fc9d8baf98883a7aea833c86104d9e4e6a0b Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 25 Oct 2023 03:29:03 -0500 Subject: [PATCH 043/145] Docs: Update changelog, Usage --- README.org | 7 ++ org-ql.info | 183 ++++++++++++++++++++++++++++++---------------------- 2 files changed, 113 insertions(+), 77 deletions(-) diff --git a/README.org b/README.org index cf3cbb7..bdc2e99 100644 --- a/README.org +++ b/README.org @@ -119,6 +119,12 @@ Note that these commands are compatible with [[https://github.com/oantolin/embar [[images/org-ql-find.png]] +*** org-ql-open-link + +This command finds links in entries matching the input query and offers them for selection; the selected link is then opened with ~org-open-at-point~. + +The input is matched using the default predicate, which means it searches both entry content and outline paths. This is helpful when a collection of links are kept in Org files: rather than having to first visit the entry containing the desired link, then locate it within the entry, and then open it, the user can simply select the link and open it directly. For example, if an entry with the heading =Emacs= contained a link named =mailing list=, one could search for =Emacs list= and open the link to the mailing list directly. + *** org-ql-refile This command refiles the current Org entry to one selected by searching with Org QL completion. It searches files listed in ~org-refile-targets~ as well as the current buffer. @@ -554,6 +560,7 @@ Simple links may also be written manually in either sexp or non-sexp form, like: + Function ~org-ql-completing-read~, used by command ~org-ql-find~, now specifies the completion category as ~org-heading~, providing compatibility with [[https://github.com/oantolin/embark][Embark]]. (This is a powerful feature, as it means any ~org-ql-find~ result can be acted on from inside the search results with Embark, which provides common actions from Org Agenda and Org speed keys bindings.) ([[https://github.com/alphapapa/org-ql/issues/299][#299]]. Thanks to [[https://github.com/oantolin][Omar Antolín Camarena]], [[https://github.com/minad][Daniel Mendler]], and [[https://github.com/akirak][Akira Komamura]].) + Command ~org-ql-find~ may be called in an ~org-agenda~ or ~org-ql-view~ buffer to search the buffers which contributed to the agenda/view buffer. + Command ~org-ql-find-path~, which searches outline paths in the current buffer. ++ Command ~org-ql-open-link~, which finds links in entries matching the given query, and opens the selected one with ~org-open-at-point~. (This is helpful when a collection of links are kept in Org files: rather than having to first visit the entry containing the desired link, then locate it within the entry, and then open it, the user can simply select the link and open it directly.) *Compatibility* diff --git a/org-ql.info b/org-ql.info index cc86437..d187c05 100644 --- a/org-ql.info +++ b/org-ql.info @@ -48,6 +48,7 @@ Usage Commands * org-ql-find:: +* org-ql-open-link:: * org-ql-refile:: * org-ql-search:: * helm-org-ql:: @@ -207,6 +208,7 @@ File: README.info, Node: Commands, Next: Queries, Up: Usage * Menu: * org-ql-find:: +* org-ql-open-link:: * org-ql-refile:: * org-ql-search:: * helm-org-ql:: @@ -216,7 +218,7 @@ File: README.info, Node: Commands, Next: Queries, Up: Usage * org-ql-sparse-tree::  -File: README.info, Node: org-ql-find, Next: org-ql-refile, Up: Commands +File: README.info, Node: org-ql-find, Next: org-ql-open-link, Up: Commands 4.1.1 org-ql-find ----------------- @@ -237,9 +239,28 @@ called on a completion candidate (i.e. a search result) to act on it immediately, without having to visit the entry in its source Org buffer.  -File: README.info, Node: org-ql-refile, Next: org-ql-search, Prev: org-ql-find, Up: Commands +File: README.info, Node: org-ql-open-link, Next: org-ql-refile, Prev: org-ql-find, Up: Commands -4.1.2 org-ql-refile +4.1.2 org-ql-open-link +---------------------- + +This command finds links in entries matching the input query and offers +them for selection; the selected link is then opened with +‘org-open-at-point’. + + The input is matched using the default predicate, which means it +searches both entry content and outline paths. This is helpful when a +collection of links are kept in Org files: rather than having to first +visit the entry containing the desired link, then locate it within the +entry, and then open it, the user can simply select the link and open it +directly. For example, if an entry with the heading ‘Emacs’ contained a +link named ‘mailing list’, one could search for ‘Emacs list’ and open +the link to the mailing list directly. + + +File: README.info, Node: org-ql-refile, Next: org-ql-search, Prev: org-ql-open-link, Up: Commands + +4.1.3 org-ql-refile ------------------- This command refiles the current Org entry to one selected by searching @@ -249,7 +270,7 @@ with Org QL completion. It searches files listed in  File: README.info, Node: org-ql-search, Next: helm-org-ql, Prev: org-ql-refile, Up: Commands -4.1.3 org-ql-search +4.1.4 org-ql-search ------------------- _Note: This command supports both sexp queries and ._ @@ -297,7 +318,7 @@ entry in its source Org buffer.  File: README.info, Node: helm-org-ql, Next: org-ql-view, Prev: org-ql-search, Up: Commands -4.1.4 helm-org-ql +4.1.5 helm-org-ql ----------------- _Note: This command uses . It is available separately in the package @@ -311,7 +332,7 @@ _Note: This command uses . It is available separately in the package  File: README.info, Node: org-ql-view, Next: org-ql-view-sidebar, Prev: helm-org-ql, Up: Commands -4.1.5 org-ql-view +4.1.6 org-ql-view ----------------- Choose and display a view stored in ‘org-ql-views’. @@ -326,7 +347,7 @@ Choose and display a view stored in ‘org-ql-views’.  File: README.info, Node: org-ql-view-sidebar, Next: org-ql-view-recent-items, Prev: org-ql-view, Up: Commands -4.1.6 org-ql-view-sidebar +4.1.7 org-ql-view-sidebar ------------------------- Show a sidebar window listing views stored in ‘org-ql-views’ for easy @@ -336,7 +357,7 @@ point, and press ‘c’ to customize the view at point.  File: README.info, Node: org-ql-view-recent-items, Next: org-ql-sparse-tree, Prev: org-ql-view-sidebar, Up: Commands -4.1.7 org-ql-view-recent-items +4.1.8 org-ql-view-recent-items ------------------------------ Show items in ‘FILES’ from last ‘DAYS’ days with timestamps of ‘TYPE’. @@ -347,7 +368,7 @@ returned by the function ‘org-agenda-files’.  File: README.info, Node: org-ql-sparse-tree, Prev: org-ql-view-recent-items, Up: Commands -4.1.8 org-ql-sparse-tree +4.1.9 org-ql-sparse-tree ------------------------ Arguments: ‘(query &key keep-previous (buffer (current-buffer)))’ @@ -1059,6 +1080,13 @@ File: README.info, Node: 08-pre, Next: 073, Up: Changelog agenda/view buffer. • Command ‘org-ql-find-path’, which searches outline paths in the current buffer. + • Command ‘org-ql-open-link’, which finds links in entries matching + the given query, and opens the selected one with + ‘org-open-at-point’. (This is helpful when a collection of links + are kept in Org files: rather than having to first visit the entry + containing the desired link, then locate it within the entry, and + then open it, the user can simply select the link and open it + directly.) *Compatibility* @@ -1811,74 +1839,75 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1824 -Node: Screenshots1947 -Node: Installation2065 -Node: Quelpa2579 -Node: Helm support3107 -Node: Usage3510 -Node: Commands3908 -Node: org-ql-find4352 -Node: org-ql-refile5167 -Node: org-ql-search5490 -Node: helm-org-ql7421 -Node: org-ql-view7799 -Node: org-ql-view-sidebar8329 -Node: org-ql-view-recent-items8709 -Node: org-ql-sparse-tree9205 -Node: Queries10005 -Node: Non-sexp query syntax11122 -Node: General predicates12881 -Node: Ancestor/descendant predicates19868 -Node: Date/time predicates20996 -Node: Functions / Macros24120 -Node: Agenda-like views24418 -Ref: Function org-ql-block24580 -Node: Listing / acting-on results25841 -Ref: Caching26049 -Ref: Function org-ql-select26962 -Ref: Function org-ql-query29388 -Ref: Macro org-ql (deprecated)31162 -Node: Custom predicates31477 -Ref: Macro org-ql-defpred31701 -Node: Dynamic block35142 -Node: Links37866 -Node: Tips38553 -Node: Changelog38877 -Node: 08-pre39687 -Node: 07341020 -Node: 07241755 -Node: 07142674 -Node: 0743483 -Node: 06346407 -Node: 06246938 -Node: 06147243 -Node: 0647811 -Node: 05250865 -Node: 05151167 -Node: 0551592 -Node: 04953123 -Node: 04853405 -Node: 04753754 -Node: 04654163 -Node: 04554571 -Node: 04454932 -Node: 04355291 -Node: 04255494 -Node: 04155655 -Node: 0455902 -Node: 03260003 -Node: 03160406 -Node: 0360603 -Node: 02363903 -Node: 02264137 -Node: 02164417 -Node: 0264622 -Node: 0168700 -Node: Notes68801 -Node: Comparison with Org Agenda searches68963 -Node: org-sidebar69852 -Node: License70131 +Node: Contents1845 +Node: Screenshots1968 +Node: Installation2086 +Node: Quelpa2600 +Node: Helm support3128 +Node: Usage3531 +Node: Commands3929 +Node: org-ql-find4394 +Node: org-ql-open-link5212 +Node: org-ql-refile6067 +Node: org-ql-search6395 +Node: helm-org-ql8326 +Node: org-ql-view8704 +Node: org-ql-view-sidebar9234 +Node: org-ql-view-recent-items9614 +Node: org-ql-sparse-tree10110 +Node: Queries10910 +Node: Non-sexp query syntax12027 +Node: General predicates13786 +Node: Ancestor/descendant predicates20773 +Node: Date/time predicates21901 +Node: Functions / Macros25025 +Node: Agenda-like views25323 +Ref: Function org-ql-block25485 +Node: Listing / acting-on results26746 +Ref: Caching26954 +Ref: Function org-ql-select27867 +Ref: Function org-ql-query30293 +Ref: Macro org-ql (deprecated)32067 +Node: Custom predicates32382 +Ref: Macro org-ql-defpred32606 +Node: Dynamic block36047 +Node: Links38771 +Node: Tips39458 +Node: Changelog39782 +Node: 08-pre40592 +Node: 07342357 +Node: 07243092 +Node: 07144011 +Node: 0744820 +Node: 06347744 +Node: 06248275 +Node: 06148580 +Node: 0649148 +Node: 05252202 +Node: 05152504 +Node: 0552929 +Node: 04954460 +Node: 04854742 +Node: 04755091 +Node: 04655500 +Node: 04555908 +Node: 04456269 +Node: 04356628 +Node: 04256831 +Node: 04156992 +Node: 0457239 +Node: 03261340 +Node: 03161743 +Node: 0361940 +Node: 02365240 +Node: 02265474 +Node: 02165754 +Node: 0265959 +Node: 0170037 +Node: Notes70138 +Node: Comparison with Org Agenda searches70300 +Node: org-sidebar71189 +Node: License71468  End Tag Table From e885001a2ad14b8367ce66e011ecd6088782f677 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 1 Nov 2023 14:37:59 -0500 Subject: [PATCH 044/145] Comment: Add TODO --- org-ql-find.el | 1 + 1 file changed, 1 insertion(+) diff --git a/org-ql-find.el b/org-ql-find.el index 394b3a4..13c2016 100644 --- a/org-ql-find.el +++ b/org-ql-find.el @@ -137,6 +137,7 @@ which see (but only the files are used)." ;;;###autoload (defun org-ql-find-path () "Call `org-ql-find' to search outline paths in the current buffer." + ;; TODO: Use same interactive form as `org-ql-find'. (interactive) (let ((org-ql-default-predicate 'outline-path)) (org-ql-find (current-buffer)))) From 72b9934d1f98635492513c106f27a220bb829b01 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Mon, 6 Nov 2023 15:52:33 -0600 Subject: [PATCH 045/145] Change: (org-ql-find.el) Factor out interactive form And use in org-ql-find-path. --- org-ql-find.el | 76 ++++++++++++++++++++++++++++---------------------- 1 file changed, 42 insertions(+), 34 deletions(-) diff --git a/org-ql-find.el b/org-ql-find.el index 13c2016..03a2829 100644 --- a/org-ql-find.el +++ b/org-ql-find.el @@ -49,7 +49,7 @@ See function `display-buffer'." :type 'sexp) -;;;; Functions +;;;; Commands ;;;###autoload (cl-defun org-ql-find (buffers-files &key query-prefix query-filter @@ -70,19 +70,7 @@ types is filtered before execution (e.g. it could replace spaces with commas to turn multiple tokens, which would normally be treated as multiple predicates, into multiple arguments to a single predicate)." - (interactive - (list (if current-prefix-arg - (mapcar #'get-buffer - (completing-read-multiple - "Buffers: " - (cl-loop for buffer in (buffer-list) - when (eq 'org-mode (buffer-local-value 'major-mode buffer)) - collect (buffer-name buffer)) - nil t)) - (cond ((derived-mode-p 'org-agenda-mode) (or org-ql-view-buffers-files - org-agenda-contributing-files)) - ((derived-mode-p 'org-mode) (current-buffer)) - (t (user-error "This is not an Org-related buffer: %S" (current-buffer))))))) + (interactive (list (org-ql-find--buffers))) (let ((marker (org-ql-completing-read buffers-files :query-prefix query-prefix :query-filter query-filter @@ -135,12 +123,16 @@ which see (but only the files are used)." (org-ql-find (org-ql-search-directories-files))) ;;;###autoload -(defun org-ql-find-path () - "Call `org-ql-find' to search outline paths in the current buffer." - ;; TODO: Use same interactive form as `org-ql-find'. - (interactive) +(defun org-ql-find-path (buffers-files) + "Call `org-ql-find' to search outline paths in BUFFERS-FILES. +Interactively, search the buffers and files relevant to the +current buffer (i.e. in `org-agenda-mode', the value of +`org-ql-view-buffers-files' or `org-agenda-contributing-files'; +in `org-mode', that buffer). With universal prefix, select +multiple buffers to search with completion and PROMPT." + (interactive (list (org-ql-find--buffers))) (let ((org-ql-default-predicate 'outline-path)) - (org-ql-find (current-buffer)))) + (org-ql-find buffers-files))) ;;;###autoload (cl-defun org-ql-open-link (buffers-files &key query-prefix query-filter @@ -150,21 +142,14 @@ Links found in entries matching the input query are offered as candidates, and the selected one is opened with `org-open-at-point'. Arguments BUFFERS-FILES, QUERY-FILTER, QUERY-PREFIX, and PROMPT are passed to `org-ql-completing-read', -which see." - (interactive - ;; FIXME: Factor this out. - (list (if current-prefix-arg - (mapcar #'get-buffer - (completing-read-multiple - "Buffers: " - (cl-loop for buffer in (buffer-list) - when (eq 'org-mode (buffer-local-value 'major-mode buffer)) - collect (buffer-name buffer)) - nil t)) - (progn - (unless (eq major-mode 'org-mode) - (user-error "This is not an Org buffer: %S" (current-buffer))) - (current-buffer))))) +which see. + +Interactively, search the buffers and files relevant to the +current buffer (i.e. in `org-agenda-mode', the value of +`org-ql-view-buffers-files' or `org-agenda-contributing-files'; +in `org-mode', that buffer). With universal prefix, select +multiple buffers to search with completion and PROMPT." + (interactive (list (org-ql-find--buffers))) (let* ((marker (org-ql-completing-read buffers-files :query-prefix query-prefix :query-filter query-filter @@ -193,6 +178,29 @@ which see." (org-with-point-at marker (org-open-at-point)))) +;;;; Functions + +(defun org-ql-find--buffers () + "Return list of buffers to search in. +In a mode derived from `org-agenda-mode', return the value of +`org-ql-view-buffers-files' or `org-agenda-contributing-files'. +In a mode derived from `org-mode', return the current buffer. +When `current-prefix-arg', read a list of buffers in `org-mode' +with completion. To be used in `org-ql-find' commands' +interactive forms." + (if current-prefix-arg + (mapcar #'get-buffer + (completing-read-multiple + "Buffers: " + (cl-loop for buffer in (buffer-list) + when (eq 'org-mode (buffer-local-value 'major-mode buffer)) + collect (buffer-name buffer)) + nil t)) + (cond ((derived-mode-p 'org-agenda-mode) (or org-ql-view-buffers-files + org-agenda-contributing-files)) + ((derived-mode-p 'org-mode) (current-buffer)) + (t (user-error "This is not an Org-related buffer: %S" (current-buffer)))))) + (provide 'org-ql-find) ;;; org-ql-find.el ends here From 4f62ba3bd6d639b021ee9f159357b2a80d7a2f92 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Mon, 6 Nov 2023 16:30:20 -0600 Subject: [PATCH 046/145] Fix: (org-ql-find) Pop to buffer then go to position Seems that selecting the window after going to the position can sometimes break (probably because of the window point). --- org-ql-find.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/org-ql-find.el b/org-ql-find.el index 03a2829..84dad91 100644 --- a/org-ql-find.el +++ b/org-ql-find.el @@ -76,9 +76,8 @@ single predicate)." :query-filter query-filter :prompt prompt))) (set-buffer (marker-buffer marker)) + (pop-to-buffer (current-buffer) org-ql-find-display-buffer-action) (goto-char marker) - (display-buffer (current-buffer) org-ql-find-display-buffer-action) - (select-window (get-buffer-window (current-buffer))) (run-hook-with-args 'org-ql-find-goto-hook))) ;;;###autoload From 5775848b8a89ddb970f9d77c706f261e95638e9b Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sat, 16 Dec 2023 03:56:58 -0600 Subject: [PATCH 047/145] Meta: v0.7.4-pre --- README.org | 4 + org-ql.el | 2 +- org-ql.info | 207 +++++++++++++++++++++++++++------------------------- 3 files changed, 114 insertions(+), 99 deletions(-) diff --git a/README.org b/README.org index b8893e0..3fa1607 100644 --- a/README.org +++ b/README.org @@ -542,6 +542,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.7.4-pre + +Nothing new yet. + ** 0.7.3 *Fixes* diff --git a/org-ql.el b/org-ql.el index 1bf1900..568225d 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.7.3 +;; Version: 0.7.4-pre ;; Package-Requires: ((emacs "26.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 94eb443..998316a 100644 --- a/org-ql.info +++ b/org-ql.info @@ -71,6 +71,7 @@ Functions / Macros Changelog +* 0.7.4-pre: 074-pre. * 0.7.3: 073. * 0.7.2: 072. * 0.7.1: 071. @@ -993,6 +994,7 @@ releases. * Menu: +* 0.7.4-pre: 074-pre. * 0.7.3: 073. * 0.7.2: 072. * 0.7.1: 071. @@ -1024,9 +1026,17 @@ releases. * 0.1: 01.  -File: README.info, Node: 073, Next: 072, Up: Changelog +File: README.info, Node: 074-pre, Next: 073, Up: Changelog -5.1 0.7.3 +5.1 0.7.4-pre +============= + +Nothing new yet. + + +File: README.info, Node: 073, Next: 072, Prev: 074-pre, Up: Changelog + +5.2 0.7.3 ========= *Fixes* @@ -1044,7 +1054,7 @@ File: README.info, Node: 073, Next: 072, Up: Changelog  File: README.info, Node: 072, Next: 071, Prev: 073, Up: Changelog -5.2 0.7.2 +5.3 0.7.2 ========= *Fixes* @@ -1065,7 +1075,7 @@ File: README.info, Node: 072, Next: 071, Prev: 073, Up: Changelog  File: README.info, Node: 071, Next: 07, Prev: 072, Up: Changelog -5.3 0.7.1 +5.4 0.7.1 ========= *Fixes* @@ -1084,7 +1094,7 @@ File: README.info, Node: 071, Next: 07, Prev: 072, Up: Changelog  File: README.info, Node: 07, Next: 063, Prev: 071, Up: Changelog -5.4 0.7 +5.5 0.7 ======= *Added* @@ -1144,7 +1154,7 @@ File: README.info, Node: 07, Next: 063, Prev: 071, Up: Changelog  File: README.info, Node: 063, Next: 062, Prev: 07, Up: Changelog -5.5 0.6.3 +5.6 0.6.3 ========= *Fixed* @@ -1160,7 +1170,7 @@ File: README.info, Node: 063, Next: 062, Prev: 07, Up: Changelog  File: README.info, Node: 062, Next: 061, Prev: 063, Up: Changelog -5.6 0.6.2 +5.7 0.6.2 ========= *Fixed* @@ -1171,7 +1181,7 @@ File: README.info, Node: 062, Next: 061, Prev: 063, Up: Changelog  File: README.info, Node: 061, Next: 06, Prev: 062, Up: Changelog -5.7 0.6.1 +5.8 0.6.1 ========= *Fixed* @@ -1189,7 +1199,7 @@ File: README.info, Node: 061, Next: 06, Prev: 062, Up: Changelog  File: README.info, Node: 06, Next: 052, Prev: 061, Up: Changelog -5.8 0.6 +5.9 0.6 ======= *Added* @@ -1256,8 +1266,8 @@ File: README.info, Node: 06, Next: 052, Prev: 061, Up: Changelog  File: README.info, Node: 052, Next: 051, Prev: 06, Up: Changelog -5.9 0.5.2 -========= +5.10 0.5.2 +========== *Fixed* • Predicate ‘link’’s ‘:target’ and ‘:regexp-p’ arguments. (#220 @@ -1267,7 +1277,7 @@ File: README.info, Node: 052, Next: 051, Prev: 06, Up: Changelog  File: README.info, Node: 051, Next: 05, Prev: 052, Up: Changelog -5.10 0.5.1 +5.11 0.5.1 ========== *Fixed* @@ -1280,7 +1290,7 @@ File: README.info, Node: 051, Next: 05, Prev: 052, Up: Changelog  File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog -5.11 0.5 +5.12 0.5 ======== *Added* @@ -1321,7 +1331,7 @@ File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog  File: README.info, Node: 049, Next: 048, Prev: 05, Up: Changelog -5.12 0.4.9 +5.13 0.4.9 ========== *Fixed* @@ -1332,7 +1342,7 @@ File: README.info, Node: 049, Next: 048, Prev: 05, Up: Changelog  File: README.info, Node: 048, Next: 047, Prev: 049, Up: Changelog -5.13 0.4.8 +5.14 0.4.8 ========== *Fixed* @@ -1344,7 +1354,7 @@ File: README.info, Node: 048, Next: 047, Prev: 049, Up: Changelog  File: README.info, Node: 047, Next: 046, Prev: 048, Up: Changelog -5.14 0.4.7 +5.15 0.4.7 ========== *Fixed* @@ -1357,7 +1367,7 @@ File: README.info, Node: 047, Next: 046, Prev: 048, Up: Changelog  File: README.info, Node: 046, Next: 045, Prev: 047, Up: Changelog -5.15 0.4.6 +5.16 0.4.6 ========== *Fixed* @@ -1370,7 +1380,7 @@ File: README.info, Node: 046, Next: 045, Prev: 047, Up: Changelog  File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog -5.16 0.4.5 +5.17 0.4.5 ========== *Fixed* @@ -1382,7 +1392,7 @@ File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog  File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog -5.17 0.4.4 +5.18 0.4.4 ========== *Fixed* @@ -1394,7 +1404,7 @@ File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog  File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog -5.18 0.4.3 +5.19 0.4.3 ========== *Fixed* @@ -1404,7 +1414,7 @@ File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog  File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog -5.19 0.4.2 +5.20 0.4.2 ========== *Fixed* @@ -1413,7 +1423,7 @@ File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog  File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog -5.20 0.4.1 +5.21 0.4.1 ========== *Fixed* @@ -1423,7 +1433,7 @@ File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog  File: README.info, Node: 04, Next: 032, Prev: 041, Up: Changelog -5.21 0.4 +5.22 0.4 ======== _Note:_ The next release, 0.5, may include changes which will require @@ -1504,7 +1514,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.22 0.3.2 +5.23 0.3.2 ========== *Fixed* @@ -1517,7 +1527,7 @@ File: README.info, Node: 032, Next: 031, Prev: 04, Up: Changelog  File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog -5.23 0.3.1 +5.24 0.3.1 ========== *Fixed* @@ -1527,7 +1537,7 @@ File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog  File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog -5.24 0.3 +5.25 0.3 ======== *Added* @@ -1595,7 +1605,7 @@ File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog  File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog -5.25 0.2.3 +5.26 0.2.3 ========== *Fixed* @@ -1605,7 +1615,7 @@ File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog  File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog -5.26 0.2.2 +5.27 0.2.2 ========== *Fixed* @@ -1616,7 +1626,7 @@ File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog  File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog -5.27 0.2.1 +5.28 0.2.1 ========== *Fixed* @@ -1626,7 +1636,7 @@ File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog  File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog -5.28 0.2 +5.29 0.2 ======== *Added* @@ -1709,7 +1719,7 @@ File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog  File: README.info, Node: 01, Prev: 02, Up: Changelog -5.29 0.1 +5.30 0.1 ======== First tagged release. @@ -1767,73 +1777,74 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1805 -Node: Screenshots1928 -Node: Installation2046 -Node: Quelpa2560 -Node: Helm support3088 -Node: Usage3491 -Node: Commands3889 -Node: org-ql-find4333 -Node: org-ql-refile4799 -Node: org-ql-search5122 -Node: helm-org-ql6818 -Node: org-ql-view7196 -Node: org-ql-view-sidebar7726 -Node: org-ql-view-recent-items8106 -Node: org-ql-sparse-tree8602 -Node: Queries9402 -Node: Non-sexp query syntax10519 -Node: General predicates12278 -Node: Ancestor/descendant predicates19265 -Node: Date/time predicates20393 -Node: Functions / Macros23517 -Node: Agenda-like views23815 -Ref: Function org-ql-block23977 -Node: Listing / acting-on results25238 -Ref: Caching25446 -Ref: Function org-ql-select26359 -Ref: Function org-ql-query28785 -Ref: Macro org-ql (deprecated)30559 -Node: Custom predicates30874 -Ref: Macro org-ql-defpred31098 -Node: Dynamic block34539 -Node: Links37263 -Node: Tips37950 -Node: Changelog38274 -Node: 07339065 -Node: 07239785 -Node: 07140704 -Node: 0741513 -Node: 06344437 -Node: 06244968 -Node: 06145273 -Node: 0645841 -Node: 05248895 -Node: 05149195 -Node: 0549620 -Node: 04951151 -Node: 04851433 -Node: 04751782 -Node: 04652191 -Node: 04552599 -Node: 04452960 -Node: 04353319 -Node: 04253522 -Node: 04153683 -Node: 0453930 -Node: 03258031 -Node: 03158434 -Node: 0358631 -Node: 02361931 -Node: 02262165 -Node: 02162445 -Node: 0262650 -Node: 0166728 -Node: Notes66829 -Node: Comparison with Org Agenda searches66991 -Node: org-sidebar67880 -Node: License68159 +Node: Contents1827 +Node: Screenshots1950 +Node: Installation2068 +Node: Quelpa2582 +Node: Helm support3110 +Node: Usage3513 +Node: Commands3911 +Node: org-ql-find4355 +Node: org-ql-refile4821 +Node: org-ql-search5144 +Node: helm-org-ql6840 +Node: org-ql-view7218 +Node: org-ql-view-sidebar7748 +Node: org-ql-view-recent-items8128 +Node: org-ql-sparse-tree8624 +Node: Queries9424 +Node: Non-sexp query syntax10541 +Node: General predicates12300 +Node: Ancestor/descendant predicates19287 +Node: Date/time predicates20415 +Node: Functions / Macros23539 +Node: Agenda-like views23837 +Ref: Function org-ql-block23999 +Node: Listing / acting-on results25260 +Ref: Caching25468 +Ref: Function org-ql-select26381 +Ref: Function org-ql-query28807 +Ref: Macro org-ql (deprecated)30581 +Node: Custom predicates30896 +Ref: Macro org-ql-defpred31120 +Node: Dynamic block34561 +Node: Links37285 +Node: Tips37972 +Node: Changelog38296 +Node: 074-pre39109 +Node: 07339221 +Node: 07239957 +Node: 07140876 +Node: 0741685 +Node: 06344609 +Node: 06245140 +Node: 06145445 +Node: 0646013 +Node: 05249067 +Node: 05149369 +Node: 0549794 +Node: 04951325 +Node: 04851607 +Node: 04751956 +Node: 04652365 +Node: 04552773 +Node: 04453134 +Node: 04353493 +Node: 04253696 +Node: 04153857 +Node: 0454104 +Node: 03258205 +Node: 03158608 +Node: 0358805 +Node: 02362105 +Node: 02262339 +Node: 02162619 +Node: 0262824 +Node: 0166902 +Node: Notes67003 +Node: Comparison with Org Agenda searches67165 +Node: org-sidebar68054 +Node: License68333  End Tag Table From 7a6b622cd025d0244e10bf11758001335d64eb02 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sat, 16 Dec 2023 03:57:35 -0600 Subject: [PATCH 048/145] Fix: Ignore empty quoted strings when parsing string queries Fixes #383. Reported-by: Adam Porter --- README.org | 3 ++- org-ql.el | 18 ++++++++++++++++-- tests/test-org-ql.el | 8 ++++++++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/README.org b/README.org index 3fa1607..ba7ad9d 100644 --- a/README.org +++ b/README.org @@ -544,7 +544,8 @@ Simple links may also be written manually in either sexp or non-sexp form, like: ** 0.7.4-pre -Nothing new yet. +*Fixes* ++ Ignore empty quoted strings in plain-string queries ([[https://github.com/alphapapa/org-ql/issues/383][#383]]). ** 0.7.3 diff --git a/org-ql.el b/org-ql.el index 568225d..96a3235 100644 --- a/org-ql.el +++ b/org-ql.el @@ -285,6 +285,11 @@ Matches with or without time.") :link '(custom-manual "(org-ql)Usage") :link '(url-link "https://github.com/alphapapa/org-ql")) +(defcustom org-ql-signal-peg-failure nil + "Signal an error when parsing a plain-string query fails. +This should only be enabled while debugging." + :type 'boolean) + (defcustom org-ql-ask-unsafe-queries t "Ask before running a query that could run arbitrary code. Org QL queries in sexp form can contain arbitrary expressions. @@ -950,7 +955,7 @@ value of `org-ql-predicates')." (term (or (and negation (list positive-term) ;; This is a bit confusing, but it seems to work. There's probably a better way. `(pred -- (list 'not (car pred)))) - positive-term)) + positive-term empty-quote)) (positive-term (or (and predicate-with-args `(pred args -- (cons (intern pred) args))) (and predicate-without-args `(pred -- (list (intern pred)))) (and plain-string `(s -- (list org-ql-default-predicate s))))) @@ -963,6 +968,12 @@ value of `org-ql-predicates')." (keyword (substring (+ (not (or separator "=" "\"" (syntax-class whitespace))) (any)))) (quoted-arg "\"" (substring (+ (not (or separator "\"")) (any))) "\"") (unquoted-arg (substring (+ (not (or separator "\"" (syntax-class whitespace))) (any)))) + (empty-quote + ;; This avoids aborting parsing or signaling an + ;; error if the user types in two successive + ;; quotation marks while typing a query (e.g. when + ;; using electric-pair-mode). + "\"\"") (negation "!") (separator "," ))) (closure (lambda (input &optional boolean) @@ -983,7 +994,10 @@ value of `org-ql-predicates')." ;; have to borrow some code. It ends up that we only have to ;; borrow this `with-peg-rules' call, which isn't too bad. (eval `(with-peg-rules ,pexs - (peg-run (peg ,(caar pexs)) #'peg-signal-failure)))))) + (peg-run (peg ,(caar pexs)) + (lambda (failures) + (when org-ql-signal-peg-failure + (peg-signal-failure failures))))))))) (pcase parsed-sexp (`(,one-predicate) one-predicate) (`(,_ . ,_) (cons boolean (reverse parsed-sexp))) diff --git a/tests/test-org-ql.el b/tests/test-org-ql.el index 9008179..12e8eb0 100644 --- a/tests/test-org-ql.el +++ b/tests/test-org-ql.el @@ -648,6 +648,14 @@ with keyword arg NOW in PLIST." ;; TODO: Other predicates. + (it "Ignores empty quoted strings" + (expect (org-ql--query-string-to-sexp "\"\"") + :to-equal nil) + (expect (org-ql--query-string-to-sexp "foo \"\" bar") + :to-equal '(and (rifle "foo") (rifle "bar"))) + (expect (org-ql--query-string-to-sexp "foo \"baz\" bar") + :to-equal '(and (rifle "foo") (rifle "baz") (rifle "bar")))) + (it "Negated terms" (expect (org-ql--query-string-to-sexp "todo: !todo:CHECK,SOMEDAY") :to-equal '(and (todo) (not (todo "CHECK" "SOMEDAY")))) From 38e16b4a5f9148d2aba0e8a17cfe123771e981a5 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sat, 16 Dec 2023 04:11:01 -0600 Subject: [PATCH 049/145] Release: v0.7.4 --- README.org | 2 +- org-ql.el | 2 +- org-ql.info | 152 ++++++++++++++++++++++++++-------------------------- 3 files changed, 79 insertions(+), 77 deletions(-) diff --git a/README.org b/README.org index ba7ad9d..3ad7c23 100644 --- a/README.org +++ b/README.org @@ -542,7 +542,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.7.4-pre +** 0.7.4 *Fixes* + Ignore empty quoted strings in plain-string queries ([[https://github.com/alphapapa/org-ql/issues/383][#383]]). diff --git a/org-ql.el b/org-ql.el index 96a3235..571b63c 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.7.4-pre +;; Version: 0.7.4 ;; Package-Requires: ((emacs "26.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 998316a..9ac9522 100644 --- a/org-ql.info +++ b/org-ql.info @@ -71,7 +71,7 @@ Functions / Macros Changelog -* 0.7.4-pre: 074-pre. +* 0.7.4: 074. * 0.7.3: 073. * 0.7.2: 072. * 0.7.1: 071. @@ -994,7 +994,7 @@ releases. * Menu: -* 0.7.4-pre: 074-pre. +* 0.7.4: 074. * 0.7.3: 073. * 0.7.2: 072. * 0.7.1: 071. @@ -1026,15 +1026,17 @@ releases. * 0.1: 01.  -File: README.info, Node: 074-pre, Next: 073, Up: Changelog +File: README.info, Node: 074, Next: 073, Up: Changelog -5.1 0.7.4-pre -============= +5.1 0.7.4 +========= -Nothing new yet. +*Fixes* + • Ignore empty quoted strings in plain-string queries (#383 + (https://github.com/alphapapa/org-ql/issues/383)).  -File: README.info, Node: 073, Next: 072, Prev: 074-pre, Up: Changelog +File: README.info, Node: 073, Next: 072, Prev: 074, Up: Changelog 5.2 0.7.3 ========= @@ -1777,74 +1779,74 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1827 -Node: Screenshots1950 -Node: Installation2068 -Node: Quelpa2582 -Node: Helm support3110 -Node: Usage3513 -Node: Commands3911 -Node: org-ql-find4355 -Node: org-ql-refile4821 -Node: org-ql-search5144 -Node: helm-org-ql6840 -Node: org-ql-view7218 -Node: org-ql-view-sidebar7748 -Node: org-ql-view-recent-items8128 -Node: org-ql-sparse-tree8624 -Node: Queries9424 -Node: Non-sexp query syntax10541 -Node: General predicates12300 -Node: Ancestor/descendant predicates19287 -Node: Date/time predicates20415 -Node: Functions / Macros23539 -Node: Agenda-like views23837 -Ref: Function org-ql-block23999 -Node: Listing / acting-on results25260 -Ref: Caching25468 -Ref: Function org-ql-select26381 -Ref: Function org-ql-query28807 -Ref: Macro org-ql (deprecated)30581 -Node: Custom predicates30896 -Ref: Macro org-ql-defpred31120 -Node: Dynamic block34561 -Node: Links37285 -Node: Tips37972 -Node: Changelog38296 -Node: 074-pre39109 -Node: 07339221 -Node: 07239957 -Node: 07140876 -Node: 0741685 -Node: 06344609 -Node: 06245140 -Node: 06145445 -Node: 0646013 -Node: 05249067 -Node: 05149369 -Node: 0549794 -Node: 04951325 -Node: 04851607 -Node: 04751956 -Node: 04652365 -Node: 04552773 -Node: 04453134 -Node: 04353493 -Node: 04253696 -Node: 04153857 -Node: 0454104 -Node: 03258205 -Node: 03158608 -Node: 0358805 -Node: 02362105 -Node: 02262339 -Node: 02162619 -Node: 0262824 -Node: 0166902 -Node: Notes67003 -Node: Comparison with Org Agenda searches67165 -Node: org-sidebar68054 -Node: License68333 +Node: Contents1819 +Node: Screenshots1942 +Node: Installation2060 +Node: Quelpa2574 +Node: Helm support3102 +Node: Usage3505 +Node: Commands3903 +Node: org-ql-find4347 +Node: org-ql-refile4813 +Node: org-ql-search5136 +Node: helm-org-ql6832 +Node: org-ql-view7210 +Node: org-ql-view-sidebar7740 +Node: org-ql-view-recent-items8120 +Node: org-ql-sparse-tree8616 +Node: Queries9416 +Node: Non-sexp query syntax10533 +Node: General predicates12292 +Node: Ancestor/descendant predicates19279 +Node: Date/time predicates20407 +Node: Functions / Macros23531 +Node: Agenda-like views23829 +Ref: Function org-ql-block23991 +Node: Listing / acting-on results25252 +Ref: Caching25460 +Ref: Function org-ql-select26373 +Ref: Function org-ql-query28799 +Ref: Macro org-ql (deprecated)30573 +Node: Custom predicates30888 +Ref: Macro org-ql-defpred31112 +Node: Dynamic block34553 +Node: Links37277 +Node: Tips37964 +Node: Changelog38288 +Node: 07439093 +Node: 07339305 +Node: 07240037 +Node: 07140956 +Node: 0741765 +Node: 06344689 +Node: 06245220 +Node: 06145525 +Node: 0646093 +Node: 05249147 +Node: 05149449 +Node: 0549874 +Node: 04951405 +Node: 04851687 +Node: 04752036 +Node: 04652445 +Node: 04552853 +Node: 04453214 +Node: 04353573 +Node: 04253776 +Node: 04153937 +Node: 0454184 +Node: 03258285 +Node: 03158688 +Node: 0358885 +Node: 02362185 +Node: 02262419 +Node: 02162699 +Node: 0262904 +Node: 0166982 +Node: Notes67083 +Node: Comparison with Org Agenda searches67245 +Node: org-sidebar68134 +Node: License68413  End Tag Table From a31baebc4ffb75649825683fb1fcf897bf4bebef Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sat, 16 Dec 2023 04:40:39 -0600 Subject: [PATCH 050/145] Add: (org-ql-view--format-element) org-category property Hopefully this does not cause a noticeable performance impact. Maybe the new org-element caching features in Org will help with that. Fixes #363. Reported-by: Gabriele Mongiano --- README.org | 1 + org-ql-view.el | 11 +++++++- org-ql.info | 73 +++++++++++++++++++++++++++----------------------- 3 files changed, 50 insertions(+), 35 deletions(-) diff --git a/README.org b/README.org index f468d25..2a97f10 100644 --- a/README.org +++ b/README.org @@ -561,6 +561,7 @@ Simple links may also be written manually in either sexp or non-sexp form, like: + Command ~org-ql-find~ may be called in an ~org-agenda~ or ~org-ql-view~ buffer to search the buffers which contributed to the agenda/view buffer. + Command ~org-ql-find-path~, which searches outline paths in the current buffer. + Command ~org-ql-open-link~, which finds links in entries matching the given query, and opens the selected one with ~org-open-at-point~. (This is helpful when a collection of links are kept in Org files: rather than having to first visit the entry containing the desired link, then locate it within the entry, and then open it, the user can simply select the link and open it directly.) ++ Items in ~org-ql-view~ buffers now include the ~org-category~ text property, like Org Agenda buffers, which allows grouping with ~org-super-agenda~'s category-related selectors. ([[https://github.com/alphapapa/org-ql/issues/363][#363]]. Thanks to [[https://github.com/kofm][Gabriele Mongiano]] for reporting.) *Compatibility* diff --git a/org-ql-view.el b/org-ql-view.el index 034e762..1bb7837 100644 --- a/org-ql-view.el +++ b/org-ql-view.el @@ -889,7 +889,15 @@ return an empty string." (s-join ":" it) (s-wrap it ":") (org-add-props it nil 'face 'org-tag)))) - ;; (category (org-element-property :category element)) + (category (or (org-element-property :CATEGORY element) + (when-let ((marker (or (org-element-property :org-hd-marker element) + (org-element-property :org-marker element)))) + (org-with-point-at marker + (or (org-get-category) + (when buffer-file-name + (file-name-sans-extension + (file-name-nondirectory buffer-file-name)))))) + "")) (priority-string (-some->> (org-element-property :priority element) (char-to-string) (format "[#%s]") @@ -909,6 +917,7 @@ return an empty string." (concat " " it) (org-add-props it properties 'org-agenda-type 'search + 'org-category category 'todo-state todo-keyword 'tags tag-list 'org-habit-p habit-property))))) diff --git a/org-ql.info b/org-ql.info index e965a29..1adeaa1 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1089,6 +1089,11 @@ File: README.info, Node: 08-pre, Next: 074, Up: Changelog containing the desired link, then locate it within the entry, and then open it, the user can simply select the link and open it directly.) + • Items in ‘org-ql-view’ buffers now include the ‘org-category’ text + property, like Org Agenda buffers, which allows grouping with + ‘org-super-agenda’’s category-related selectors. (#363 + (https://github.com/alphapapa/org-ql/issues/363). Thanks to + Gabriele Mongiano (https://github.com/kofm) for reporting.) *Compatibility* @@ -1887,40 +1892,40 @@ Node: Links38785 Node: Tips39472 Node: Changelog39796 Node: 08-pre40620 -Node: 07442385 -Node: 07342612 -Node: 07243344 -Node: 07144263 -Node: 0745072 -Node: 06347996 -Node: 06248527 -Node: 06148832 -Node: 0649400 -Node: 05252456 -Node: 05152758 -Node: 0553183 -Node: 04954714 -Node: 04854996 -Node: 04755345 -Node: 04655754 -Node: 04556162 -Node: 04456523 -Node: 04356882 -Node: 04257085 -Node: 04157246 -Node: 0457493 -Node: 03261594 -Node: 03161997 -Node: 0362194 -Node: 02365494 -Node: 02265728 -Node: 02166008 -Node: 0266213 -Node: 0170291 -Node: Notes70392 -Node: Comparison with Org Agenda searches70554 -Node: org-sidebar71443 -Node: License71722 +Node: 07442732 +Node: 07342959 +Node: 07243691 +Node: 07144610 +Node: 0745419 +Node: 06348343 +Node: 06248874 +Node: 06149179 +Node: 0649747 +Node: 05252803 +Node: 05153105 +Node: 0553530 +Node: 04955061 +Node: 04855343 +Node: 04755692 +Node: 04656101 +Node: 04556509 +Node: 04456870 +Node: 04357229 +Node: 04257432 +Node: 04157593 +Node: 0457840 +Node: 03261941 +Node: 03162344 +Node: 0362541 +Node: 02365841 +Node: 02266075 +Node: 02166355 +Node: 0266560 +Node: 0170638 +Node: Notes70739 +Node: Comparison with Org Agenda searches70901 +Node: org-sidebar71790 +Node: License72069  End Tag Table From 0ab236f95b0616699ab63d99011e673c000ba5cf Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sat, 16 Dec 2023 05:14:34 -0600 Subject: [PATCH 051/145] Tidy: Docstring The compiler still complains that it has wrong usage of an unescaped single quote, but nothing seems to fix it. --- org-ql.el | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/org-ql.el b/org-ql.el index 17deec8..aad8ff0 100644 --- a/org-ql.el +++ b/org-ql.el @@ -1135,7 +1135,7 @@ defined in `org-ql-predicates' by calling `org-ql-defpred'." (byte-compile 'org-ql--query-preamble))) (cl-defmacro org-ql-defpred (name args docstring &key body preambles normalizers coalesce) - "Define an `org-ql' selector predicate named `org-ql--predicate-NAME'. + "Define an \\+`org-ql' selector predicate \\=`org-ql--predicate-NAME'. NAME may be a symbol or a list of symbols: if a list, the first is used as NAME and the rest are aliases. A function is only created for NAME, not for aliases, so a normalizer should be used @@ -1180,7 +1180,7 @@ to variables bound in the pattern: :case-fold Bound to `case-fold-search' around the regexp search. :query Expression which should replace the query expression, - or `query' if it should not be changed (e.g. if the + or \\+`query' if it should not be changed (e.g. if the regexp is insufficient to determine whether a heading matches, in which case the predicate's body needs to be tested on the heading). If the regexp @@ -1207,7 +1207,7 @@ e.g. a predicate takes keyword arguments, so arguments to multiple calls can't be simply appended.) For convenience, within the `pcase' patterns, the symbol -`predicate-names' is a special form which is replaced with a +\\+`predicate-names' is a special form which is replaced with a pattern matching any of the predicate's name and aliases. For example, if NAME were: @@ -1215,13 +1215,13 @@ example, if NAME were: Then if NORMALIZERS were: - ((`(,predicate-names . ,args) - `(heading ,@args))) + ((\\=`(,predicate-names . ,args) + \\=`(heading ,@args))) It would be expanded to: - ((`(,(or 'heading 'h) . ,args) - `(heading ,@args)))" + ((\\=`(,(or 'heading 'h) . ,args) + \\=`(heading ,@args)))" ;; FIXME: Update defpred tutorial to include :coalesce. ;; NOTE: The debug form works, completely! For example, use `edebug-defun' From c62ff77cd3bcd58ce3a7669c1dd1ff9afe97bb6f Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sat, 16 Dec 2023 05:15:36 -0600 Subject: [PATCH 052/145] Tidy: Use compat and newer symbol names --- org-ql-completing-read.el | 4 ++-- org-ql-view.el | 6 +++--- org-ql.el | 5 +++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/org-ql-completing-read.el b/org-ql-completing-read.el index 3f25345..9c4c044 100644 --- a/org-ql-completing-read.el +++ b/org-ql-completing-read.el @@ -82,7 +82,7 @@ To be used in, e.g. annotation functions.") (defun org-ql-completing-read-action () "Default action for `org-ql-completing-read'. Returns (STRING . MARKER) cons for entry at point." - (font-lock-ensure (point-at-bol) (point-at-eol)) + (font-lock-ensure (pos-bol) (pos-eol)) (cons (org-link-display-format (org-entry-get nil "ITEM")) (point-marker))) (defun org-ql-completing-read-snippet (marker) @@ -155,7 +155,7 @@ single predicate)." (cl-labels (;; (debug-message ;; (f &rest args) (apply #'message (concat "ORG-QL-COMPLETING-READ: " f) args)) (action () - (font-lock-ensure (point-at-bol) (point-at-eol)) + (font-lock-ensure (pos-bol) (pos-eol)) ;; This function needs to handle multiple candidates per ;; call, so we loop over a list of values by default. (pcase-dolist (`(,string . ,marker) (funcall action-filter (funcall action))) diff --git a/org-ql-view.el b/org-ql-view.el index 1bb7837..5c3b9a2 100644 --- a/org-ql-view.el +++ b/org-ql-view.el @@ -302,10 +302,10 @@ SLOT is passed to `display-buffer-in-side-window', which see." (defun org-ql-view-switch () "Switch to view at point." (interactive) - (let ((key (buffer-substring-no-properties (point-at-bol) (point-at-eol)))) + (let ((key (buffer-substring-no-properties (pos-bol) (pos-eol)))) (unless (string-empty-p key) (ov-clear :org-ql-view-selected) - (ov (point-at-bol) (1+ (point-at-eol)) :org-ql-view-selected t + (ov (pos-bol) (1+ (pos-eol)) :org-ql-view-selected t 'face '(:weight bold :inherit highlight)) (org-ql-view key)))) @@ -369,7 +369,7 @@ update search arguments." (defun org-ql-view-customize () "Customize view at point in `org-ql-view-sidebar' buffer." (interactive) - (let ((key (buffer-substring-no-properties (point-at-bol) (point-at-eol)))) + (let ((key (buffer-substring-no-properties (pos-bol) (pos-eol)))) (customize-option 'org-ql-views) (search-forward (concat "Name: " key)))) diff --git a/org-ql.el b/org-ql.el index aad8ff0..adc2bec 100644 --- a/org-ql.el +++ b/org-ql.el @@ -5,7 +5,7 @@ ;; Author: Adam Porter ;; Url: https://github.com/alphapapa/org-ql ;; Version: 0.8-pre -;; Package-Requires: ((emacs "26.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")) +;; Package-Requires: ((emacs "26.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 ;;; License: @@ -43,6 +43,7 @@ (require 'seq) (require 'subr-x) +(require 'compat) (require 'dash) (require 'map) (require 'ts) @@ -1973,7 +1974,7 @@ language. Matching is done case-insensitively." (point))) (contents-end (progn (goto-char (match-end 0)) - (point-at-bol)))) + (pos-bol)))) (cl-loop for re in regexps do (goto-char contents-beg) always (re-search-forward re contents-end t)))))))))) From 004ed1ee0ff73de2fdbb1721bc06e2b7c8bdeef4 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sat, 16 Dec 2023 05:22:08 -0600 Subject: [PATCH 053/145] Tidy: Indentation For Emacs 29.1's and with-simulated-input's changes. --- org-ql-search.el | 22 +-- org-ql-view.el | 80 ++++----- org-ql.el | 403 +++++++++++++++++++++---------------------- tests/test-org-ql.el | 121 +++++++------ 4 files changed, 312 insertions(+), 314 deletions(-) diff --git a/org-ql-search.el b/org-ql-search.el index b029544..da1cfb3 100644 --- a/org-ql-search.el +++ b/org-ql-search.el @@ -341,17 +341,17 @@ this (must be a single line in the Org buffer): (setf elements (cl-etypecase take ((and integer (satisfies cl-minusp)) (-take-last (abs take) elements)) (integer (-take take elements))))) - (cl-labels ((format-element - (element) (string-join (cl-loop for column in columns - collect (or (pcase-exhaustive column - ((pred symbolp) - (funcall (alist-get column format-fns) element)) - (`((,column . ,args) ,_header) - (apply (alist-get column format-fns) element args)) - (`(,column ,_header) - (funcall (alist-get column format-fns) element))) - "")) - " | "))) + (cl-labels ((format-element (element) + (string-join (cl-loop for column in columns + collect (or (pcase-exhaustive column + ((pred symbolp) + (funcall (alist-get column format-fns) element)) + (`((,column . ,args) ,_header) + (apply (alist-get column format-fns) element args)) + (`(,column ,_header) + (funcall (alist-get column format-fns) element))) + "")) + " | "))) ;; Table header (insert "| " (string-join (--map (pcase it ((pred symbolp) (capitalize (symbol-name it))) diff --git a/org-ql-view.el b/org-ql-view.el index 5c3b9a2..84507a4 100644 --- a/org-ql-view.el +++ b/org-ql-view.el @@ -487,11 +487,11 @@ If TITLE, prepend it to the header." Makes QUERY more readable, e.g. timestamp objects are replaced with human-readable strings." (cl-labels ((rec (form) - (cl-typecase form - (ts (ts-format form)) - (cons (cons (rec (car form)) - (rec (cdr form)))) - (otherwise form)))) + (cl-typecase form + (ts (ts-format form)) + (cons (cons (rec (car form)) + (rec (cdr form)))) + (otherwise form)))) (format "%S" (rec query)))) (defun org-ql-view--font-lock-string (mode s) @@ -533,14 +533,14 @@ dates in the past, and negative for dates in the future." (defun org-ql-view-bookmark-make-record () "Return a bookmark record for the current Org QL View buffer." - (cl-labels ((file-nameize - (b-f) (abbreviate-file-name - (cl-typecase b-f - (string b-f) - (buffer (or (buffer-file-name b-f) - (when (buffer-base-buffer b-f) - (buffer-file-name (buffer-base-buffer b-f))))) - (t (user-error "Only file-backed buffers can be bookmarked by Org QL View: %s" b-f)))))) + (cl-labels ((file-nameize (b-f) + (abbreviate-file-name + (cl-typecase b-f + (string b-f) + (buffer (or (buffer-file-name b-f) + (when (buffer-base-buffer b-f) + (buffer-file-name (buffer-base-buffer b-f))))) + (t (user-error "Only file-backed buffers can be bookmarked by Org QL View: %s" b-f)))))) (-let* ((plist (org-ql-view--plist (current-buffer))) ((&plist :buffers-files) plist)) ;; Replace buffers with their filenames, and signal error if any are not file-backed. @@ -655,23 +655,25 @@ When opened, the link searches the buffer it's opened from." (when org-ql-view-query ;; Only Org QL View buffers should have `org-ql-view-query' set. (cl-labels ((prompt-for (buffers-files) - (pcase-exhaustive - (completing-read (format "Make link that searches: ") - '("file link is in" "files currently searched") - nil t nil nil "file link is in") - ("file link is in" nil) - ("files currently searched" buffers-files))) - (strings-or-file-buffers-p - (thing) (cl-etypecase thing - (list (cl-every #'strings-or-file-buffers-p thing)) - (string thing) - (buffer (or (buffer-file-name thing) - ;; TODO: Should indirect buffers be allowed? Maybe not, since their narrowing isn't preserved. - ;; On the other hand, it's possible to accidentally make a search view for an indirect buffer - ;; that's since been widened, and forcing the user to manually change that would be awkward, - ;; and trying to communicate the problem would be difficult, so maybe it's okay to allow it. - (when (buffer-base-buffer thing) - (buffer-file-name (buffer-base-buffer thing)))))))) + (pcase-exhaustive + (completing-read (format "Make link that searches: ") + '("file link is in" "files currently searched") + nil t nil nil "file link is in") + ("file link is in" nil) + ("files currently searched" buffers-files))) + (strings-or-file-buffers-p (thing) + (cl-etypecase thing + (list (cl-every #'strings-or-file-buffers-p thing)) + (string thing) + (buffer (or (buffer-file-name thing) + ;; TODO: Should indirect buffers be allowed? Maybe not, since their + ;; narrowing isn't preserved. On the other hand, it's possible to + ;; accidentally make a search view for an indirect buffer that's + ;; since been widened, and forcing the user to manually change that + ;; would be awkward, and trying to communicate the problem would be + ;; difficult, so maybe it's okay to allow it. + (when (buffer-base-buffer thing) + (buffer-file-name (buffer-base-buffer thing)))))))) (unless (strings-or-file-buffers-p org-ql-view-buffers-files) (user-error "%s" "Views that search non-file-backed buffers can't be linked to")) (let* ((query-string (--if-let (org-ql--query-sexp-to-string org-ql-view-query) @@ -1048,11 +1050,11 @@ the variable), \"org-directory\" if it matches the value of current buffer. Otherwise BUFFERS-FILES is returned unchanged." ;; Used in `org-ql-view--complete-buffers-files' and ;; `org-ql-view--header-line-format'. - (cl-labels ((expand-files - (list) (--map (cl-typecase it - (string (expand-file-name it)) - (otherwise it)) - list))) + (cl-labels ((expand-files (list) + (--map (cl-typecase it + (string (expand-file-name it)) + (otherwise it)) + list))) ;; TODO: Test this more exhaustively. (pcase buffers-files ((pred listp) @@ -1074,10 +1076,10 @@ current buffer. Otherwise BUFFERS-FILES is returned unchanged." (defun org-ql-view--complete-buffers-files () "Return value for `org-ql-view-buffers-files' using completion." - (cl-labels ((initial-input - () (when org-ql-view-buffers-files - (org-ql-view--contract-buffers-files - org-ql-view-buffers-files)))) + (cl-labels ((initial-input () + (when org-ql-view-buffers-files + (org-ql-view--contract-buffers-files + org-ql-view-buffers-files)))) (if (and org-ql-view-buffers-files (bufferp org-ql-view-buffers-files)) ;; Buffers can't be input by name, so if the default value is a buffer, just use it. diff --git a/org-ql.el b/org-ql.el index adc2bec..cc899f2 100644 --- a/org-ql.el +++ b/org-ql.el @@ -755,38 +755,38 @@ be coalesced." ;; can't be coalesced with it since they don't specify the same ;; language. That could be fixed, but it's probably not worth it. (cl-labels ((rec (sexp) - (pcase sexp - (`(,(and boolean (or 'or 'not)) . ,sexps) - `(,boolean ,@(mapcar #'rec sexps))) - (`(and . ,sexps) - (anded sexps)) - (_ sexp))) + (pcase sexp + (`(,(and boolean (or 'or 'not)) . ,sexps) + `(,boolean ,@(mapcar #'rec sexps))) + (`(and . ,sexps) + (anded sexps)) + (_ sexp))) (anded (sexps) - (let (anded-predicates new-sexp) - (dolist (sexp sexps) - (pcase sexp - (`(,(or 'or 'not) . ,_) - (push (rec sexp) new-sexp)) - (`(,predicate . ,args) - (pcase-exhaustive (plist-get (alist-get predicate org-ql-predicates) :coalesce) - (`nil (push sexp new-sexp)) - (`t (setf (alist-get predicate anded-predicates) - (append (alist-get predicate anded-predicates) args))) - ((and fn (pred functionp)) - (if-let (new-args (funcall fn (alist-get predicate anded-predicates) args)) - (setf (alist-get predicate anded-predicates) new-args) - (push sexp new-sexp))))))) - (delq nil `(and ,@(nreverse new-sexp) ,@(nreverse anded-predicates)))))) + (let (anded-predicates new-sexp) + (dolist (sexp sexps) + (pcase sexp + (`(,(or 'or 'not) . ,_) + (push (rec sexp) new-sexp)) + (`(,predicate . ,args) + (pcase-exhaustive (plist-get (alist-get predicate org-ql-predicates) :coalesce) + (`nil (push sexp new-sexp)) + (`t (setf (alist-get predicate anded-predicates) + (append (alist-get predicate anded-predicates) args))) + ((and fn (pred functionp)) + (if-let (new-args (funcall fn (alist-get predicate anded-predicates) args)) + (setf (alist-get predicate anded-predicates) new-args) + (push sexp new-sexp))))))) + (delq nil `(and ,@(nreverse new-sexp) ,@(nreverse anded-predicates)))))) (rec query))) (defun org-ql--sanity-check-form (form) "Signal error if any forms in FORM do not have preconditions met. Or, when possible, fix the problem." (cl-flet ((check (symbol) - (pcase symbol - ('done (unless org-done-keywords - ;; NOTE: This check needs to be done from within the Org buffer being checked. - (error "Variable `org-done-keywords' is nil. Are you running this from an Org buffer?")))))) + (pcase symbol + ('done (unless org-done-keywords + ;; NOTE: This check needs to be done from within the Org buffer being checked. + (error "Variable `org-done-keywords' is nil. Are you running this from an Org buffer?")))))) (cl-loop for elem in form if (consp elem) do (progn @@ -808,28 +808,27 @@ respectively." (and "\\" (0+ "\\\\") (any "[]")) (and (1+ "\\") (not (any "[]"))))))) (cl-labels - ((no-desc - (match) (rx-to-string `(seq (or bol (1+ blank)) - "[[" ,link-target-part (regexp ,match) ,link-target-part - "]]"))) - (match-both - (description target) - (rx-to-string `(seq (or bol (1+ blank)) - "[[" ,link-target-part (regexp ,target) ,link-target-part - "][" (*? anything) (regexp ,description) (*? anything) - "]]"))) + ((no-desc (match) + (rx-to-string `(seq (or bol (1+ blank)) + "[[" ,link-target-part (regexp ,match) ,link-target-part + "]]"))) + (match-both (description target) + (rx-to-string `(seq (or bol (1+ blank)) + "[[" ,link-target-part (regexp ,target) ,link-target-part + "][" (*? anything) (regexp ,description) (*? anything) + "]]"))) ;; Note that these actually allow empty descriptions ;; or targets, depending on what they are matching. - (match-desc - (match) (rx-to-string `(seq (or bol (1+ blank)) - "[[" ,link-target-part - "][" (*? anything) (regexp ,match) (*? anything) - "]]"))) - (match-target - (match) (rx-to-string `(seq (or bol (1+ blank)) - "[[" ,link-target-part (regexp ,match) ,link-target-part - "][" (*? anything) - "]]")))) + (match-desc (match) + (rx-to-string `(seq (or bol (1+ blank)) + "[[" ,link-target-part + "][" (*? anything) (regexp ,match) (*? anything) + "]]"))) + (match-target (match) + (rx-to-string `(seq (or bol (1+ blank)) + "[[" ,link-target-part (regexp ,match) ,link-target-part + "][" (*? anything) + "]]")))) (cond (description-or-target (rx-to-string `(or (regexp ,(no-desc description-or-target)) (regexp ,(match-desc description-or-target)) @@ -884,48 +883,48 @@ Arguments STRING, POS, FILL, and LEVEL are according to ;; NOTE: The pcases check for both t/nil symbols and strings, because the ;; string queries always return keyword arguments' values as strings. (cl-macrolet ((clocked (&key from to on) - `(org-ql--predicate-clocked :from ,from :to ,to)) + `(org-ql--predicate-clocked :from ,from :to ,to)) (closed (&key from to on (with-time 'not-found)) - `(org-ql--predicate-closed :from ,from :to ,to)) + `(org-ql--predicate-closed :from ,from :to ,to)) (deadline (&key from to on (with-time 'not-found)) - `(org-ql--predicate-deadline - :from ,from :to ,to :with-time ',with-time - :regexp ,(pcase-exhaustive with-time - ((or 't "t") org-ql-regexp-deadline-with-time) - ((or 'nil "nil") org-ql-regexp-deadline-without-time) - ('not-found org-ql-regexp-deadline)))) + `(org-ql--predicate-deadline + :from ,from :to ,to :with-time ',with-time + :regexp ,(pcase-exhaustive with-time + ((or 't "t") org-ql-regexp-deadline-with-time) + ((or 'nil "nil") org-ql-regexp-deadline-without-time) + ('not-found org-ql-regexp-deadline)))) (planning (&key from to on (with-time 'not-found)) - `(org-ql--predicate-planning - :from ,from :to ,to :with-time ',with-time - :regexp ,(pcase-exhaustive with-time - ((or 't "t") org-ql-regexp-planning-with-time) - ((or 'nil "nil") org-ql-regexp-planning-without-time) - ('not-found org-ql-regexp-planning)))) + `(org-ql--predicate-planning + :from ,from :to ,to :with-time ',with-time + :regexp ,(pcase-exhaustive with-time + ((or 't "t") org-ql-regexp-planning-with-time) + ((or 'nil "nil") org-ql-regexp-planning-without-time) + ('not-found org-ql-regexp-planning)))) (scheduled (&key from to on (with-time 'not-found)) - `(org-ql--predicate-scheduled - :from ,from :to ,to :with-time ',with-time - :regexp ,(pcase-exhaustive with-time - ((or 't "t") org-ql-regexp-scheduled-with-time) - ((or 'nil "nil") org-ql-regexp-scheduled-without-time) - ('not-found org-ql-regexp-scheduled)))) + `(org-ql--predicate-scheduled + :from ,from :to ,to :with-time ',with-time + :regexp ,(pcase-exhaustive with-time + ((or 't "t") org-ql-regexp-scheduled-with-time) + ((or 'nil "nil") org-ql-regexp-scheduled-without-time) + ('not-found org-ql-regexp-scheduled)))) (ts (&key from to on (type 'both) (with-time 'not-found)) - ;; NOTE: The TYPE argument is elided from the arguments actually passed to the predicate, being converted to the REGEXP argument. - ;; MAYBE: Move the :regexp handling out of this macrolet and into the normalizer. - `(org-ql--predicate-ts - :from ,from :to ,to :with-time ',with-time - :regexp ,(pcase type - ((or 'nil 'both) (pcase-exhaustive with-time - ((or 't "t") org-ql-regexp-ts-both-with-time) - ((or 'nil "nil") org-ql-regexp-ts-both-without-time) - ('not-found org-ql-regexp-ts-both))) - ('active (pcase-exhaustive with-time - ((or 't "t") org-ql-regexp-ts-active-with-time) - ((or 'nil "nil") org-ql-regexp-ts-active-without-time) - ('not-found org-ql-regexp-ts-active))) - ('inactive (pcase-exhaustive with-time - ((or 't "t") org-ql-regexp-ts-inactive-with-time) - ((or 'nil "nil") org-ql-regexp-ts-inactive-without-time) - ('not-found org-ql-regexp-ts-inactive))))))) + ;; NOTE: The TYPE argument is elided from the arguments actually passed to the predicate, being converted to the REGEXP argument. + ;; MAYBE: Move the :regexp handling out of this macrolet and into the normalizer. + `(org-ql--predicate-ts + :from ,from :to ,to :with-time ',with-time + :regexp ,(pcase type + ((or 'nil 'both) (pcase-exhaustive with-time + ((or 't "t") org-ql-regexp-ts-both-with-time) + ((or 'nil "nil") org-ql-regexp-ts-both-without-time) + ('not-found org-ql-regexp-ts-both))) + ('active (pcase-exhaustive with-time + ((or 't "t") org-ql-regexp-ts-active-with-time) + ((or 'nil "nil") org-ql-regexp-ts-active-without-time) + ('not-found org-ql-regexp-ts-active))) + ('inactive (pcase-exhaustive with-time + ((or 't "t") org-ql-regexp-ts-inactive-with-time) + ((or 'nil "nil") org-ql-regexp-ts-inactive-without-time) + ('not-found org-ql-regexp-ts-inactive))))))) ,query))))) ;;;;; String query parsing @@ -1042,21 +1041,21 @@ This function is defined by calling `org-ql--define-normalize-query-fn', which uses normalizer forms defined in `org-ql-predicates' by calling `org-ql-defpred'." (cl-labels ((rec (element) - (pcase element - (`(or . ,clauses) `(or ,@(mapcar #'rec clauses))) - (`(and . ,clauses) `(and ,@(mapcar #'rec clauses))) - (`(not . ,clauses) `(not ,@(mapcar #'rec clauses))) - (`(when ,condition . ,clauses) `(when ,(rec condition) - ,@(mapcar #'rec clauses))) - (`(unless ,condition . ,clauses) `(unless ,(rec condition) - ,@(mapcar #'rec clauses))) - ;; TODO: Combine (regexp) when appropriate (i.e. inside an OR, not an AND). - ((pred stringp) `(,org-ql-default-predicate ,element)) + (pcase element + (`(or . ,clauses) `(or ,@(mapcar #'rec clauses))) + (`(and . ,clauses) `(and ,@(mapcar #'rec clauses))) + (`(not . ,clauses) `(not ,@(mapcar #'rec clauses))) + (`(when ,condition . ,clauses) `(when ,(rec condition) + ,@(mapcar #'rec clauses))) + (`(unless ,condition . ,clauses) `(unless ,(rec condition) + ,@(mapcar #'rec clauses))) + ;; TODO: Combine (regexp) when appropriate (i.e. inside an OR, not an AND). + ((pred stringp) `(,org-ql-default-predicate ,element)) - ,@normalizer-patterns + ,@normalizer-patterns - ;; Any other form: passed through unchanged. - (_ element)))) + ;; Any other form: passed through unchanged. + (_ element)))) ;; Repeat normalization until result doesn't change (limiting to 10 in case of an infinite-loop bug). (cl-loop with limit = 10 and count = 0 for new-query = (rec query) @@ -1109,18 +1108,18 @@ defined in `org-ql-predicates' by calling `org-ql-defpred'." (_ (let ((preamble-case-fold t) org-ql-preamble) (cl-labels ((rec (element) - (or (when org-ql-preamble - ;; Only one preamble is allowed - element) - (pcase element - (`(or _) element) + (or (when org-ql-preamble + ;; Only one preamble is allowed + element) + (pcase element + (`(or _) element) - ,@preamble-patterns + ,@preamble-patterns - (`(and . ,rest) - (let ((clauses (mapcar #'rec rest))) - `(and ,@(-non-nil clauses)))) - (_ element))))) + (`(and . ,rest) + (let ((clauses (mapcar #'rec rest))) + `(and ,@(-non-nil clauses)))) + (_ element))))) (setq query (pcase (mapcar #'rec (list query)) ((or `(nil) `((nil)) @@ -1984,8 +1983,8 @@ language. Matching is done case-insensitively." Tests both inherited and local tags." ;; MAYBE: -all versions for inherited and local. :body (cl-macrolet ((tags-p (tags) - `(and ,tags - (not (eq 'org-ql-nil ,tags))))) + `(and ,tags + (not (eq 'org-ql-nil ,tags))))) (-let* (((inherited local) (org-ql--tags-at (point)))) (cl-typecase tags (null (or (tags-p inherited) @@ -2010,8 +2009,8 @@ If TAGS is nil, return non-nil if heading has any inherited tags." :normalizers ((`(,predicate-names . ,tags) `(tags-inherited ,@tags))) :body (cl-macrolet ((tags-p (tags) - `(and ,tags - (not (eq 'org-ql-nil ,tags))))) + `(and ,tags + (not (eq 'org-ql-nil ,tags))))) (-let* (((inherited _) (org-ql--tags-at (point)))) (cl-typecase tags (null (tags-p inherited)) @@ -2031,8 +2030,8 @@ If TAGS is nil, return non-nil if heading has any local tags." t) :query t))) :body (cl-macrolet ((tags-p (tags) - `(and ,tags - (not (eq 'org-ql-nil ,tags))))) + `(and ,tags + (not (eq 'org-ql-nil ,tags))))) (-let* (((_ local) (org-ql--tags-at (point)))) (cl-typecase tags (null (tags-p local)) @@ -2045,8 +2044,8 @@ Tests both inherited and local tags." :normalizers ((`(,predicate-names . ,regexps) `(tags-regexp ,@regexps))) :body (cl-macrolet ((tags-p (tags) - `(and ,tags - (not (eq 'org-ql-nil ,tags))))) + `(and ,tags + (not (eq 'org-ql-nil ,tags))))) (-let* (((inherited local) (org-ql--tags-at (point)))) (cl-typecase regexps (null (or (tags-p inherited) @@ -2394,12 +2393,12 @@ any planning prefix); it defaults to 0 (i.e. the whole regexp)." :body (cl-macrolet ((next-timestamp () - `(when (re-search-forward regexp limit t) - (ts-parse-org (match-string match-group)))) + `(when (re-search-forward regexp limit t) + (ts-parse-org (match-string match-group)))) (test-timestamps (pred-form) - `(cl-loop for next-ts = (next-timestamp) - while next-ts - thereis ,pred-form))) + `(cl-loop for next-ts = (next-timestamp) + while next-ts + thereis ,pred-form))) (save-excursion (cond ((not (or from to)) (re-search-forward regexp limit t)) ((and from to) (test-timestamps (ts-in from to next-ts))) @@ -2425,27 +2424,27 @@ PREDICATES is a list of one or more sorting methods, including: `deadline', `scheduled', `closed' and `priority'." ;; MAYBE: Use macrolet instead of flet. (cl-flet* ((sorter (symbol) - (pcase symbol - ((or 'deadline 'scheduled 'closed) - (apply-partially #'org-ql--date-type< (intern (concat ":" (symbol-name symbol))))) - ;; TODO: Rename `date' to `planning'. `date' should be something else. - ('date #'org-ql--date<) - ('priority #'org-ql--priority<) - ('random (lambda (&rest _ignore) - (= 0 (random 2)))) - ;; NOTE: reverse and todo are handled below. - ;; TODO: Add more. - (_ (user-error "Invalid sorting predicate: %s" symbol)))) + (pcase symbol + ((or 'deadline 'scheduled 'closed) + (apply-partially #'org-ql--date-type< (intern (concat ":" (symbol-name symbol))))) + ;; TODO: Rename `date' to `planning'. `date' should be something else. + ('date #'org-ql--date<) + ('priority #'org-ql--priority<) + ('random (lambda (&rest _ignore) + (= 0 (random 2)))) + ;; NOTE: reverse and todo are handled below. + ;; TODO: Add more. + (_ (user-error "Invalid sorting predicate: %s" symbol)))) (sort-by-todo-keyword (items) - (let* ((grouped-items (--group-by (when-let (keyword (org-element-property :todo-keyword it)) - (substring-no-properties keyword)) - items)) - (sorted-groups (cl-sort grouped-items #'< - :key (lambda (keyword) - (or (cl-position (car keyword) org-todo-keywords-1 :test #'string=) - ;; Put at end of list if not found - (1+ (length org-todo-keywords-1))))))) - (-flatten-n 1 (-map #'cdr sorted-groups))))) + (let* ((grouped-items (--group-by (when-let (keyword (org-element-property :todo-keyword it)) + (substring-no-properties keyword)) + items)) + (sorted-groups (cl-sort grouped-items #'< + :key (lambda (keyword) + (or (cl-position (car keyword) org-todo-keywords-1 :test #'string=) + ;; Put at end of list if not found + (1+ (length org-todo-keywords-1))))))) + (-flatten-n 1 (-map #'cdr sorted-groups))))) (dolist (pred predicates) (setq items (pcase pred ;; NOTE: Using `reverse' instead of `nreverse' because my gut @@ -2470,16 +2469,16 @@ A and B are Org headline elements. TYPE should be a symbol like "Return non-nil if A's deadline or scheduled property is earlier than B's. Deadline is considered before scheduled." (cl-macrolet ((ts (item) - `(or (org-element-property :deadline ,item) - (org-element-property :scheduled ,item)))) + `(or (org-element-property :deadline ,item) + (org-element-property :scheduled ,item)))) (org-ql--org-timestamp-element< (ts a) (ts b)))) (defun org-ql--org-timestamp-element< (a b) "Return non-nil if A's date element is earlier than B's. A and B are Org timestamp elements." (cl-macrolet ((ts (ts) - `(when ,ts - (org-timestamp-format ,ts "%s")))) + `(when ,ts + (org-timestamp-format ,ts "%s")))) (let* ((a-ts (ts a)) (b-ts (ts b))) (cond ((and a-ts b-ts) @@ -2491,7 +2490,7 @@ A and B are Org timestamp elements." "Return non-nil if A's priority is higher than B's. A and B are Org headline elements." (cl-macrolet ((priority (item) - `(org-element-property :priority ,item))) + `(org-element-property :priority ,item))) ;; NOTE: Priorities are numbers in Org elements. This might differ from the priority selector logic. (let ((a-priority (priority a)) (b-priority (priority b))) @@ -2519,66 +2518,66 @@ element should be a regexp string." If QUERY can't be converted to a string, return nil." ;; This started out pretty simple...but at least it's not just one long function, right? (cl-labels ((complex-p (query) - (or (contains-p 'or query) - (contains-p 'ancestors query) - (contains-p 'children query) - (contains-p 'descendants query) - (contains-p 'parent query))) + (or (contains-p 'or query) + (contains-p 'ancestors query) + (contains-p 'children query) + (contains-p 'descendants query) + (contains-p 'parent query))) (contains-p (symbol list) - (cl-loop for element in list - thereis (or (eq symbol element) - (and (listp element) - (contains-p symbol element))))) - (format-args - (args) (let (non-paired paired next-keyword) - (cl-loop for arg in args - do (cond (next-keyword (push (cons next-keyword arg) paired) - (setf next-keyword nil)) - ((keywordp arg) (setf next-keyword (substring (symbol-name arg) 1))) - (t (push arg non-paired)))) - (string-join (append (mapcar #'format-atom non-paired) - (nreverse (--map (format "%s=%s" (car it) (cdr it)) - paired))) - ","))) - (format-atom - (atom) (cl-typecase atom - (string (if (string-match (rx space) atom) - (format "%S" atom) - (format "%s" atom))) - (t (format "%s" atom)))) - (format-form - (form) (pcase form - (`(not . (,rest)) (concat "!" (format-form rest))) - (`(priority . ,_) (format-priority form)) - ;; FIXME: Convert (src) queries to non-sexp form...someday... - (`(src . ,_) (user-error "Converting (src ...) queries to non-sexp form is not implemented")) - (_ (pcase-let* ((`(,pred . ,args) form) - (args-string (pcase args - ('() "") - ((guard (= 1 (length args))) (format "%s" (car args))) - (_ (format-args args))))) - (format "%s:%s" pred args-string))))) - (format-and - (form) (pcase-let* ((`(and . ,rest) form)) - (string-join (mapcar #'format-form rest) " "))) - (format-priority - (form) (pcase-let* ((`(priority . ,rest) form) - (args (pcase rest - (`(,(and comparator (or '< '<= '> '>= '=)) ,letter) - (priority-letters comparator letter)) - (_ rest)))) - (concat "priority:" (string-join args ",")))) - (priority-letters - (comparator letter) (let* ((char (string-to-char (upcase (symbol-name letter)))) - (numeric-priorities '(?A ?B ?C)) - ;; NOTE: The comparator inversion is intentional. - (others (pcase comparator - ('< (--select (> it char) numeric-priorities)) - ('<= (--select (>= it char) numeric-priorities)) - ('> (--select (< it char) numeric-priorities)) - ('>= (--select (<= it char) numeric-priorities)) - ('= (--select (= it char) numeric-priorities))))) - (mapcar #'char-to-string others)))) + (cl-loop for element in list + thereis (or (eq symbol element) + (and (listp element) + (contains-p symbol element))))) + (format-args (args) + (let (non-paired paired next-keyword) + (cl-loop for arg in args + do (cond (next-keyword (push (cons next-keyword arg) paired) + (setf next-keyword nil)) + ((keywordp arg) (setf next-keyword (substring (symbol-name arg) 1))) + (t (push arg non-paired)))) + (string-join (append (mapcar #'format-atom non-paired) + (nreverse (--map (format "%s=%s" (car it) (cdr it)) + paired))) + ","))) + (format-atom (atom) + (cl-typecase atom + (string (if (string-match (rx space) atom) + (format "%S" atom) + (format "%s" atom))) + (t (format "%s" atom)))) + (format-form (form) + (pcase form + (`(not . (,rest)) (concat "!" (format-form rest))) + (`(priority . ,_) (format-priority form)) + ;; FIXME: Convert (src) queries to non-sexp form...someday... + (`(src . ,_) (user-error "Converting (src ...) queries to non-sexp form is not implemented")) + (_ (pcase-let* ((`(,pred . ,args) form) + (args-string (pcase args + ('() "") + ((guard (= 1 (length args))) (format "%s" (car args))) + (_ (format-args args))))) + (format "%s:%s" pred args-string))))) + (format-and (form) + (pcase-let* ((`(and . ,rest) form)) + (string-join (mapcar #'format-form rest) " "))) + (format-priority (form) + (pcase-let* ((`(priority . ,rest) form) + (args (pcase rest + (`(,(and comparator (or '< '<= '> '>= '=)) ,letter) + (priority-letters comparator letter)) + (_ rest)))) + (concat "priority:" (string-join args ",")))) + (priority-letters (comparator letter) + (let* ((char (string-to-char (upcase (symbol-name letter)))) + (numeric-priorities '(?A ?B ?C)) + ;; NOTE: The comparator inversion is intentional. + (others (pcase comparator + ('< (--select (> it char) numeric-priorities)) + ('<= (--select (>= it char) numeric-priorities)) + ('> (--select (< it char) numeric-priorities)) + ('>= (--select (<= it char) numeric-priorities)) + ('= (--select (= it char) numeric-priorities))))) + (mapcar #'char-to-string others)))) ;; FIXME: Error out for ts structs passed to `ts' predicate (very unlikely to be linked to). (unless (complex-p query) (pcase query diff --git a/tests/test-org-ql.el b/tests/test-org-ql.el index 12e8eb0..7bf6a9b 100644 --- a/tests/test-org-ql.el +++ b/tests/test-org-ql.el @@ -1844,14 +1844,14 @@ with keyword arg NOW in PLIST." ;; have a chance to be gathered. So we make a test buffer and run the test in that, with a test heading. (let ((test-buffer (get-buffer-create "*test-org-ql*"))) - (cl-flet ((open-link - (link) (with-current-buffer test-buffer - (erase-buffer) - (org-mode) - (insert "* TODO Test heading \n\n") - (insert link) - (backward-char 1) - (call-interactively #'org-open-at-point)))) + (cl-flet ((open-link (link) + (with-current-buffer test-buffer + (erase-buffer) + (org-mode) + (insert "* TODO Test heading \n\n") + (insert link) + (backward-char 1) + (call-interactively #'org-open-at-point)))) (describe "buffers-files parameter" :var ((quoted-lambda-link "[[org-ql-search:todo:?buffers-files%3D%28lambda%20nil%20%28error%20%22UNSAFE%22%29%29]]") @@ -2006,16 +2006,15 @@ with keyword arg NOW in PLIST." (when-let ((buffer (find-file-noselect filename 'nowarn))) (kill-buffer buffer)))) - (cl-flet ((var-after-bookmark-set-and-jump - (var buffers-files query &key sort super-groups) - (org-ql-search buffers-files query - :super-groups super-groups - :sort sort :title title :buffer view-buffer) - (set-buffer view-buffer) - (bookmark-set title) - (kill-buffer) - (bookmark-jump title) - (buffer-local-value var (get-buffer (concat "*Org QL View: " title "*"))))) + (cl-flet ((var-after-bookmark-set-and-jump (var buffers-files query &key sort super-groups) + (org-ql-search buffers-files query + :super-groups super-groups + :sort sort :title title :buffer view-buffer) + (set-buffer view-buffer) + (bookmark-set title) + (kill-buffer) + (bookmark-jump title) + (buffer-local-value var (get-buffer (concat "*Org QL View: " title "*"))))) (describe "Grouping" :var ((query '(and (todo "TODO") (regexp "heading"))) @@ -2069,18 +2068,18 @@ with keyword arg NOW in PLIST." (describe "Dynamic blocks" (describe "warn about sexp queries" - (cl-flet ((test-dblock - (&optional input) (with-current-buffer (get-buffer-create "*TEST DBLOCK*") - (erase-buffer) - (org-mode) - (insert "* TODO Heading 1\n\n" - "#+BEGIN: org-ql :query (or (todo) (regexp \"Heading\")) :columns (todo)\n" - "#+END:") - (goto-char (point-min)) - (forward-line 2) - (with-simulated-input input - (org-dblock-update)) - (kill-buffer)))) + (cl-flet ((test-dblock (&optional input) + (with-current-buffer (get-buffer-create "*TEST DBLOCK*") + (erase-buffer) + (org-mode) + (insert "* TODO Heading 1\n\n" + "#+BEGIN: org-ql :query (or (todo) (regexp \"Heading\")) :columns (todo)\n" + "#+END:") + (goto-char (point-min)) + (forward-line 2) + (with-simulated-input input + (org-dblock-update)) + (kill-buffer)))) (it "when org-ql-ask-unsafe-queries is non-nil" ;; TODO: Should the query be converted to string form if possible and only warn if not? @@ -2109,39 +2108,37 @@ with keyword arg NOW in PLIST." (insert "* TODO Test heading\n\n") (org-mode))) - (cl-flet* ((open-link-in - (link buffer input) - ;; Org REDUCED THE NUMBER OF ARGUMENTS TO `org-open-link-from-string'! That BREAKS BACKWARD - ;; COMPATIBILITY! So I have to make my own function so these tests can work across Org versions! - (with-current-buffer buffer - (erase-buffer) - (org-mode) - (insert "* TODO Test heading\n\n") - (insert link) - (backward-char 1) - (with-simulated-input input - (org-open-at-point)))) + (cl-flet* ((open-link-in (link buffer input) + ;; Org REDUCED THE NUMBER OF ARGUMENTS TO `org-open-link-from-string'! That BREAKS BACKWARD + ;; COMPATIBILITY! So I have to make my own function so these tests can work across Org versions! + (with-current-buffer buffer + (erase-buffer) + (org-mode) + (insert "* TODO Test heading\n\n") + (insert link) + (backward-char 1) + (with-simulated-input input + (org-open-at-point)))) - (var-after-link-save-open - (var buffers-files query &key sort super-groups - (buffer link-buffer) (store-input "RET") open-input) - (org-ql-search buffers-files query - :super-groups super-groups - :sort sort :title title :buffer view-buffer) - (with-current-buffer view-buffer - (cl-assert (member '("org-ql-search" :follow org-ql-view--link-follow :store org-ql-view--link-store) - org-link-parameters) - t) - (with-simulated-input store-input - ;; Avoid writing "Stored: ..." to test output. - (let ((inhibit-message t)) - (call-interactively #'org-store-link nil))) - (kill-buffer)) - (cl-assert (and org-stored-links (caar org-stored-links)) t) - (open-link-in (caar org-stored-links) buffer open-input) - (with-current-buffer (get-buffer (concat "*Org QL View: " title "*")) - (prog1 (buffer-local-value var (current-buffer)) - (kill-buffer))))) + (var-after-link-save-open (var buffers-files query &key sort super-groups + (buffer link-buffer) (store-input "RET") open-input) + (org-ql-search buffers-files query + :super-groups super-groups + :sort sort :title title :buffer view-buffer) + (with-current-buffer view-buffer + (cl-assert (member '("org-ql-search" :follow org-ql-view--link-follow :store org-ql-view--link-store) + org-link-parameters) + t) + (with-simulated-input store-input + ;; Avoid writing "Stored: ..." to test output. + (let ((inhibit-message t)) + (call-interactively #'org-store-link nil))) + (kill-buffer)) + (cl-assert (and org-stored-links (caar org-stored-links)) t) + (open-link-in (caar org-stored-links) buffer open-input) + (with-current-buffer (get-buffer (concat "*Org QL View: " title "*")) + (prog1 (buffer-local-value var (current-buffer)) + (kill-buffer))))) (describe "Queries" :var ((string-query "todo:TODO regexp:heading") From 1496185141d78e21748c894748378a44ba52a50c Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sat, 16 Dec 2023 04:59:12 -0600 Subject: [PATCH 054/145] Fix: (property) Handle org-use-property-inheritance when unspecified Fixes #356. Reported-by: beast-pro Reported-by: pcompassion --- README.org | 6 ++- org-ql.el | 12 ++++-- org-ql.info | 113 +++++++++++++++++++++++++++------------------------- 3 files changed, 72 insertions(+), 59 deletions(-) diff --git a/README.org b/README.org index 2a97f10..4b6248d 100644 --- a/README.org +++ b/README.org @@ -248,7 +248,7 @@ Arguments are listed next to predicate names, where applicable. - Aliases: ~olps~. + =path (&rest regexps)= :: Return non-nil if current heading's buffer's filename path matches any of ~REGEXPS~ (regexp strings). Without arguments, return non-nil if buffer is file-backed. + =priority (&rest args)= :: Return non-nil if current heading has a certain priority. ~ARGS~ may be either a list of one or more priority letters as strings, or a comparator function symbol followed by a priority letter string. For example: ~(priority "A") (priority "A" "B") (priority '>= "B")~ Note that items without a priority cookie never match this predicate (while Org itself considers items without a cookie to have the default priority, which, by default, is equal to priority ~B~). -+ =property (property &optional value &key inherit)= :: Return non-nil if current entry has ~PROPERTY~ (a string), and optionally ~VALUE~ (a string). If ~INHERIT~ is nil, only match entries with ~PROPERTY~ set on the entry; if t, also match entries with inheritance. If ~INHERIT~ is not specified, use the Boolean value of ~org-use-property-inheritance~, which see (i.e. it is only interpreted as nil or non-nil). ++ =property (property &optional value &key inherit)= :: Return non-nil if current entry has ~PROPERTY~ (a string), and optionally ~VALUE~ (a string). If ~INHERIT~ is nil, only match entries with ~PROPERTY~ set on the entry; if t, also match entries with inheritance. If ~INHERIT~ is not specified, use the value of ~org-use-property-inheritance~, which see. + =regexp (&rest regexps)= :: Return non-nil if current entry matches all of ~REGEXPS~ (regexp strings). Matches against entire entry, from beginning of its heading to the next heading. - Aliases: =r=. + =rifle (&rest strings)= :: Return non-nil if each string is found in either the entry or its outline path. Works like =org-rifle=. This is probably the most useful, intuitive, general-purpose predicate. @@ -563,6 +563,10 @@ Simple links may also be written manually in either sexp or non-sexp form, like: + Command ~org-ql-open-link~, which finds links in entries matching the given query, and opens the selected one with ~org-open-at-point~. (This is helpful when a collection of links are kept in Org files: rather than having to first visit the entry containing the desired link, then locate it within the entry, and then open it, the user can simply select the link and open it directly.) + Items in ~org-ql-view~ buffers now include the ~org-category~ text property, like Org Agenda buffers, which allows grouping with ~org-super-agenda~'s category-related selectors. ([[https://github.com/alphapapa/org-ql/issues/363][#363]]. Thanks to [[https://github.com/kofm][Gabriele Mongiano]] for reporting.) +*Fixes* + ++ Predicate ~property~ correctly uses the value of ~org-use-property-inheritance~ when not specified ([[https://github.com/alphapapa/org-ql/issues/356][#356]]). + *Compatibility* + Org v9.7's ~org-element~ API changes required some adjustments. ([[https://github.com/alphapapa/org-ql/issues/364][#364]]. Thanks to several users for reporting, and to [[https://github.com/yantar92][Ihor Radchenko]] for his feedback.) diff --git a/org-ql.el b/org-ql.el index cc899f2..e0fea0c 100644 --- a/org-ql.el +++ b/org-ql.el @@ -1823,10 +1823,14 @@ interpreted as nil or non-nil)." ;; otherwise would require ugly special-casing in the parsing). (when (keywordp property) (setf property (substring (symbol-name property) 1))) - (list 'property property value - :inherit (if (plist-member plist :inherit) - (plist-get plist :inherit) - org-use-property-inheritance)))) + `(property ,property ,value + :inherit ,(if (plist-member plist :inherit) + (plist-get plist :inherit) + ;; TODO: Add tests for these cases. + (pcase org-use-property-inheritance + (`nil nil) (`t t) + ((pred stringp) org-use-property-inheritance) + ((pred listp) `(quote ,org-use-property-inheritance))))))) ;; MAYBE: Should case folding be disabled for properties? What about values? ;; MAYBE: Support (property) without args. diff --git a/org-ql.info b/org-ql.info index 1adeaa1..b766614 100644 --- a/org-ql.info +++ b/org-ql.info @@ -521,9 +521,8 @@ Arguments are listed next to predicate names, where applicable. Return non-nil if current entry has ‘PROPERTY’ (a string), and optionally ‘VALUE’ (a string). If ‘INHERIT’ is nil, only match entries with ‘PROPERTY’ set on the entry; if t, also match entries - with inheritance. If ‘INHERIT’ is not specified, use the Boolean - value of ‘org-use-property-inheritance’, which see (i.e. it is - only interpreted as nil or non-nil). + with inheritance. If ‘INHERIT’ is not specified, use the value of + ‘org-use-property-inheritance’, which see. ‘regexp (&rest regexps)’ Return non-nil if current entry matches all of ‘REGEXPS’ (regexp strings). Matches against entire entry, from beginning of its @@ -1095,6 +1094,12 @@ File: README.info, Node: 08-pre, Next: 074, Up: Changelog (https://github.com/alphapapa/org-ql/issues/363). Thanks to Gabriele Mongiano (https://github.com/kofm) for reporting.) + *Fixes* + + • Predicate ‘property’ correctly uses the value of + ‘org-use-property-inheritance’ when not specified (#356 + (https://github.com/alphapapa/org-ql/issues/356)). + *Compatibility* • Org v9.7’s ‘org-element’ API changes required some adjustments. @@ -1875,57 +1880,57 @@ Node: org-ql-sparse-tree10124 Node: Queries10924 Node: Non-sexp query syntax12041 Node: General predicates13800 -Node: Ancestor/descendant predicates20787 -Node: Date/time predicates21915 -Node: Functions / Macros25039 -Node: Agenda-like views25337 -Ref: Function org-ql-block25499 -Node: Listing / acting-on results26760 -Ref: Caching26968 -Ref: Function org-ql-select27881 -Ref: Function org-ql-query30307 -Ref: Macro org-ql (deprecated)32081 -Node: Custom predicates32396 -Ref: Macro org-ql-defpred32620 -Node: Dynamic block36061 -Node: Links38785 -Node: Tips39472 -Node: Changelog39796 -Node: 08-pre40620 -Node: 07442732 -Node: 07342959 -Node: 07243691 -Node: 07144610 -Node: 0745419 -Node: 06348343 -Node: 06248874 -Node: 06149179 -Node: 0649747 -Node: 05252803 -Node: 05153105 -Node: 0553530 -Node: 04955061 -Node: 04855343 -Node: 04755692 -Node: 04656101 -Node: 04556509 -Node: 04456870 -Node: 04357229 -Node: 04257432 -Node: 04157593 -Node: 0457840 -Node: 03261941 -Node: 03162344 -Node: 0362541 -Node: 02365841 -Node: 02266075 -Node: 02166355 -Node: 0266560 -Node: 0170638 -Node: Notes70739 -Node: Comparison with Org Agenda searches70901 -Node: org-sidebar71790 -Node: License72069 +Node: Ancestor/descendant predicates20725 +Node: Date/time predicates21853 +Node: Functions / Macros24977 +Node: Agenda-like views25275 +Ref: Function org-ql-block25437 +Node: Listing / acting-on results26698 +Ref: Caching26906 +Ref: Function org-ql-select27819 +Ref: Function org-ql-query30245 +Ref: Macro org-ql (deprecated)32019 +Node: Custom predicates32334 +Ref: Macro org-ql-defpred32558 +Node: Dynamic block35999 +Node: Links38723 +Node: Tips39410 +Node: Changelog39734 +Node: 08-pre40558 +Node: 07442864 +Node: 07343091 +Node: 07243823 +Node: 07144742 +Node: 0745551 +Node: 06348475 +Node: 06249006 +Node: 06149311 +Node: 0649879 +Node: 05252935 +Node: 05153237 +Node: 0553662 +Node: 04955193 +Node: 04855475 +Node: 04755824 +Node: 04656233 +Node: 04556641 +Node: 04457002 +Node: 04357361 +Node: 04257564 +Node: 04157725 +Node: 0457972 +Node: 03262073 +Node: 03162476 +Node: 0362673 +Node: 02365973 +Node: 02266207 +Node: 02166487 +Node: 0266692 +Node: 0170770 +Node: Notes70871 +Node: Comparison with Org Agenda searches71033 +Node: org-sidebar71922 +Node: License72201  End Tag Table From f6d7514159008ae65a224071cb16d6fa2ac36e8c Mon Sep 17 00:00:00 2001 From: Bram Schoenmakers Date: Wed, 12 Apr 2023 12:51:05 +0200 Subject: [PATCH 055/145] Handle the case when org-use-property-inheritance is a list of strings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When org-use-property-inheritance is a list, then the query (property "FOO" "BAR") would bail out with: org-ql--byte-compile-warning: Invalid Org QL query: "Invalid Org QL query: \"‘\\\"BLAH\\\"’ is a malformed function\", :warning", :error (property "FOO") would still work though. So, if org-use-property-inheritance is a list, cast it to the (default) boolean value for this variable: nil. Use 'selective' inheritance when org-use-property-inheritance is a list This symbol is mentioned in the org-entry-get documentation. --- org-ql.el | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/org-ql.el b/org-ql.el index e0fea0c..8a00485 100644 --- a/org-ql.el +++ b/org-ql.el @@ -1823,14 +1823,10 @@ interpreted as nil or non-nil)." ;; otherwise would require ugly special-casing in the parsing). (when (keywordp property) (setf property (substring (symbol-name property) 1))) - `(property ,property ,value - :inherit ,(if (plist-member plist :inherit) - (plist-get plist :inherit) - ;; TODO: Add tests for these cases. - (pcase org-use-property-inheritance - (`nil nil) (`t t) - ((pred stringp) org-use-property-inheritance) - ((pred listp) `(quote ,org-use-property-inheritance))))))) + (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))))) ;; MAYBE: Should case folding be disabled for properties? What about values? ;; MAYBE: Support (property) without args. From c78f785378e2f56e035481b8f7b58d161c038678 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sat, 16 Dec 2023 05:34:09 -0600 Subject: [PATCH 056/145] Docs: Update changelog --- README.org | 2 +- org-ql.info | 74 +++++++++++++++++++++++++++-------------------------- 2 files changed, 39 insertions(+), 37 deletions(-) diff --git a/README.org b/README.org index 4b6248d..3b452d0 100644 --- a/README.org +++ b/README.org @@ -565,7 +565,7 @@ Simple links may also be written manually in either sexp or non-sexp form, like: *Fixes* -+ Predicate ~property~ correctly uses the value of ~org-use-property-inheritance~ when not specified ([[https://github.com/alphapapa/org-ql/issues/356][#356]]). ++ Predicate ~property~ correctly uses the value of ~org-use-property-inheritance~ when not specified. ([[https://github.com/alphapapa/org-ql/pull/346][#346]], [[https://github.com/alphapapa/org-ql/issues/356][#356]]. Thanks to [[https://github.com/bram85][Bram Schoenmakers]].) *Compatibility* diff --git a/org-ql.info b/org-ql.info index b766614..c53b4b5 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1097,8 +1097,10 @@ File: README.info, Node: 08-pre, Next: 074, Up: Changelog *Fixes* • Predicate ‘property’ correctly uses the value of - ‘org-use-property-inheritance’ when not specified (#356 - (https://github.com/alphapapa/org-ql/issues/356)). + ‘org-use-property-inheritance’ when not specified. (#346 + (https://github.com/alphapapa/org-ql/pull/346), #356 + (https://github.com/alphapapa/org-ql/issues/356). Thanks to Bram + Schoenmakers (https://github.com/bram85).) *Compatibility* @@ -1897,40 +1899,40 @@ Node: Links38723 Node: Tips39410 Node: Changelog39734 Node: 08-pre40558 -Node: 07442864 -Node: 07343091 -Node: 07243823 -Node: 07144742 -Node: 0745551 -Node: 06348475 -Node: 06249006 -Node: 06149311 -Node: 0649879 -Node: 05252935 -Node: 05153237 -Node: 0553662 -Node: 04955193 -Node: 04855475 -Node: 04755824 -Node: 04656233 -Node: 04556641 -Node: 04457002 -Node: 04357361 -Node: 04257564 -Node: 04157725 -Node: 0457972 -Node: 03262073 -Node: 03162476 -Node: 0362673 -Node: 02365973 -Node: 02266207 -Node: 02166487 -Node: 0266692 -Node: 0170770 -Node: Notes70871 -Node: Comparison with Org Agenda searches71033 -Node: org-sidebar71922 -Node: License72201 +Node: 07442987 +Node: 07343214 +Node: 07243946 +Node: 07144865 +Node: 0745674 +Node: 06348598 +Node: 06249129 +Node: 06149434 +Node: 0650002 +Node: 05253058 +Node: 05153360 +Node: 0553785 +Node: 04955316 +Node: 04855598 +Node: 04755947 +Node: 04656356 +Node: 04556764 +Node: 04457125 +Node: 04357484 +Node: 04257687 +Node: 04157848 +Node: 0458095 +Node: 03262196 +Node: 03162599 +Node: 0362796 +Node: 02366096 +Node: 02266330 +Node: 02166610 +Node: 0266815 +Node: 0170893 +Node: Notes70994 +Node: Comparison with Org Agenda searches71156 +Node: org-sidebar72045 +Node: License72324  End Tag Table From 3dc2409539eb67206954effdcb22f1a78f52ab56 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sat, 16 Dec 2023 07:10:52 -0600 Subject: [PATCH 057/145] Meta: Require Emacs 27.1 or later Emacs 26.3 is quite old now, and I can't practically run tests for it anymore because some other dependencies have dropped support for it. --- .github/workflows/test.yml | 1 - README.org | 1 + org-ql.el | 2 +- org-ql.info | 69 +++++++++++++++++++------------------- 4 files changed, 37 insertions(+), 36 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 87bc281..4f11ce7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -41,7 +41,6 @@ jobs: fail-fast: false matrix: emacs_version: - - 26.3 - 27.1 - 27.2 - 28.1 diff --git a/README.org b/README.org index 3b452d0..3d2f75e 100644 --- a/README.org +++ b/README.org @@ -569,6 +569,7 @@ Simple links may also be written manually in either sexp or non-sexp form, like: *Compatibility* ++ Emacs 27.1 or later is now required. + Org v9.7's ~org-element~ API changes required some adjustments. ([[https://github.com/alphapapa/org-ql/issues/364][#364]]. Thanks to several users for reporting, and to [[https://github.com/yantar92][Ihor Radchenko]] for his feedback.) ** 0.7.4 diff --git a/org-ql.el b/org-ql.el index 8a00485..2ba9a31 100644 --- a/org-ql.el +++ b/org-ql.el @@ -5,7 +5,7 @@ ;; Author: Adam Porter ;; Url: https://github.com/alphapapa/org-ql ;; Version: 0.8-pre -;; Package-Requires: ((emacs "26.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")) +;; 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 ;;; License: diff --git a/org-ql.info b/org-ql.info index c53b4b5..ecc4d75 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1104,6 +1104,7 @@ File: README.info, Node: 08-pre, Next: 074, Up: Changelog *Compatibility* + • Emacs 27.1 or later is now required. • Org v9.7’s ‘org-element’ API changes required some adjustments. (#364 (https://github.com/alphapapa/org-ql/issues/364). Thanks to several users for reporting, and to Ihor Radchenko @@ -1899,40 +1900,40 @@ Node: Links38723 Node: Tips39410 Node: Changelog39734 Node: 08-pre40558 -Node: 07442987 -Node: 07343214 -Node: 07243946 -Node: 07144865 -Node: 0745674 -Node: 06348598 -Node: 06249129 -Node: 06149434 -Node: 0650002 -Node: 05253058 -Node: 05153360 -Node: 0553785 -Node: 04955316 -Node: 04855598 -Node: 04755947 -Node: 04656356 -Node: 04556764 -Node: 04457125 -Node: 04357484 -Node: 04257687 -Node: 04157848 -Node: 0458095 -Node: 03262196 -Node: 03162599 -Node: 0362796 -Node: 02366096 -Node: 02266330 -Node: 02166610 -Node: 0266815 -Node: 0170893 -Node: Notes70994 -Node: Comparison with Org Agenda searches71156 -Node: org-sidebar72045 -Node: License72324 +Node: 07443031 +Node: 07343258 +Node: 07243990 +Node: 07144909 +Node: 0745718 +Node: 06348642 +Node: 06249173 +Node: 06149478 +Node: 0650046 +Node: 05253102 +Node: 05153404 +Node: 0553829 +Node: 04955360 +Node: 04855642 +Node: 04755991 +Node: 04656400 +Node: 04556808 +Node: 04457169 +Node: 04357528 +Node: 04257731 +Node: 04157892 +Node: 0458139 +Node: 03262240 +Node: 03162643 +Node: 0362840 +Node: 02366140 +Node: 02266374 +Node: 02166654 +Node: 0266859 +Node: 0170937 +Node: Notes71038 +Node: Comparison with Org Agenda searches71200 +Node: org-sidebar72089 +Node: License72368  End Tag Table From 77b4c2bce214905901ce47ffbf0fa1a930bb657e Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sat, 16 Dec 2023 07:49:00 -0600 Subject: [PATCH 058/145] Meta: Add bug report template --- .github/ISSUE_TEMPLATE/bug_report.yml | 78 ++++++++++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 5 ++ .github/ISSUE_TEMPLATE/feature_request.yml | 45 +++++++++++++ 3 files changed, 128 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..87794a3 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,78 @@ +name: Bug Report +description: File a bug report +labels: ["bug"] +assignees: + - alphapapa +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report! + - type: input + id: os-platform + attributes: + label: OS/platform + description: What operating system or platform are you running Emacs on? + validations: + required: true + - type: textarea + id: emacs-provenance + attributes: + label: Emacs version and provenance + description: What version of Emacs are you using, where did you acquire it, and how did you install it? + validations: + required: true + - type: input + id: emacs-command + attributes: + label: Emacs command + description: By what method did you run Emacs? (i.e. what command did you run?) + validations: + required: true + # - type: input + # id: emacs-frame + # attributes: + # label: Emacs frame type + # description: Did the problem happen on a GUI or tty Emacs frame? + # validations: + # required: true + - type: input + id: package-provenance + attributes: + label: org-ql package version and provenance + description: What version of org-ql are you using, where did you acquire it, and how did you install it? + validations: + required: true + - type: textarea + id: actions + attributes: + label: Actions taken + description: What actions did you take, step-by-step, in order, before the problem was noticed? + validations: + required: true + - type: textarea + id: results + attributes: + label: Observed results + description: What behavior did you observe that seemed wrong? + validations: + required: true + - type: textarea + id: expected + attributes: + label: Expected results + description: What behavior did you expect to observe? + validations: + required: true + - type: textarea + id: backtrace + attributes: + label: Backtrace + description: If an error was signaled, please use `M-x toggle-debug-on-error RET` and cause the error to happen again, then paste the contents of the `*Backtrace*` buffer here. + render: elisp + - type: textarea + id: etc + attributes: + label: Etc. + description: Any other information that seems relevant + diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..7e36d80 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: true +contact_links: + - name: Support questions + url: https://github.com/alphapapa/org-ql/discussions + about: Please ask and answer support questions here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..7b14c94 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,45 @@ +name: Feature Request +description: File a feature request +labels: ["enhancement"] +body: + - type: input + id: os-platform + attributes: + label: OS/platform + description: What operating system or platform are you running Emacs on? + validations: + required: true + - type: textarea + id: emacs-provenance + attributes: + label: Emacs version and provenance + description: What version of Emacs are you using, where did you acquire it, and how did you install it? + validations: + required: true + - type: textarea + id: org-provenance + attributes: + label: Org version and provenance + description: What version of Org are you using, where did you acquire it, and how did you install it? + validations: + required: true + - type: input + id: package-provenance + attributes: + label: org-ql package version and provenance + description: What version of org-ql are you using, where did you acquire it, and how did you install it? + validations: + required: true + - type: textarea + id: description + attributes: + label: Description + description: Describe your request. + validations: + required: true + - type: textarea + id: etc + attributes: + label: Etc. + description: Any other information that seems relevant + From 4ef9d9efed61e928850250d0365a9f840a41d1b8 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Tue, 19 Dec 2023 03:25:37 -0600 Subject: [PATCH 059/145] Meta: (bug_report.yml) Add Org version, remove labels and assignee --- .github/ISSUE_TEMPLATE/bug_report.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 87794a3..7e1b0c9 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,8 +1,8 @@ name: Bug Report description: File a bug report -labels: ["bug"] -assignees: - - alphapapa +# labels: ["bug"] +# assignees: +# - alphapapa body: - type: markdown attributes: @@ -29,13 +29,13 @@ body: description: By what method did you run Emacs? (i.e. what command did you run?) validations: required: true - # - type: input - # id: emacs-frame - # attributes: - # label: Emacs frame type - # description: Did the problem happen on a GUI or tty Emacs frame? - # validations: - # required: true + - type: textarea + id: org-provenance + attributes: + label: Org version and provenance + description: What version of Org are you using, where did you acquire it, and how did you install it? + validations: + required: true - type: input id: package-provenance attributes: From 121af5c5d5d2ba10f1a4494dfb6538ae7d93c3d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Antol=C3=ADn=20Camarena?= Date: Fri, 8 Sep 2023 14:42:30 -0600 Subject: [PATCH 060/145] Add C-c C-e key binding to save an org-ql-find session --- org-ql-completing-read.el | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/org-ql-completing-read.el b/org-ql-completing-read.el index 9c4c044..4109557 100644 --- a/org-ql-completing-read.el +++ b/org-ql-completing-read.el @@ -322,7 +322,23 @@ single predicate)." (mapc #'org-ql--ensure-buffer buffers-files) (let* ((completion-styles '(org-ql-completing-read)) (completion-styles-alist (list (list 'org-ql-completing-read #'try #'all "Org QL Find"))) - (selected (completing-read prompt #'collection nil t))) + (selected + (minibuffer-with-setup-hook + (lambda () + (let ((map (make-sparse-keymap))) + (define-key + map (kbd "C-c C-e") + (lambda () + (interactive) + (run-at-time 0 nil + #'org-ql-search + buffers-files + (minibuffer-contents-no-properties)) + (if (fboundp 'minibuffer-quit-recursive-edit) + (minibuffer-quit-recursive-edit) + (abort-recursive-edit)))) + (use-local-map (make-composed-keymap map (current-local-map))))) + (completing-read prompt #'collection nil t)))) ;; (debug-message "SELECTED:%S KEYS:%S" selected (hash-table-keys table)) (or (gethash selected table) ;; If there are completions in the table, but none of them exactly match the user input From 0552aa8b93c3b8278742d0cf63c7d49878e0172d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Antol=C3=ADn?= Date: Mon, 18 Dec 2023 13:35:04 -0600 Subject: [PATCH 061/145] Use a keymap for the org-ql-view export functionality --- org-ql-completing-read.el | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/org-ql-completing-read.el b/org-ql-completing-read.el index 4109557..b290ed9 100644 --- a/org-ql-completing-read.el +++ b/org-ql-completing-read.el @@ -114,6 +114,17 @@ value, or nil." ;;;;; Completing read +(defun org-ql-export-view () + "Create `org-ql-view' buffer from current minibuffer org-ql search." + (interactive) + (user-error "Must be run from within an `org-ql-completing-read' session")) + +(defvar org-ql-completing-read-map + (let ((map (make-sparse-keymap))) + (define-key map (kbd "C-c C-e") #'org-ql-export-view) + map) + "Keymap active during `org-ql-completing-read' minibuffer sessions.") + ;;;###autoload (cl-defun org-ql-completing-read (buffers-files &key query-prefix query-filter @@ -325,20 +336,20 @@ single predicate)." (selected (minibuffer-with-setup-hook (lambda () - (let ((map (make-sparse-keymap))) - (define-key - map (kbd "C-c C-e") - (lambda () - (interactive) - (run-at-time 0 nil - #'org-ql-search - buffers-files - (minibuffer-contents-no-properties)) - (if (fboundp 'minibuffer-quit-recursive-edit) - (minibuffer-quit-recursive-edit) - (abort-recursive-edit)))) - (use-local-map (make-composed-keymap map (current-local-map))))) - (completing-read prompt #'collection nil t)))) + (use-local-map (make-composed-keymap org-ql-completing-read-map (current-local-map)))) + (cl-letf* (((symbol-function 'org-ql-export-view) + (lambda () + (interactive) + (run-at-time 0 nil + #'org-ql-search + buffers-files + (minibuffer-contents-no-properties)) + (if (fboundp 'minibuffer-quit-recursive-edit) + (minibuffer-quit-recursive-edit) + (abort-recursive-edit)))) + ((symbol-function 'embark-export) + (symbol-function 'org-ql-export-view))) + (completing-read prompt #'collection nil t))))) ;; (debug-message "SELECTED:%S KEYS:%S" selected (hash-table-keys table)) (or (gethash selected table) ;; If there are completions in the table, but none of them exactly match the user input From 2644f53fe2a69006a442a60e0e156fed061bb7e2 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 21 Dec 2023 16:35:25 -0600 Subject: [PATCH 062/145] Tidy, rename --- org-ql-completing-read.el | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/org-ql-completing-read.el b/org-ql-completing-read.el index b290ed9..4c3e0f3 100644 --- a/org-ql-completing-read.el +++ b/org-ql-completing-read.el @@ -26,6 +26,12 @@ (require 'org-ql) +;;;; Variables + +(defvar-keymap org-ql-completing-read-map + :doc "Active during `org-ql-completing-read' sessions." + (kbd "C-c C-e") #'org-ql-completing-read-export) + ;;;; Customization (defgroup org-ql-completing-read nil @@ -114,16 +120,10 @@ value, or nil." ;;;;; Completing read -(defun org-ql-export-view () - "Create `org-ql-view' buffer from current minibuffer org-ql search." +(defun org-ql-completing-read-export () + "Show `org-ql-view' buffer for current `org-ql-completing-read'-based search." (interactive) - (user-error "Must be run from within an `org-ql-completing-read' session")) - -(defvar org-ql-completing-read-map - (let ((map (make-sparse-keymap))) - (define-key map (kbd "C-c C-e") #'org-ql-export-view) - map) - "Keymap active during `org-ql-completing-read' minibuffer sessions.") + (user-error "Not in an `org-ql-completing-read' session")) ;;;###autoload (cl-defun org-ql-completing-read @@ -337,7 +337,7 @@ single predicate)." (minibuffer-with-setup-hook (lambda () (use-local-map (make-composed-keymap org-ql-completing-read-map (current-local-map)))) - (cl-letf* (((symbol-function 'org-ql-export-view) + (cl-letf* (((symbol-function 'org-ql-completing-read-export) (lambda () (interactive) (run-at-time 0 nil @@ -348,7 +348,7 @@ single predicate)." (minibuffer-quit-recursive-edit) (abort-recursive-edit)))) ((symbol-function 'embark-export) - (symbol-function 'org-ql-export-view))) + (symbol-function 'org-ql-completing-read-export))) (completing-read prompt #'collection nil t))))) ;; (debug-message "SELECTED:%S KEYS:%S" selected (hash-table-keys table)) (or (gethash selected table) From f4b006ffb956d7503d8072d9c3b76c9f77485113 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 21 Dec 2023 16:38:11 -0600 Subject: [PATCH 063/145] Remap embark-collect to embark-export --- org-ql-completing-read.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/org-ql-completing-read.el b/org-ql-completing-read.el index 4c3e0f3..a8053af 100644 --- a/org-ql-completing-read.el +++ b/org-ql-completing-read.el @@ -30,7 +30,11 @@ (defvar-keymap org-ql-completing-read-map :doc "Active during `org-ql-completing-read' sessions." - (kbd "C-c C-e") #'org-ql-completing-read-export) + "C-c C-e" #'org-ql-completing-read-export) + +;; `embark-collect' doesn't work for `org-ql-completing-read', so remap +;; it to `embark-export' (which `keymap-set', et al doesn't allow). +(define-key org-ql-completing-read-map [remap embark-collect] 'embark-export) ;;;; Customization From f98dee54c8d73a6951a051a4e43afaf0048cbf0d Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 21 Dec 2023 16:48:52 -0600 Subject: [PATCH 064/145] Docs: Update changelog and usage --- README.org | 3 +- org-ql.info | 132 +++++++++++++++++++++++++++------------------------- 2 files changed, 71 insertions(+), 64 deletions(-) diff --git a/README.org b/README.org index 3d2f75e..bd34ecf 100644 --- a/README.org +++ b/README.org @@ -115,7 +115,7 @@ These commands jump to a heading selected using Emacs's built-in completion faci - ~org-ql-find-in-agenda~ searches in ~(org-agenda-files)~. - ~org-ql-find-in-org-directory~ searches in ~org-directory~. -Note that these commands are compatible with [[https://github.com/oantolin/embark][Embark]]: the ~embark-act~ command can be called on a completion candidate (i.e. a search result) to act on it immediately, without having to visit the entry in its source Org buffer. +Note that these commands are compatible with [[https://github.com/oantolin/embark][Embark]]: the ~embark-act~ command can be called on a completion candidate (i.e. a search result) to act on it immediately, without having to visit the entry in its source Org buffer, and ~embark-export~ may be called to show the results in an ~org-ql-view~ buffer. [[images/org-ql-find.png]] @@ -558,6 +558,7 @@ Simple links may also be written manually in either sexp or non-sexp form, like: *Additions* + Function ~org-ql-completing-read~, used by command ~org-ql-find~, now specifies the completion category as ~org-heading~, providing compatibility with [[https://github.com/oantolin/embark][Embark]]. (This is a powerful feature, as it means any ~org-ql-find~ result can be acted on from inside the search results with Embark, which provides common actions from Org Agenda and Org speed keys bindings.) ([[https://github.com/alphapapa/org-ql/issues/299][#299]]. Thanks to [[https://github.com/oantolin][Omar Antolín Camarena]], [[https://github.com/minad][Daniel Mendler]], and [[https://github.com/akirak][Akira Komamura]].) + - Command ~org-ql-completing-read-export~, bound to ~C-c C-e~ or ~embark-export~ while in an ~org-ql-completing-read~ session, exits and shows an ~org-ql-view~ buffer for the current search. + Command ~org-ql-find~ may be called in an ~org-agenda~ or ~org-ql-view~ buffer to search the buffers which contributed to the agenda/view buffer. + Command ~org-ql-find-path~, which searches outline paths in the current buffer. + Command ~org-ql-open-link~, which finds links in entries matching the given query, and opens the selected one with ~org-open-at-point~. (This is helpful when a collection of links are kept in Org files: rather than having to first visit the entry containing the desired link, then locate it within the entry, and then open it, the user can simply select the link and open it directly.) diff --git a/org-ql.info b/org-ql.info index ecc4d75..430d5a9 100644 --- a/org-ql.info +++ b/org-ql.info @@ -237,7 +237,9 @@ completion facilities with an Org QL query: Note that these commands are compatible with Embark (https://github.com/oantolin/embark): the ‘embark-act’ command can be called on a completion candidate (i.e. a search result) to act on it -immediately, without having to visit the entry in its source Org buffer. +immediately, without having to visit the entry in its source Org buffer, +and ‘embark-export’ may be called to show the results in an +‘org-ql-view’ buffer.  File: README.info, Node: org-ql-open-link, Next: org-ql-refile, Prev: org-ql-find, Up: Commands @@ -1076,6 +1078,10 @@ File: README.info, Node: 08-pre, Next: 074, Up: Changelog Thanks to Omar Antolín Camarena (https://github.com/oantolin), Daniel Mendler (https://github.com/minad), and Akira Komamura (https://github.com/akirak).) + • Command ‘org-ql-completing-read-export’, bound to ‘C-c C-e’ or + ‘embark-export’ while in an ‘org-ql-completing-read’ session, + exits and shows an ‘org-ql-view’ buffer for the current + search. • Command ‘org-ql-find’ may be called in an ‘org-agenda’ or ‘org-ql-view’ buffer to search the buffers which contributed to the agenda/view buffer. @@ -1872,68 +1878,68 @@ Node: Helm support3142 Node: Usage3545 Node: Commands3943 Node: org-ql-find4408 -Node: org-ql-open-link5226 -Node: org-ql-refile6081 -Node: org-ql-search6409 -Node: helm-org-ql8340 -Node: org-ql-view8718 -Node: org-ql-view-sidebar9248 -Node: org-ql-view-recent-items9628 -Node: org-ql-sparse-tree10124 -Node: Queries10924 -Node: Non-sexp query syntax12041 -Node: General predicates13800 -Node: Ancestor/descendant predicates20725 -Node: Date/time predicates21853 -Node: Functions / Macros24977 -Node: Agenda-like views25275 -Ref: Function org-ql-block25437 -Node: Listing / acting-on results26698 -Ref: Caching26906 -Ref: Function org-ql-select27819 -Ref: Function org-ql-query30245 -Ref: Macro org-ql (deprecated)32019 -Node: Custom predicates32334 -Ref: Macro org-ql-defpred32558 -Node: Dynamic block35999 -Node: Links38723 -Node: Tips39410 -Node: Changelog39734 -Node: 08-pre40558 -Node: 07443031 -Node: 07343258 -Node: 07243990 -Node: 07144909 -Node: 0745718 -Node: 06348642 -Node: 06249173 -Node: 06149478 -Node: 0650046 -Node: 05253102 -Node: 05153404 -Node: 0553829 -Node: 04955360 -Node: 04855642 -Node: 04755991 -Node: 04656400 -Node: 04556808 -Node: 04457169 -Node: 04357528 -Node: 04257731 -Node: 04157892 -Node: 0458139 -Node: 03262240 -Node: 03162643 -Node: 0362840 -Node: 02366140 -Node: 02266374 -Node: 02166654 -Node: 0266859 -Node: 0170937 -Node: Notes71038 -Node: Comparison with Org Agenda searches71200 -Node: org-sidebar72089 -Node: License72368 +Node: org-ql-open-link5316 +Node: org-ql-refile6171 +Node: org-ql-search6499 +Node: helm-org-ql8430 +Node: org-ql-view8808 +Node: org-ql-view-sidebar9338 +Node: org-ql-view-recent-items9718 +Node: org-ql-sparse-tree10214 +Node: Queries11014 +Node: Non-sexp query syntax12131 +Node: General predicates13890 +Node: Ancestor/descendant predicates20815 +Node: Date/time predicates21943 +Node: Functions / Macros25067 +Node: Agenda-like views25365 +Ref: Function org-ql-block25527 +Node: Listing / acting-on results26788 +Ref: Caching26996 +Ref: Function org-ql-select27909 +Ref: Function org-ql-query30335 +Ref: Macro org-ql (deprecated)32109 +Node: Custom predicates32424 +Ref: Macro org-ql-defpred32648 +Node: Dynamic block36089 +Node: Links38813 +Node: Tips39500 +Node: Changelog39824 +Node: 08-pre40648 +Node: 07443372 +Node: 07343599 +Node: 07244331 +Node: 07145250 +Node: 0746059 +Node: 06348983 +Node: 06249514 +Node: 06149819 +Node: 0650387 +Node: 05253443 +Node: 05153745 +Node: 0554170 +Node: 04955701 +Node: 04855983 +Node: 04756332 +Node: 04656741 +Node: 04557149 +Node: 04457510 +Node: 04357869 +Node: 04258072 +Node: 04158233 +Node: 0458480 +Node: 03262581 +Node: 03162984 +Node: 0363181 +Node: 02366481 +Node: 02266715 +Node: 02166995 +Node: 0267200 +Node: 0171278 +Node: Notes71379 +Node: Comparison with Org Agenda searches71541 +Node: org-sidebar72430 +Node: License72709  End Tag Table From eaf58b463e48d209c47c08ca00d0faee5cdd7915 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 21 Dec 2023 16:54:17 -0600 Subject: [PATCH 065/145] Meta: Update copyright years Fixes #336. --- org-ql-completing-read.el | 2 +- org-ql-find.el | 2 +- org-ql-search.el | 2 ++ org-ql-view.el | 2 ++ org-ql.el | 2 +- 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/org-ql-completing-read.el b/org-ql-completing-read.el index a8053af..e535f8b 100644 --- a/org-ql-completing-read.el +++ b/org-ql-completing-read.el @@ -1,6 +1,6 @@ ;;; org-ql-completing-read.el --- Completing read of Org entries using org-ql -*- lexical-binding: t; -*- -;; Copyright (C) 2022 Adam Porter +;; Copyright (C) 2022-2023 Adam Porter ;; Author: Adam Porter diff --git a/org-ql-find.el b/org-ql-find.el index 84dad91..e4b16a6 100644 --- a/org-ql-find.el +++ b/org-ql-find.el @@ -1,6 +1,6 @@ ;;; org-ql-find.el --- Find headings with completion using org-ql -*- lexical-binding: t; -*- -;; Copyright (C) 2022 Adam Porter +;; Copyright (C) 2022-2023 Adam Porter ;; Author: Adam Porter diff --git a/org-ql-search.el b/org-ql-search.el index da1cfb3..f726891 100644 --- a/org-ql-search.el +++ b/org-ql-search.el @@ -1,5 +1,7 @@ ;;; org-ql-search.el --- Search commands for org-ql -*- lexical-binding: t; -*- +;; Copyright (C) 2019-2023 Adam Porter + ;; Author: Adam Porter ;; Url: https://github.com/alphapapa/org-ql diff --git a/org-ql-view.el b/org-ql-view.el index 84507a4..5d452de 100644 --- a/org-ql-view.el +++ b/org-ql-view.el @@ -1,5 +1,7 @@ ;;; org-ql-view.el --- Agenda-like view based on org-ql -*- lexical-binding: t; -*- +;; Copyright (C) 2019-2023 Adam Porter + ;; Author: Adam Porter ;; Url: https://github.com/alphapapa/org-ql diff --git a/org-ql.el b/org-ql.el index 2ba9a31..29d515c 100644 --- a/org-ql.el +++ b/org-ql.el @@ -1,6 +1,6 @@ ;;; org-ql.el --- Org Query Language, search command, and agenda-like view -*- lexical-binding: t; -*- -;; Copyright (C) 2017-2022 Adam Porter +;; Copyright (C) 2017-2023 Adam Porter ;; Author: Adam Porter ;; Url: https://github.com/alphapapa/org-ql From b015b3b910ddcff4d46621be53b9fa09df7632c5 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 21 Dec 2023 17:10:53 -0600 Subject: [PATCH 066/145] Tidy: Indentation, variable --- org-ql-completing-read.el | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/org-ql-completing-read.el b/org-ql-completing-read.el index e535f8b..4db51e6 100644 --- a/org-ql-completing-read.el +++ b/org-ql-completing-read.el @@ -134,7 +134,7 @@ value, or nil." (buffers-files &key query-prefix query-filter (action #'org-ql-completing-read-action) ;; FIXME: Unused argument. - (annotate #'org-ql-completing-read-snippet) + ;; (annotate #'org-ql-completing-read-snippet) (snippet #'org-ql-completing-read-snippet) (path #'org-ql-completing-read-path) (action-filter #'list) @@ -188,7 +188,6 @@ single predicate)." (setf string (format "%s <%s>" string (cl-incf suffix))) (setf string (format "%s <%s>" string (puthash string 2 disambiguations))))) (puthash (propertize string 'org-marker marker) marker table))))) - (path (marker) (org-with-point-at marker (let* ((path (thread-first (org-get-outline-path nil t) @@ -198,10 +197,10 @@ single predicate)." (concat "\\" (string-join (reverse path) "\\")) (concat "/" (string-join path "/"))))) formatted-path))) - (todo - (marker) (if-let (it (org-entry-get marker "TODO")) - (concat (propertize it 'face (org-get-todo-face it)) " ") - "")) + (todo (marker) + (if-let (it (org-entry-get marker "TODO")) + (concat (propertize it 'face (org-get-todo-face it)) " ") + "")) (affix (completions) ;; (debug-message "AFFIX:%S" completions) (cl-loop for completion in completions @@ -216,14 +215,14 @@ single predicate)." ;; e.g. Helm while typing, but it seems to help a little when using the ;; org-rifle-style snippets. (or (snippet (get-text-property 0 'org-marker candidate)) ""))) - (snippet - (marker) (when-let - ((snippet - (org-with-point-at marker - (or (funcall org-ql-completing-read-snippet-function org-ql-completing-read-input-regexp) - (org-ql-completing-read--snippet-simple))))) - (propertize (concat " " snippet) - 'face 'org-ql-completing-read-snippet))) + (snippet (marker) + (when-let + ((snippet + (org-with-point-at marker + (or (funcall org-ql-completing-read-snippet-function org-ql-completing-read-input-regexp) + (org-ql-completing-read--snippet-simple))))) + (propertize (concat " " snippet) + 'face 'org-ql-completing-read-snippet))) (group (candidate transform) (pcase transform (`nil (buffer-name (marker-buffer (get-text-property 0 'org-marker candidate)))) From 09e7b60505d80db038eefcd8519c7bd64b31e030 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 21 Dec 2023 17:11:01 -0600 Subject: [PATCH 067/145] Tidy: Compatibility aliases for Org 9.6 --- org-ql-search.el | 14 ++++++++++++-- org-ql.el | 8 +++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/org-ql-search.el b/org-ql-search.el index f726891..57215f8 100644 --- a/org-ql-search.el +++ b/org-ql-search.el @@ -58,6 +58,16 @@ ((fboundp 'org-store-link-props) #'org-store-link-props) (t (error "org-ql: Unable to define alias `org-ql-search--org-link-store-props'. Please report this as a bug")))) +(defalias 'org-ql--org-hide-archived-subtrees + (if (version<= "9.6" org-version) + 'org-fold-hide-archived-subtrees + 'org-hide-archived-subtrees)) + +(defalias 'org-ql--org-show-context + (if (version<= "9.6" org-version) + 'org-fold-show-context + 'org-show-context)) + ;;;; Variables (defvar org-ql-block-header nil @@ -126,10 +136,10 @@ Runs `org-occur-hook' after making the sparse tree." query)))) (org-ql-select buffer query :action (lambda () - (org-show-context 'occur-tree) + (org-ql--org-show-context 'occur-tree) (cl-incf num-results))) (unless org-sparse-tree-open-archived-trees - (org-hide-archived-subtrees (point-min) (point-max))) + (org-ql--org-hide-archived-subtrees (point-min) (point-max))) (run-hooks 'org-occur-hook) (unless (get-buffer-window buffer) (pop-to-buffer buffer)) diff --git a/org-ql.el b/org-ql.el index 29d515c..d9f834b 100644 --- a/org-ql.el +++ b/org-ql.el @@ -96,6 +96,12 @@ Necessary because of backward-incompatible changes in Org `org-bracket-link-regexp' was marked as an obsolete alias for it, but the match groups were changed, so they are not compatible.") +;;;; Compatibility +(defalias 'org-ql--org-timestamp-format + (if (version<= "9.6" org-version) + 'org-format-timestamp + 'org-timestamp-format)) + ;;;; Variables (defvar org-ql--today nil) @@ -2478,7 +2484,7 @@ Deadline is considered before scheduled." A and B are Org timestamp elements." (cl-macrolet ((ts (ts) `(when ,ts - (org-timestamp-format ,ts "%s")))) + (org-ql--org-timestamp-format ,ts "%s")))) (let* ((a-ts (ts a)) (b-ts (ts b))) (cond ((and a-ts b-ts) From 087e99703efc236680e77f4d081b939139e1d782 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 21 Dec 2023 17:14:30 -0600 Subject: [PATCH 068/145] Release: v0.8 --- README.org | 2 +- org-ql.el | 2 +- org-ql.info | 152 ++++++++++++++++++++++++++-------------------------- 3 files changed, 78 insertions(+), 78 deletions(-) diff --git a/README.org b/README.org index bd34ecf..180db57 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-pre +** 0.8 *Additions* diff --git a/org-ql.el b/org-ql.el index d9f834b..4a66726 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-pre +;; Version: 0.8 ;; 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 430d5a9..71e17b3 100644 --- a/org-ql.info +++ b/org-ql.info @@ -72,7 +72,7 @@ Functions / Macros Changelog -* 0.8-pre: 08-pre. +* 0.8: 08. * 0.7.4: 074. * 0.7.3: 073. * 0.7.2: 072. @@ -1028,7 +1028,7 @@ releases. * Menu: -* 0.8-pre: 08-pre. +* 0.8: 08. * 0.7.4: 074. * 0.7.3: 073. * 0.7.2: 072. @@ -1061,10 +1061,10 @@ releases. * 0.1: 01.  -File: README.info, Node: 08-pre, Next: 074, Up: Changelog +File: README.info, Node: 08, Next: 074, Up: Changelog -5.1 0.8-pre -=========== +5.1 0.8 +======= *Additions* @@ -1117,7 +1117,7 @@ File: README.info, Node: 08-pre, Next: 074, Up: Changelog (https://github.com/yantar92) for his feedback.)  -File: README.info, Node: 074, Next: 073, Prev: 08-pre, Up: Changelog +File: README.info, Node: 074, Next: 073, Prev: 08, Up: Changelog 5.2 0.7.4 ========= @@ -1870,76 +1870,76 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1859 -Node: Screenshots1982 -Node: Installation2100 -Node: Quelpa2614 -Node: Helm support3142 -Node: Usage3545 -Node: Commands3943 -Node: org-ql-find4408 -Node: org-ql-open-link5316 -Node: org-ql-refile6171 -Node: org-ql-search6499 -Node: helm-org-ql8430 -Node: org-ql-view8808 -Node: org-ql-view-sidebar9338 -Node: org-ql-view-recent-items9718 -Node: org-ql-sparse-tree10214 -Node: Queries11014 -Node: Non-sexp query syntax12131 -Node: General predicates13890 -Node: Ancestor/descendant predicates20815 -Node: Date/time predicates21943 -Node: Functions / Macros25067 -Node: Agenda-like views25365 -Ref: Function org-ql-block25527 -Node: Listing / acting-on results26788 -Ref: Caching26996 -Ref: Function org-ql-select27909 -Ref: Function org-ql-query30335 -Ref: Macro org-ql (deprecated)32109 -Node: Custom predicates32424 -Ref: Macro org-ql-defpred32648 -Node: Dynamic block36089 -Node: Links38813 -Node: Tips39500 -Node: Changelog39824 -Node: 08-pre40648 -Node: 07443372 -Node: 07343599 -Node: 07244331 -Node: 07145250 -Node: 0746059 -Node: 06348983 -Node: 06249514 -Node: 06149819 -Node: 0650387 -Node: 05253443 -Node: 05153745 -Node: 0554170 -Node: 04955701 -Node: 04855983 -Node: 04756332 -Node: 04656741 -Node: 04557149 -Node: 04457510 -Node: 04357869 -Node: 04258072 -Node: 04158233 -Node: 0458480 -Node: 03262581 -Node: 03162984 -Node: 0363181 -Node: 02366481 -Node: 02266715 -Node: 02166995 -Node: 0267200 -Node: 0171278 -Node: Notes71379 -Node: Comparison with Org Agenda searches71541 -Node: org-sidebar72430 -Node: License72709 +Node: Contents1851 +Node: Screenshots1974 +Node: Installation2092 +Node: Quelpa2606 +Node: Helm support3134 +Node: Usage3537 +Node: Commands3935 +Node: org-ql-find4400 +Node: org-ql-open-link5308 +Node: org-ql-refile6163 +Node: org-ql-search6491 +Node: helm-org-ql8422 +Node: org-ql-view8800 +Node: org-ql-view-sidebar9330 +Node: org-ql-view-recent-items9710 +Node: org-ql-sparse-tree10206 +Node: Queries11006 +Node: Non-sexp query syntax12123 +Node: General predicates13882 +Node: Ancestor/descendant predicates20807 +Node: Date/time predicates21935 +Node: Functions / Macros25059 +Node: Agenda-like views25357 +Ref: Function org-ql-block25519 +Node: Listing / acting-on results26780 +Ref: Caching26988 +Ref: Function org-ql-select27901 +Ref: Function org-ql-query30327 +Ref: Macro org-ql (deprecated)32101 +Node: Custom predicates32416 +Ref: Macro org-ql-defpred32640 +Node: Dynamic block36081 +Node: Links38805 +Node: Tips39492 +Node: Changelog39816 +Node: 0840632 +Node: 07443344 +Node: 07343567 +Node: 07244299 +Node: 07145218 +Node: 0746027 +Node: 06348951 +Node: 06249482 +Node: 06149787 +Node: 0650355 +Node: 05253411 +Node: 05153713 +Node: 0554138 +Node: 04955669 +Node: 04855951 +Node: 04756300 +Node: 04656709 +Node: 04557117 +Node: 04457478 +Node: 04357837 +Node: 04258040 +Node: 04158201 +Node: 0458448 +Node: 03262549 +Node: 03162952 +Node: 0363149 +Node: 02366449 +Node: 02266683 +Node: 02166963 +Node: 0267168 +Node: 0171246 +Node: Notes71347 +Node: Comparison with Org Agenda searches71509 +Node: org-sidebar72398 +Node: License72677  End Tag Table From 0e39372146b56902d01d6c1d7cc3aab7bc29d095 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sun, 24 Dec 2023 01:09:49 -0600 Subject: [PATCH 069/145] Meta: v0.9-pre --- README.org | 4 + org-ql.el | 2 +- org-ql.info | 217 +++++++++++++++++++++++++++------------------------- 3 files changed, 119 insertions(+), 104 deletions(-) diff --git a/README.org b/README.org index 180db57..745c1dd 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.9-pre + +Nothing new yet. + ** 0.8 *Additions* diff --git a/org-ql.el b/org-ql.el index 4a66726..338c52a 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 +;; Version: 0.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 71e17b3..113f6d1 100644 --- a/org-ql.info +++ b/org-ql.info @@ -72,6 +72,7 @@ Functions / Macros Changelog +* 0.9-pre: 09-pre. * 0.8: 08. * 0.7.4: 074. * 0.7.3: 073. @@ -1028,6 +1029,7 @@ releases. * Menu: +* 0.9-pre: 09-pre. * 0.8: 08. * 0.7.4: 074. * 0.7.3: 073. @@ -1061,9 +1063,17 @@ releases. * 0.1: 01.  -File: README.info, Node: 08, Next: 074, Up: Changelog +File: README.info, Node: 09-pre, Next: 08, Up: Changelog -5.1 0.8 +5.1 0.9-pre +=========== + +Nothing new yet. + + +File: README.info, Node: 08, Next: 074, Prev: 09-pre, Up: Changelog + +5.2 0.8 ======= *Additions* @@ -1119,7 +1129,7 @@ File: README.info, Node: 08, Next: 074, Up: Changelog  File: README.info, Node: 074, Next: 073, Prev: 08, Up: Changelog -5.2 0.7.4 +5.3 0.7.4 ========= *Fixes* @@ -1129,7 +1139,7 @@ File: README.info, Node: 074, Next: 073, Prev: 08, Up: Changelog  File: README.info, Node: 073, Next: 072, Prev: 074, Up: Changelog -5.3 0.7.3 +5.4 0.7.3 ========= *Fixes* @@ -1147,7 +1157,7 @@ File: README.info, Node: 073, Next: 072, Prev: 074, Up: Changelog  File: README.info, Node: 072, Next: 071, Prev: 073, Up: Changelog -5.4 0.7.2 +5.5 0.7.2 ========= *Fixes* @@ -1168,7 +1178,7 @@ File: README.info, Node: 072, Next: 071, Prev: 073, Up: Changelog  File: README.info, Node: 071, Next: 07, Prev: 072, Up: Changelog -5.5 0.7.1 +5.6 0.7.1 ========= *Fixes* @@ -1187,7 +1197,7 @@ File: README.info, Node: 071, Next: 07, Prev: 072, Up: Changelog  File: README.info, Node: 07, Next: 063, Prev: 071, Up: Changelog -5.6 0.7 +5.7 0.7 ======= *Added* @@ -1247,7 +1257,7 @@ File: README.info, Node: 07, Next: 063, Prev: 071, Up: Changelog  File: README.info, Node: 063, Next: 062, Prev: 07, Up: Changelog -5.7 0.6.3 +5.8 0.6.3 ========= *Fixed* @@ -1263,7 +1273,7 @@ File: README.info, Node: 063, Next: 062, Prev: 07, Up: Changelog  File: README.info, Node: 062, Next: 061, Prev: 063, Up: Changelog -5.8 0.6.2 +5.9 0.6.2 ========= *Fixed* @@ -1274,8 +1284,8 @@ File: README.info, Node: 062, Next: 061, Prev: 063, Up: Changelog  File: README.info, Node: 061, Next: 06, Prev: 062, Up: Changelog -5.9 0.6.1 -========= +5.10 0.6.1 +========== *Fixed* • In dynamic blocks, links to headings with statistics cookies were @@ -1292,7 +1302,7 @@ File: README.info, Node: 061, Next: 06, Prev: 062, Up: Changelog  File: README.info, Node: 06, Next: 052, Prev: 061, Up: Changelog -5.10 0.6 +5.11 0.6 ======== *Added* @@ -1359,7 +1369,7 @@ File: README.info, Node: 06, Next: 052, Prev: 061, Up: Changelog  File: README.info, Node: 052, Next: 051, Prev: 06, Up: Changelog -5.11 0.5.2 +5.12 0.5.2 ========== *Fixed* @@ -1370,7 +1380,7 @@ File: README.info, Node: 052, Next: 051, Prev: 06, Up: Changelog  File: README.info, Node: 051, Next: 05, Prev: 052, Up: Changelog -5.12 0.5.1 +5.13 0.5.1 ========== *Fixed* @@ -1383,7 +1393,7 @@ File: README.info, Node: 051, Next: 05, Prev: 052, Up: Changelog  File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog -5.13 0.5 +5.14 0.5 ======== *Added* @@ -1424,7 +1434,7 @@ File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog  File: README.info, Node: 049, Next: 048, Prev: 05, Up: Changelog -5.14 0.4.9 +5.15 0.4.9 ========== *Fixed* @@ -1435,7 +1445,7 @@ File: README.info, Node: 049, Next: 048, Prev: 05, Up: Changelog  File: README.info, Node: 048, Next: 047, Prev: 049, Up: Changelog -5.15 0.4.8 +5.16 0.4.8 ========== *Fixed* @@ -1447,7 +1457,7 @@ File: README.info, Node: 048, Next: 047, Prev: 049, Up: Changelog  File: README.info, Node: 047, Next: 046, Prev: 048, Up: Changelog -5.16 0.4.7 +5.17 0.4.7 ========== *Fixed* @@ -1460,7 +1470,7 @@ File: README.info, Node: 047, Next: 046, Prev: 048, Up: Changelog  File: README.info, Node: 046, Next: 045, Prev: 047, Up: Changelog -5.17 0.4.6 +5.18 0.4.6 ========== *Fixed* @@ -1473,7 +1483,7 @@ File: README.info, Node: 046, Next: 045, Prev: 047, Up: Changelog  File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog -5.18 0.4.5 +5.19 0.4.5 ========== *Fixed* @@ -1485,7 +1495,7 @@ File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog  File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog -5.19 0.4.4 +5.20 0.4.4 ========== *Fixed* @@ -1497,7 +1507,7 @@ File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog  File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog -5.20 0.4.3 +5.21 0.4.3 ========== *Fixed* @@ -1507,7 +1517,7 @@ File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog  File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog -5.21 0.4.2 +5.22 0.4.2 ========== *Fixed* @@ -1516,7 +1526,7 @@ File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog  File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog -5.22 0.4.1 +5.23 0.4.1 ========== *Fixed* @@ -1526,7 +1536,7 @@ File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog  File: README.info, Node: 04, Next: 032, Prev: 041, Up: Changelog -5.23 0.4 +5.24 0.4 ======== _Note:_ The next release, 0.5, may include changes which will require @@ -1607,7 +1617,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.24 0.3.2 +5.25 0.3.2 ========== *Fixed* @@ -1620,7 +1630,7 @@ File: README.info, Node: 032, Next: 031, Prev: 04, Up: Changelog  File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog -5.25 0.3.1 +5.26 0.3.1 ========== *Fixed* @@ -1630,7 +1640,7 @@ File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog  File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog -5.26 0.3 +5.27 0.3 ======== *Added* @@ -1698,7 +1708,7 @@ File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog  File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog -5.27 0.2.3 +5.28 0.2.3 ========== *Fixed* @@ -1708,7 +1718,7 @@ File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog  File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog -5.28 0.2.2 +5.29 0.2.2 ========== *Fixed* @@ -1719,7 +1729,7 @@ File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog  File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog -5.29 0.2.1 +5.30 0.2.1 ========== *Fixed* @@ -1729,7 +1739,7 @@ File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog  File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog -5.30 0.2 +5.31 0.2 ======== *Added* @@ -1812,7 +1822,7 @@ File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog  File: README.info, Node: 01, Prev: 02, Up: Changelog -5.31 0.1 +5.32 0.1 ======== First tagged release. @@ -1870,76 +1880,77 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1851 -Node: Screenshots1974 -Node: Installation2092 -Node: Quelpa2606 -Node: Helm support3134 -Node: Usage3537 -Node: Commands3935 -Node: org-ql-find4400 -Node: org-ql-open-link5308 -Node: org-ql-refile6163 -Node: org-ql-search6491 -Node: helm-org-ql8422 -Node: org-ql-view8800 -Node: org-ql-view-sidebar9330 -Node: org-ql-view-recent-items9710 -Node: org-ql-sparse-tree10206 -Node: Queries11006 -Node: Non-sexp query syntax12123 -Node: General predicates13882 -Node: Ancestor/descendant predicates20807 -Node: Date/time predicates21935 -Node: Functions / Macros25059 -Node: Agenda-like views25357 -Ref: Function org-ql-block25519 -Node: Listing / acting-on results26780 -Ref: Caching26988 -Ref: Function org-ql-select27901 -Ref: Function org-ql-query30327 -Ref: Macro org-ql (deprecated)32101 -Node: Custom predicates32416 -Ref: Macro org-ql-defpred32640 -Node: Dynamic block36081 -Node: Links38805 -Node: Tips39492 -Node: Changelog39816 -Node: 0840632 -Node: 07443344 -Node: 07343567 -Node: 07244299 -Node: 07145218 -Node: 0746027 -Node: 06348951 -Node: 06249482 -Node: 06149787 -Node: 0650355 -Node: 05253411 -Node: 05153713 -Node: 0554138 -Node: 04955669 -Node: 04855951 -Node: 04756300 -Node: 04656709 -Node: 04557117 -Node: 04457478 -Node: 04357837 -Node: 04258040 -Node: 04158201 -Node: 0458448 -Node: 03262549 -Node: 03162952 -Node: 0363149 -Node: 02366449 -Node: 02266683 -Node: 02166963 -Node: 0267168 -Node: 0171246 -Node: Notes71347 -Node: Comparison with Org Agenda searches71509 -Node: org-sidebar72398 -Node: License72677 +Node: Contents1870 +Node: Screenshots1993 +Node: Installation2111 +Node: Quelpa2625 +Node: Helm support3153 +Node: Usage3556 +Node: Commands3954 +Node: org-ql-find4419 +Node: org-ql-open-link5327 +Node: org-ql-refile6182 +Node: org-ql-search6510 +Node: helm-org-ql8441 +Node: org-ql-view8819 +Node: org-ql-view-sidebar9349 +Node: org-ql-view-recent-items9729 +Node: org-ql-sparse-tree10225 +Node: Queries11025 +Node: Non-sexp query syntax12142 +Node: General predicates13901 +Node: Ancestor/descendant predicates20826 +Node: Date/time predicates21954 +Node: Functions / Macros25078 +Node: Agenda-like views25376 +Ref: Function org-ql-block25538 +Node: Listing / acting-on results26799 +Ref: Caching27007 +Ref: Function org-ql-select27920 +Ref: Function org-ql-query30346 +Ref: Macro org-ql (deprecated)32120 +Node: Custom predicates32435 +Ref: Macro org-ql-defpred32659 +Node: Dynamic block36100 +Node: Links38824 +Node: Tips39511 +Node: Changelog39835 +Node: 09-pre40670 +Node: 0840776 +Node: 07443503 +Node: 07343726 +Node: 07244458 +Node: 07145377 +Node: 0746186 +Node: 06349110 +Node: 06249641 +Node: 06149946 +Node: 0650516 +Node: 05253572 +Node: 05153874 +Node: 0554299 +Node: 04955830 +Node: 04856112 +Node: 04756461 +Node: 04656870 +Node: 04557278 +Node: 04457639 +Node: 04357998 +Node: 04258201 +Node: 04158362 +Node: 0458609 +Node: 03262710 +Node: 03163113 +Node: 0363310 +Node: 02366610 +Node: 02266844 +Node: 02167124 +Node: 0267329 +Node: 0171407 +Node: Notes71508 +Node: Comparison with Org Agenda searches71670 +Node: org-sidebar72559 +Node: License72838  End Tag Table From a4bf5b0a92e47fb4ea0c5e4e5462a71b1c9b20a9 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sun, 24 Dec 2023 01:10:27 -0600 Subject: [PATCH 070/145] Tidy: (org-ql-view--display) Take STRINGS instead of STRING No need to allocate one large string just to insert it into the buffer. --- org-ql-search.el | 3 +-- org-ql-view.el | 6 ++++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/org-ql-search.el b/org-ql-search.el index 57215f8..d08397a 100644 --- a/org-ql-search.el +++ b/org-ql-search.el @@ -220,8 +220,7 @@ necessary." (symbol (symbol-value super-groups)) (list super-groups)))) (setf strings (org-super-agenda--group-items strings)))) - (org-ql-view--display :buffer buffer :header header - :string (s-join "\n" strings))))) + (org-ql-view--display :buffer buffer :header header :strings strings)))) ;;;###autoload (defun org-ql-search-block (query) diff --git a/org-ql-view.el b/org-ql-view.el index 5d452de..e13cfaa 100644 --- a/org-ql-view.el +++ b/org-ql-view.el @@ -408,7 +408,7 @@ update search arguments." (defvar bookmark-make-record-function) -(cl-defun org-ql-view--display (&key (buffer org-ql-view-buffer) header string) +(cl-defun org-ql-view--display (&key (buffer org-ql-view-buffer) header strings) "Display STRING in `org-ql-view' BUFFER. BUFFER may be a buffer, or a string naming a buffer, which is @@ -446,7 +446,9 @@ subsequent refreshing of the buffer: `org-ql-view-buffers-files', ;; Clear buffer, insert entries, etc. (let ((inhibit-read-only t)) (erase-buffer) - (insert string "\n") + (dolist (string strings) + (insert string "\n")) + (insert "\n") (pop-to-buffer (current-buffer) org-ql-view-display-buffer-action) (org-agenda-finalize) (goto-char (point-min)))))) From 24b799ab0bd49b1a128350cabf6421ff9d0e536f Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 3 Jan 2024 18:25:18 -0600 Subject: [PATCH 071/145] Meta: v0.8.1-pre --- README.org | 4 + org-ql.el | 2 +- org-ql.info | 217 +++++++++++++++++++++++++++------------------------- 3 files changed, 119 insertions(+), 104 deletions(-) diff --git a/README.org b/README.org index 180db57..20b13c5 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.1-pre + +Nothing new yet. + ** 0.8 *Additions* diff --git a/org-ql.el b/org-ql.el index 4a66726..7134a48 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 +;; Version: 0.8.1-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 71e17b3..e88fde6 100644 --- a/org-ql.info +++ b/org-ql.info @@ -72,6 +72,7 @@ Functions / Macros Changelog +* 0.8.1-pre: 081-pre. * 0.8: 08. * 0.7.4: 074. * 0.7.3: 073. @@ -1028,6 +1029,7 @@ releases. * Menu: +* 0.8.1-pre: 081-pre. * 0.8: 08. * 0.7.4: 074. * 0.7.3: 073. @@ -1061,9 +1063,17 @@ releases. * 0.1: 01.  -File: README.info, Node: 08, Next: 074, Up: Changelog +File: README.info, Node: 081-pre, Next: 08, Up: Changelog -5.1 0.8 +5.1 0.8.1-pre +============= + +Nothing new yet. + + +File: README.info, Node: 08, Next: 074, Prev: 081-pre, Up: Changelog + +5.2 0.8 ======= *Additions* @@ -1119,7 +1129,7 @@ File: README.info, Node: 08, Next: 074, Up: Changelog  File: README.info, Node: 074, Next: 073, Prev: 08, Up: Changelog -5.2 0.7.4 +5.3 0.7.4 ========= *Fixes* @@ -1129,7 +1139,7 @@ File: README.info, Node: 074, Next: 073, Prev: 08, Up: Changelog  File: README.info, Node: 073, Next: 072, Prev: 074, Up: Changelog -5.3 0.7.3 +5.4 0.7.3 ========= *Fixes* @@ -1147,7 +1157,7 @@ File: README.info, Node: 073, Next: 072, Prev: 074, Up: Changelog  File: README.info, Node: 072, Next: 071, Prev: 073, Up: Changelog -5.4 0.7.2 +5.5 0.7.2 ========= *Fixes* @@ -1168,7 +1178,7 @@ File: README.info, Node: 072, Next: 071, Prev: 073, Up: Changelog  File: README.info, Node: 071, Next: 07, Prev: 072, Up: Changelog -5.5 0.7.1 +5.6 0.7.1 ========= *Fixes* @@ -1187,7 +1197,7 @@ File: README.info, Node: 071, Next: 07, Prev: 072, Up: Changelog  File: README.info, Node: 07, Next: 063, Prev: 071, Up: Changelog -5.6 0.7 +5.7 0.7 ======= *Added* @@ -1247,7 +1257,7 @@ File: README.info, Node: 07, Next: 063, Prev: 071, Up: Changelog  File: README.info, Node: 063, Next: 062, Prev: 07, Up: Changelog -5.7 0.6.3 +5.8 0.6.3 ========= *Fixed* @@ -1263,7 +1273,7 @@ File: README.info, Node: 063, Next: 062, Prev: 07, Up: Changelog  File: README.info, Node: 062, Next: 061, Prev: 063, Up: Changelog -5.8 0.6.2 +5.9 0.6.2 ========= *Fixed* @@ -1274,8 +1284,8 @@ File: README.info, Node: 062, Next: 061, Prev: 063, Up: Changelog  File: README.info, Node: 061, Next: 06, Prev: 062, Up: Changelog -5.9 0.6.1 -========= +5.10 0.6.1 +========== *Fixed* • In dynamic blocks, links to headings with statistics cookies were @@ -1292,7 +1302,7 @@ File: README.info, Node: 061, Next: 06, Prev: 062, Up: Changelog  File: README.info, Node: 06, Next: 052, Prev: 061, Up: Changelog -5.10 0.6 +5.11 0.6 ======== *Added* @@ -1359,7 +1369,7 @@ File: README.info, Node: 06, Next: 052, Prev: 061, Up: Changelog  File: README.info, Node: 052, Next: 051, Prev: 06, Up: Changelog -5.11 0.5.2 +5.12 0.5.2 ========== *Fixed* @@ -1370,7 +1380,7 @@ File: README.info, Node: 052, Next: 051, Prev: 06, Up: Changelog  File: README.info, Node: 051, Next: 05, Prev: 052, Up: Changelog -5.12 0.5.1 +5.13 0.5.1 ========== *Fixed* @@ -1383,7 +1393,7 @@ File: README.info, Node: 051, Next: 05, Prev: 052, Up: Changelog  File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog -5.13 0.5 +5.14 0.5 ======== *Added* @@ -1424,7 +1434,7 @@ File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog  File: README.info, Node: 049, Next: 048, Prev: 05, Up: Changelog -5.14 0.4.9 +5.15 0.4.9 ========== *Fixed* @@ -1435,7 +1445,7 @@ File: README.info, Node: 049, Next: 048, Prev: 05, Up: Changelog  File: README.info, Node: 048, Next: 047, Prev: 049, Up: Changelog -5.15 0.4.8 +5.16 0.4.8 ========== *Fixed* @@ -1447,7 +1457,7 @@ File: README.info, Node: 048, Next: 047, Prev: 049, Up: Changelog  File: README.info, Node: 047, Next: 046, Prev: 048, Up: Changelog -5.16 0.4.7 +5.17 0.4.7 ========== *Fixed* @@ -1460,7 +1470,7 @@ File: README.info, Node: 047, Next: 046, Prev: 048, Up: Changelog  File: README.info, Node: 046, Next: 045, Prev: 047, Up: Changelog -5.17 0.4.6 +5.18 0.4.6 ========== *Fixed* @@ -1473,7 +1483,7 @@ File: README.info, Node: 046, Next: 045, Prev: 047, Up: Changelog  File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog -5.18 0.4.5 +5.19 0.4.5 ========== *Fixed* @@ -1485,7 +1495,7 @@ File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog  File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog -5.19 0.4.4 +5.20 0.4.4 ========== *Fixed* @@ -1497,7 +1507,7 @@ File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog  File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog -5.20 0.4.3 +5.21 0.4.3 ========== *Fixed* @@ -1507,7 +1517,7 @@ File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog  File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog -5.21 0.4.2 +5.22 0.4.2 ========== *Fixed* @@ -1516,7 +1526,7 @@ File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog  File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog -5.22 0.4.1 +5.23 0.4.1 ========== *Fixed* @@ -1526,7 +1536,7 @@ File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog  File: README.info, Node: 04, Next: 032, Prev: 041, Up: Changelog -5.23 0.4 +5.24 0.4 ======== _Note:_ The next release, 0.5, may include changes which will require @@ -1607,7 +1617,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.24 0.3.2 +5.25 0.3.2 ========== *Fixed* @@ -1620,7 +1630,7 @@ File: README.info, Node: 032, Next: 031, Prev: 04, Up: Changelog  File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog -5.25 0.3.1 +5.26 0.3.1 ========== *Fixed* @@ -1630,7 +1640,7 @@ File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog  File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog -5.26 0.3 +5.27 0.3 ======== *Added* @@ -1698,7 +1708,7 @@ File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog  File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog -5.27 0.2.3 +5.28 0.2.3 ========== *Fixed* @@ -1708,7 +1718,7 @@ File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog  File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog -5.28 0.2.2 +5.29 0.2.2 ========== *Fixed* @@ -1719,7 +1729,7 @@ File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog  File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog -5.29 0.2.1 +5.30 0.2.1 ========== *Fixed* @@ -1729,7 +1739,7 @@ File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog  File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog -5.30 0.2 +5.31 0.2 ======== *Added* @@ -1812,7 +1822,7 @@ File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog  File: README.info, Node: 01, Prev: 02, Up: Changelog -5.31 0.1 +5.32 0.1 ======== First tagged release. @@ -1870,76 +1880,77 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1851 -Node: Screenshots1974 -Node: Installation2092 -Node: Quelpa2606 -Node: Helm support3134 -Node: Usage3537 -Node: Commands3935 -Node: org-ql-find4400 -Node: org-ql-open-link5308 -Node: org-ql-refile6163 -Node: org-ql-search6491 -Node: helm-org-ql8422 -Node: org-ql-view8800 -Node: org-ql-view-sidebar9330 -Node: org-ql-view-recent-items9710 -Node: org-ql-sparse-tree10206 -Node: Queries11006 -Node: Non-sexp query syntax12123 -Node: General predicates13882 -Node: Ancestor/descendant predicates20807 -Node: Date/time predicates21935 -Node: Functions / Macros25059 -Node: Agenda-like views25357 -Ref: Function org-ql-block25519 -Node: Listing / acting-on results26780 -Ref: Caching26988 -Ref: Function org-ql-select27901 -Ref: Function org-ql-query30327 -Ref: Macro org-ql (deprecated)32101 -Node: Custom predicates32416 -Ref: Macro org-ql-defpred32640 -Node: Dynamic block36081 -Node: Links38805 -Node: Tips39492 -Node: Changelog39816 -Node: 0840632 -Node: 07443344 -Node: 07343567 -Node: 07244299 -Node: 07145218 -Node: 0746027 -Node: 06348951 -Node: 06249482 -Node: 06149787 -Node: 0650355 -Node: 05253411 -Node: 05153713 -Node: 0554138 -Node: 04955669 -Node: 04855951 -Node: 04756300 -Node: 04656709 -Node: 04557117 -Node: 04457478 -Node: 04357837 -Node: 04258040 -Node: 04158201 -Node: 0458448 -Node: 03262549 -Node: 03162952 -Node: 0363149 -Node: 02366449 -Node: 02266683 -Node: 02166963 -Node: 0267168 -Node: 0171246 -Node: Notes71347 -Node: Comparison with Org Agenda searches71509 -Node: org-sidebar72398 -Node: License72677 +Node: Contents1873 +Node: Screenshots1996 +Node: Installation2114 +Node: Quelpa2628 +Node: Helm support3156 +Node: Usage3559 +Node: Commands3957 +Node: org-ql-find4422 +Node: org-ql-open-link5330 +Node: org-ql-refile6185 +Node: org-ql-search6513 +Node: helm-org-ql8444 +Node: org-ql-view8822 +Node: org-ql-view-sidebar9352 +Node: org-ql-view-recent-items9732 +Node: org-ql-sparse-tree10228 +Node: Queries11028 +Node: Non-sexp query syntax12145 +Node: General predicates13904 +Node: Ancestor/descendant predicates20829 +Node: Date/time predicates21957 +Node: Functions / Macros25081 +Node: Agenda-like views25379 +Ref: Function org-ql-block25541 +Node: Listing / acting-on results26802 +Ref: Caching27010 +Ref: Function org-ql-select27923 +Ref: Function org-ql-query30349 +Ref: Macro org-ql (deprecated)32123 +Node: Custom predicates32438 +Ref: Macro org-ql-defpred32662 +Node: Dynamic block36103 +Node: Links38827 +Node: Tips39514 +Node: Changelog39838 +Node: 081-pre40676 +Node: 0840787 +Node: 07443515 +Node: 07343738 +Node: 07244470 +Node: 07145389 +Node: 0746198 +Node: 06349122 +Node: 06249653 +Node: 06149958 +Node: 0650528 +Node: 05253584 +Node: 05153886 +Node: 0554311 +Node: 04955842 +Node: 04856124 +Node: 04756473 +Node: 04656882 +Node: 04557290 +Node: 04457651 +Node: 04358010 +Node: 04258213 +Node: 04158374 +Node: 0458621 +Node: 03262722 +Node: 03163125 +Node: 0363322 +Node: 02366622 +Node: 02266856 +Node: 02167136 +Node: 0267341 +Node: 0171419 +Node: Notes71520 +Node: Comparison with Org Agenda searches71682 +Node: org-sidebar72571 +Node: License72850  End Tag Table From 8e9a8fe0907fdd56e46bd78bbfb2d05b9eea0c85 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 3 Jan 2024 18:26:03 -0600 Subject: [PATCH 072/145] Fix: (org-ql-find) Widen buffer This fixes the case in which a user calls org-ql-find from a narrowed buffer and chooses a result outside the restriction. This is already done in, e.g. org-ql-open-link; it's just an oversight here. --- README.org | 4 ++- org-ql-find.el | 4 +-- org-ql.info | 75 ++++++++++++++++++++++++++------------------------ 3 files changed, 44 insertions(+), 39 deletions(-) diff --git a/README.org b/README.org index 20b13c5..178ca4f 100644 --- a/README.org +++ b/README.org @@ -555,7 +555,9 @@ Simple links may also be written manually in either sexp or non-sexp form, like: ** 0.8.1-pre -Nothing new yet. +*Fixes* + ++ Command ~org-ql-find~ widens the buffer before going to the selected entry. ** 0.8 diff --git a/org-ql-find.el b/org-ql-find.el index e4b16a6..fed9ade 100644 --- a/org-ql-find.el +++ b/org-ql-find.el @@ -77,8 +77,8 @@ single predicate)." :prompt prompt))) (set-buffer (marker-buffer marker)) (pop-to-buffer (current-buffer) org-ql-find-display-buffer-action) - (goto-char marker) - (run-hook-with-args 'org-ql-find-goto-hook))) + (org-with-point-at marker + (run-hook-with-args 'org-ql-find-goto-hook)))) ;;;###autoload (defun org-ql-refile (marker) diff --git a/org-ql.info b/org-ql.info index e88fde6..630d120 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1068,7 +1068,10 @@ File: README.info, Node: 081-pre, Next: 08, Up: Changelog 5.1 0.8.1-pre ============= -Nothing new yet. +*Fixes* + + • Command ‘org-ql-find’ widens the buffer before going to the + selected entry.  File: README.info, Node: 08, Next: 074, Prev: 081-pre, Up: Changelog @@ -1916,41 +1919,41 @@ Node: Links38827 Node: Tips39514 Node: Changelog39838 Node: 081-pre40676 -Node: 0840787 -Node: 07443515 -Node: 07343738 -Node: 07244470 -Node: 07145389 -Node: 0746198 -Node: 06349122 -Node: 06249653 -Node: 06149958 -Node: 0650528 -Node: 05253584 -Node: 05153886 -Node: 0554311 -Node: 04955842 -Node: 04856124 -Node: 04756473 -Node: 04656882 -Node: 04557290 -Node: 04457651 -Node: 04358010 -Node: 04258213 -Node: 04158374 -Node: 0458621 -Node: 03262722 -Node: 03163125 -Node: 0363322 -Node: 02366622 -Node: 02266856 -Node: 02167136 -Node: 0267341 -Node: 0171419 -Node: Notes71520 -Node: Comparison with Org Agenda searches71682 -Node: org-sidebar72571 -Node: License72850 +Node: 0840871 +Node: 07443599 +Node: 07343822 +Node: 07244554 +Node: 07145473 +Node: 0746282 +Node: 06349206 +Node: 06249737 +Node: 06150042 +Node: 0650612 +Node: 05253668 +Node: 05153970 +Node: 0554395 +Node: 04955926 +Node: 04856208 +Node: 04756557 +Node: 04656966 +Node: 04557374 +Node: 04457735 +Node: 04358094 +Node: 04258297 +Node: 04158458 +Node: 0458705 +Node: 03262806 +Node: 03163209 +Node: 0363406 +Node: 02366706 +Node: 02266940 +Node: 02167220 +Node: 0267425 +Node: 0171503 +Node: Notes71604 +Node: Comparison with Org Agenda searches71766 +Node: org-sidebar72655 +Node: License72934  End Tag Table From 529e05851bada55d8e6a8b7a11751bf104e37cea Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 3 Jan 2024 18:32:02 -0600 Subject: [PATCH 073/145] Fix: (org-ql-view--format-element) Avoid unlinkifying links I don't fully understand why this is the correct fix, because I don't know where the raw heading text is being linkified (it seems like the :raw-value property should be the unlinkified text), but this seems to work correctly now. If it turns out to break something else, we'll find out and fix it. Fixes #282. Reported-by: Jacob Boxerman --- README.org | 1 + org-ql-view.el | 3 +- org-ql.info | 74 ++++++++++++++++++++++++++------------------------ 3 files changed, 41 insertions(+), 37 deletions(-) diff --git a/README.org b/README.org index 178ca4f..129cb25 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: *Fixes* + Command ~org-ql-find~ widens the buffer before going to the selected entry. ++ In ~org-ql-view~ buffers, links in headings remain clickable links. (Fixes [[https://github.com/alphapapa/org-ql/issues/282][#282]]. Thanks to [[https://github.com/jakebox][Jacob Boxerman]] for reporting.) ** 0.8 diff --git a/org-ql-view.el b/org-ql-view.el index 5d452de..4d3c8c3 100644 --- a/org-ql-view.el +++ b/org-ql-view.el @@ -869,8 +869,7 @@ return an empty string." ;; Adding the relative due date property should probably be done explicitly and separately ;; (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) - (org-link-display-format it))) + (org-element-property :raw-value it))) (todo-keyword (-some--> (org-element-property :todo-keyword element) (org-ql-view--add-todo-face it))) (tag-list (if org-use-tag-inheritance diff --git a/org-ql.info b/org-ql.info index 630d120..f3a72a1 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1072,6 +1072,10 @@ File: README.info, Node: 081-pre, Next: 08, Up: Changelog • Command ‘org-ql-find’ widens the buffer before going to the selected entry. + • In ‘org-ql-view’ buffers, links in headings remain clickable links. + (Fixes #282 (https://github.com/alphapapa/org-ql/issues/282). + Thanks to Jacob Boxerman (https://github.com/jakebox) for + reporting.)  File: README.info, Node: 08, Next: 074, Prev: 081-pre, Up: Changelog @@ -1919,41 +1923,41 @@ Node: Links38827 Node: Tips39514 Node: Changelog39838 Node: 081-pre40676 -Node: 0840871 -Node: 07443599 -Node: 07343822 -Node: 07244554 -Node: 07145473 -Node: 0746282 -Node: 06349206 -Node: 06249737 -Node: 06150042 -Node: 0650612 -Node: 05253668 -Node: 05153970 -Node: 0554395 -Node: 04955926 -Node: 04856208 -Node: 04756557 -Node: 04656966 -Node: 04557374 -Node: 04457735 -Node: 04358094 -Node: 04258297 -Node: 04158458 -Node: 0458705 -Node: 03262806 -Node: 03163209 -Node: 0363406 -Node: 02366706 -Node: 02266940 -Node: 02167220 -Node: 0267425 -Node: 0171503 -Node: Notes71604 -Node: Comparison with Org Agenda searches71766 -Node: org-sidebar72655 -Node: License72934 +Node: 0841097 +Node: 07443825 +Node: 07344048 +Node: 07244780 +Node: 07145699 +Node: 0746508 +Node: 06349432 +Node: 06249963 +Node: 06150268 +Node: 0650838 +Node: 05253894 +Node: 05154196 +Node: 0554621 +Node: 04956152 +Node: 04856434 +Node: 04756783 +Node: 04657192 +Node: 04557600 +Node: 04457961 +Node: 04358320 +Node: 04258523 +Node: 04158684 +Node: 0458931 +Node: 03263032 +Node: 03163435 +Node: 0363632 +Node: 02366932 +Node: 02267166 +Node: 02167446 +Node: 0267651 +Node: 0171729 +Node: Notes71830 +Node: Comparison with Org Agenda searches71992 +Node: org-sidebar72881 +Node: License73160  End Tag Table From 393f88e7f376bd24a70a52ed520218cefba6b5bc Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Mon, 1 Jan 2024 23:35:38 +0000 Subject: [PATCH 074/145] Remove mentions of removed functions from v0.7 subheading in Changelog. These commands were removed in 5768c685adc7c6e85c17cfec358aa8a0e368310b, but they were still mentioned in the release that was going to incorporate those two functions, v0.7. This commit removes the mention of those two functions from the v0.7 subheading in the changelog. Note that `org-ql-find-path` was re-introduced in v0.8, so it remains under that subheading as a separate addition. --- README.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.org b/README.org index 129cb25..2502101 100644 --- a/README.org +++ b/README.org @@ -611,7 +611,7 @@ Simple links may also be written manually in either sexp or non-sexp form, like: ** 0.7 *Added* -+ Commands ~org-ql-find~, ~org-ql-find-heading~, and ~org-ql-find-path~, which jump to entries selected using Emacs's built-in completion facilities and Org QL queries (like ~helm-org-ql~, but doesn't require Helm.). ++ Command ~org-ql-find~, which jumps to entries selected using Emacs's built-in completion facilities and Org QL queries (like ~helm-org-ql~, but doesn't require Helm.). + Command ~org-ql-refile~, which refiles the entry at point to one selected using Org QL completion. + Predicate ~rifle~, which matches an entry if each of the given arguments is found in either the entry's contents or its outline path. This provides very intuitive results, mimicing the behavior of [[https://github.com/alphapapa/org-rifle][=org-rifle=]]. In fact, the results are so useful that it's now the default predicate for plain-string query tokens. (It is also aliased to ~smart~, since it's so "smart," and not all users have used =org-rifle=.) + Option ~org-ql-default-predicate~, applied to plain-string query tokens (before, the ~regexp~ predicate was always used, but now it may be customized). From 51869fd7f968a8beaebf0dbaeaeaa08a21bb252a Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 3 Jan 2024 18:47:44 -0600 Subject: [PATCH 075/145] Release: v0.8.1 --- README.org | 2 +- org-ql.el | 2 +- org-ql.info | 159 ++++++++++++++++++++++++++-------------------------- 3 files changed, 81 insertions(+), 82 deletions(-) diff --git a/README.org b/README.org index 2502101..59235b6 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.1-pre +** 0.8.1 *Fixes* diff --git a/org-ql.el b/org-ql.el index 7134a48..3bed395 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.1-pre +;; Version: 0.8.1 ;; 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 f3a72a1..f55af54 100644 --- a/org-ql.info +++ b/org-ql.info @@ -72,7 +72,7 @@ Functions / Macros Changelog -* 0.8.1-pre: 081-pre. +* 0.8.1: 081. * 0.8: 08. * 0.7.4: 074. * 0.7.3: 073. @@ -1029,7 +1029,7 @@ releases. * Menu: -* 0.8.1-pre: 081-pre. +* 0.8.1: 081. * 0.8: 08. * 0.7.4: 074. * 0.7.3: 073. @@ -1063,10 +1063,10 @@ releases. * 0.1: 01.  -File: README.info, Node: 081-pre, Next: 08, Up: Changelog +File: README.info, Node: 081, Next: 08, Up: Changelog -5.1 0.8.1-pre -============= +5.1 0.8.1 +========= *Fixes* @@ -1078,7 +1078,7 @@ File: README.info, Node: 081-pre, Next: 08, Up: Changelog reporting.)  -File: README.info, Node: 08, Next: 074, Prev: 081-pre, Up: Changelog +File: README.info, Node: 08, Next: 074, Prev: 081, Up: Changelog 5.2 0.8 ======= @@ -1208,9 +1208,8 @@ File: README.info, Node: 07, Next: 063, Prev: 071, Up: Changelog ======= *Added* - • Commands ‘org-ql-find’, ‘org-ql-find-heading’, and - ‘org-ql-find-path’, which jump to entries selected using Emacs’s - built-in completion facilities and Org QL queries (like + • Command ‘org-ql-find’, which jumps to entries selected using + Emacs’s built-in completion facilities and Org QL queries (like ‘helm-org-ql’, but doesn’t require Helm.). • Command ‘org-ql-refile’, which refiles the entry at point to one selected using Org QL completion. @@ -1887,77 +1886,77 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1873 -Node: Screenshots1996 -Node: Installation2114 -Node: Quelpa2628 -Node: Helm support3156 -Node: Usage3559 -Node: Commands3957 -Node: org-ql-find4422 -Node: org-ql-open-link5330 -Node: org-ql-refile6185 -Node: org-ql-search6513 -Node: helm-org-ql8444 -Node: org-ql-view8822 -Node: org-ql-view-sidebar9352 -Node: org-ql-view-recent-items9732 -Node: org-ql-sparse-tree10228 -Node: Queries11028 -Node: Non-sexp query syntax12145 -Node: General predicates13904 -Node: Ancestor/descendant predicates20829 -Node: Date/time predicates21957 -Node: Functions / Macros25081 -Node: Agenda-like views25379 -Ref: Function org-ql-block25541 -Node: Listing / acting-on results26802 -Ref: Caching27010 -Ref: Function org-ql-select27923 -Ref: Function org-ql-query30349 -Ref: Macro org-ql (deprecated)32123 -Node: Custom predicates32438 -Ref: Macro org-ql-defpred32662 -Node: Dynamic block36103 -Node: Links38827 -Node: Tips39514 -Node: Changelog39838 -Node: 081-pre40676 -Node: 0841097 -Node: 07443825 -Node: 07344048 -Node: 07244780 -Node: 07145699 -Node: 0746508 -Node: 06349432 -Node: 06249963 -Node: 06150268 -Node: 0650838 -Node: 05253894 -Node: 05154196 -Node: 0554621 -Node: 04956152 -Node: 04856434 -Node: 04756783 -Node: 04657192 -Node: 04557600 -Node: 04457961 -Node: 04358320 -Node: 04258523 -Node: 04158684 -Node: 0458931 -Node: 03263032 -Node: 03163435 -Node: 0363632 -Node: 02366932 -Node: 02267166 -Node: 02167446 -Node: 0267651 -Node: 0171729 -Node: Notes71830 -Node: Comparison with Org Agenda searches71992 -Node: org-sidebar72881 -Node: License73160 +Node: Contents1865 +Node: Screenshots1988 +Node: Installation2106 +Node: Quelpa2620 +Node: Helm support3148 +Node: Usage3551 +Node: Commands3949 +Node: org-ql-find4414 +Node: org-ql-open-link5322 +Node: org-ql-refile6177 +Node: org-ql-search6505 +Node: helm-org-ql8436 +Node: org-ql-view8814 +Node: org-ql-view-sidebar9344 +Node: org-ql-view-recent-items9724 +Node: org-ql-sparse-tree10220 +Node: Queries11020 +Node: Non-sexp query syntax12137 +Node: General predicates13896 +Node: Ancestor/descendant predicates20821 +Node: Date/time predicates21949 +Node: Functions / Macros25073 +Node: Agenda-like views25371 +Ref: Function org-ql-block25533 +Node: Listing / acting-on results26794 +Ref: Caching27002 +Ref: Function org-ql-select27915 +Ref: Function org-ql-query30341 +Ref: Macro org-ql (deprecated)32115 +Node: Custom predicates32430 +Ref: Macro org-ql-defpred32654 +Node: Dynamic block36095 +Node: Links38819 +Node: Tips39506 +Node: Changelog39830 +Node: 08140660 +Node: 0841069 +Node: 07443793 +Node: 07344016 +Node: 07244748 +Node: 07145667 +Node: 0746476 +Node: 06349340 +Node: 06249871 +Node: 06150176 +Node: 0650746 +Node: 05253802 +Node: 05154104 +Node: 0554529 +Node: 04956060 +Node: 04856342 +Node: 04756691 +Node: 04657100 +Node: 04557508 +Node: 04457869 +Node: 04358228 +Node: 04258431 +Node: 04158592 +Node: 0458839 +Node: 03262940 +Node: 03163343 +Node: 0363540 +Node: 02366840 +Node: 02267074 +Node: 02167354 +Node: 0267559 +Node: 0171637 +Node: Notes71738 +Node: Comparison with Org Agenda searches71900 +Node: org-sidebar72789 +Node: License73068  End Tag Table From 8595139f5b3fa4fbf3c1b43629498525d83e686c Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Tue, 9 Jan 2024 02:22:38 -0600 Subject: [PATCH 076/145] Meta: v0.8.2-pre --- README.org | 4 + org-ql.el | 2 +- org-ql.info | 221 +++++++++++++++++++++++++++------------------------- 3 files changed, 121 insertions(+), 106 deletions(-) diff --git a/README.org b/README.org index 59235b6..5a7190f 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.2-pre + +Nothing new yet. + ** 0.8.1 *Fixes* diff --git a/org-ql.el b/org-ql.el index 3bed395..8611708 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.1 +;; Version: 0.8.2-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 f55af54..57c34a9 100644 --- a/org-ql.info +++ b/org-ql.info @@ -72,6 +72,7 @@ Functions / Macros Changelog +* 0.8.2-pre: 082-pre. * 0.8.1: 081. * 0.8: 08. * 0.7.4: 074. @@ -1029,6 +1030,7 @@ releases. * Menu: +* 0.8.2-pre: 082-pre. * 0.8.1: 081. * 0.8: 08. * 0.7.4: 074. @@ -1063,9 +1065,17 @@ releases. * 0.1: 01.  -File: README.info, Node: 081, Next: 08, Up: Changelog +File: README.info, Node: 082-pre, Next: 081, Up: Changelog -5.1 0.8.1 +5.1 0.8.2-pre +============= + +Nothing new yet. + + +File: README.info, Node: 081, Next: 08, Prev: 082-pre, Up: Changelog + +5.2 0.8.1 ========= *Fixes* @@ -1080,7 +1090,7 @@ File: README.info, Node: 081, Next: 08, Up: Changelog  File: README.info, Node: 08, Next: 074, Prev: 081, Up: Changelog -5.2 0.8 +5.3 0.8 ======= *Additions* @@ -1136,7 +1146,7 @@ File: README.info, Node: 08, Next: 074, Prev: 081, Up: Changelog  File: README.info, Node: 074, Next: 073, Prev: 08, Up: Changelog -5.3 0.7.4 +5.4 0.7.4 ========= *Fixes* @@ -1146,7 +1156,7 @@ File: README.info, Node: 074, Next: 073, Prev: 08, Up: Changelog  File: README.info, Node: 073, Next: 072, Prev: 074, Up: Changelog -5.4 0.7.3 +5.5 0.7.3 ========= *Fixes* @@ -1164,7 +1174,7 @@ File: README.info, Node: 073, Next: 072, Prev: 074, Up: Changelog  File: README.info, Node: 072, Next: 071, Prev: 073, Up: Changelog -5.5 0.7.2 +5.6 0.7.2 ========= *Fixes* @@ -1185,7 +1195,7 @@ File: README.info, Node: 072, Next: 071, Prev: 073, Up: Changelog  File: README.info, Node: 071, Next: 07, Prev: 072, Up: Changelog -5.6 0.7.1 +5.7 0.7.1 ========= *Fixes* @@ -1204,7 +1214,7 @@ File: README.info, Node: 071, Next: 07, Prev: 072, Up: Changelog  File: README.info, Node: 07, Next: 063, Prev: 071, Up: Changelog -5.7 0.7 +5.8 0.7 ======= *Added* @@ -1263,7 +1273,7 @@ File: README.info, Node: 07, Next: 063, Prev: 071, Up: Changelog  File: README.info, Node: 063, Next: 062, Prev: 07, Up: Changelog -5.8 0.6.3 +5.9 0.6.3 ========= *Fixed* @@ -1279,8 +1289,8 @@ File: README.info, Node: 063, Next: 062, Prev: 07, Up: Changelog  File: README.info, Node: 062, Next: 061, Prev: 063, Up: Changelog -5.9 0.6.2 -========= +5.10 0.6.2 +========== *Fixed* • ‘link’ predicate when used in an ‘or’’ed query. (#279 @@ -1290,7 +1300,7 @@ File: README.info, Node: 062, Next: 061, Prev: 063, Up: Changelog  File: README.info, Node: 061, Next: 06, Prev: 062, Up: Changelog -5.10 0.6.1 +5.11 0.6.1 ========== *Fixed* @@ -1308,7 +1318,7 @@ File: README.info, Node: 061, Next: 06, Prev: 062, Up: Changelog  File: README.info, Node: 06, Next: 052, Prev: 061, Up: Changelog -5.11 0.6 +5.12 0.6 ======== *Added* @@ -1375,7 +1385,7 @@ File: README.info, Node: 06, Next: 052, Prev: 061, Up: Changelog  File: README.info, Node: 052, Next: 051, Prev: 06, Up: Changelog -5.12 0.5.2 +5.13 0.5.2 ========== *Fixed* @@ -1386,7 +1396,7 @@ File: README.info, Node: 052, Next: 051, Prev: 06, Up: Changelog  File: README.info, Node: 051, Next: 05, Prev: 052, Up: Changelog -5.13 0.5.1 +5.14 0.5.1 ========== *Fixed* @@ -1399,7 +1409,7 @@ File: README.info, Node: 051, Next: 05, Prev: 052, Up: Changelog  File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog -5.14 0.5 +5.15 0.5 ======== *Added* @@ -1440,7 +1450,7 @@ File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog  File: README.info, Node: 049, Next: 048, Prev: 05, Up: Changelog -5.15 0.4.9 +5.16 0.4.9 ========== *Fixed* @@ -1451,7 +1461,7 @@ File: README.info, Node: 049, Next: 048, Prev: 05, Up: Changelog  File: README.info, Node: 048, Next: 047, Prev: 049, Up: Changelog -5.16 0.4.8 +5.17 0.4.8 ========== *Fixed* @@ -1463,7 +1473,7 @@ File: README.info, Node: 048, Next: 047, Prev: 049, Up: Changelog  File: README.info, Node: 047, Next: 046, Prev: 048, Up: Changelog -5.17 0.4.7 +5.18 0.4.7 ========== *Fixed* @@ -1476,7 +1486,7 @@ File: README.info, Node: 047, Next: 046, Prev: 048, Up: Changelog  File: README.info, Node: 046, Next: 045, Prev: 047, Up: Changelog -5.18 0.4.6 +5.19 0.4.6 ========== *Fixed* @@ -1489,7 +1499,7 @@ File: README.info, Node: 046, Next: 045, Prev: 047, Up: Changelog  File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog -5.19 0.4.5 +5.20 0.4.5 ========== *Fixed* @@ -1501,7 +1511,7 @@ File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog  File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog -5.20 0.4.4 +5.21 0.4.4 ========== *Fixed* @@ -1513,7 +1523,7 @@ File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog  File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog -5.21 0.4.3 +5.22 0.4.3 ========== *Fixed* @@ -1523,7 +1533,7 @@ File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog  File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog -5.22 0.4.2 +5.23 0.4.2 ========== *Fixed* @@ -1532,7 +1542,7 @@ File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog  File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog -5.23 0.4.1 +5.24 0.4.1 ========== *Fixed* @@ -1542,7 +1552,7 @@ File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog  File: README.info, Node: 04, Next: 032, Prev: 041, Up: Changelog -5.24 0.4 +5.25 0.4 ======== _Note:_ The next release, 0.5, may include changes which will require @@ -1623,7 +1633,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.25 0.3.2 +5.26 0.3.2 ========== *Fixed* @@ -1636,7 +1646,7 @@ File: README.info, Node: 032, Next: 031, Prev: 04, Up: Changelog  File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog -5.26 0.3.1 +5.27 0.3.1 ========== *Fixed* @@ -1646,7 +1656,7 @@ File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog  File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog -5.27 0.3 +5.28 0.3 ======== *Added* @@ -1714,7 +1724,7 @@ File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog  File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog -5.28 0.2.3 +5.29 0.2.3 ========== *Fixed* @@ -1724,7 +1734,7 @@ File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog  File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog -5.29 0.2.2 +5.30 0.2.2 ========== *Fixed* @@ -1735,7 +1745,7 @@ File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog  File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog -5.30 0.2.1 +5.31 0.2.1 ========== *Fixed* @@ -1745,7 +1755,7 @@ File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog  File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog -5.31 0.2 +5.32 0.2 ======== *Added* @@ -1828,7 +1838,7 @@ File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog  File: README.info, Node: 01, Prev: 02, Up: Changelog -5.32 0.1 +5.33 0.1 ======== First tagged release. @@ -1886,77 +1896,78 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1865 -Node: Screenshots1988 -Node: Installation2106 -Node: Quelpa2620 -Node: Helm support3148 -Node: Usage3551 -Node: Commands3949 -Node: org-ql-find4414 -Node: org-ql-open-link5322 -Node: org-ql-refile6177 -Node: org-ql-search6505 -Node: helm-org-ql8436 -Node: org-ql-view8814 -Node: org-ql-view-sidebar9344 -Node: org-ql-view-recent-items9724 -Node: org-ql-sparse-tree10220 -Node: Queries11020 -Node: Non-sexp query syntax12137 -Node: General predicates13896 -Node: Ancestor/descendant predicates20821 -Node: Date/time predicates21949 -Node: Functions / Macros25073 -Node: Agenda-like views25371 -Ref: Function org-ql-block25533 -Node: Listing / acting-on results26794 -Ref: Caching27002 -Ref: Function org-ql-select27915 -Ref: Function org-ql-query30341 -Ref: Macro org-ql (deprecated)32115 -Node: Custom predicates32430 -Ref: Macro org-ql-defpred32654 -Node: Dynamic block36095 -Node: Links38819 -Node: Tips39506 -Node: Changelog39830 -Node: 08140660 -Node: 0841069 -Node: 07443793 -Node: 07344016 -Node: 07244748 -Node: 07145667 -Node: 0746476 -Node: 06349340 -Node: 06249871 -Node: 06150176 -Node: 0650746 -Node: 05253802 -Node: 05154104 -Node: 0554529 -Node: 04956060 -Node: 04856342 -Node: 04756691 -Node: 04657100 -Node: 04557508 -Node: 04457869 -Node: 04358228 -Node: 04258431 -Node: 04158592 -Node: 0458839 -Node: 03262940 -Node: 03163343 -Node: 0363540 -Node: 02366840 -Node: 02267074 -Node: 02167354 -Node: 0267559 -Node: 0171637 -Node: Notes71738 -Node: Comparison with Org Agenda searches71900 -Node: org-sidebar72789 -Node: License73068 +Node: Contents1887 +Node: Screenshots2010 +Node: Installation2128 +Node: Quelpa2642 +Node: Helm support3170 +Node: Usage3573 +Node: Commands3971 +Node: org-ql-find4436 +Node: org-ql-open-link5344 +Node: org-ql-refile6199 +Node: org-ql-search6527 +Node: helm-org-ql8458 +Node: org-ql-view8836 +Node: org-ql-view-sidebar9366 +Node: org-ql-view-recent-items9746 +Node: org-ql-sparse-tree10242 +Node: Queries11042 +Node: Non-sexp query syntax12159 +Node: General predicates13918 +Node: Ancestor/descendant predicates20843 +Node: Date/time predicates21971 +Node: Functions / Macros25095 +Node: Agenda-like views25393 +Ref: Function org-ql-block25555 +Node: Listing / acting-on results26816 +Ref: Caching27024 +Ref: Function org-ql-select27937 +Ref: Function org-ql-query30363 +Ref: Macro org-ql (deprecated)32137 +Node: Custom predicates32452 +Ref: Macro org-ql-defpred32676 +Node: Dynamic block36117 +Node: Links38841 +Node: Tips39528 +Node: Changelog39852 +Node: 082-pre40704 +Node: 08140816 +Node: 0841241 +Node: 07443965 +Node: 07344188 +Node: 07244920 +Node: 07145839 +Node: 0746648 +Node: 06349512 +Node: 06250043 +Node: 06150350 +Node: 0650920 +Node: 05253976 +Node: 05154278 +Node: 0554703 +Node: 04956234 +Node: 04856516 +Node: 04756865 +Node: 04657274 +Node: 04557682 +Node: 04458043 +Node: 04358402 +Node: 04258605 +Node: 04158766 +Node: 0459013 +Node: 03263114 +Node: 03163517 +Node: 0363714 +Node: 02367014 +Node: 02267248 +Node: 02167528 +Node: 0267733 +Node: 0171811 +Node: Notes71912 +Node: Comparison with Org Agenda searches72074 +Node: org-sidebar72963 +Node: License73242  End Tag Table From 7ff6cc2ef71ac703c22834eae06550be68daa0f3 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Tue, 9 Jan 2024 02:23:55 -0600 Subject: [PATCH 077/145] Fix: (org-ql-find) Don't use org-with-point-at See . Reported-by: Bram Schoenmakers --- README.org | 4 ++- org-ql-find.el | 2 +- org-ql.info | 80 +++++++++++++++++++++++++++----------------------- 3 files changed, 47 insertions(+), 39 deletions(-) diff --git a/README.org b/README.org index 5a7190f..17249ec 100644 --- a/README.org +++ b/README.org @@ -555,7 +555,9 @@ Simple links may also be written manually in either sexp or non-sexp form, like: ** 0.8.2-pre -Nothing new yet. +*Fixes* + ++ Command ~org-ql-find~ incorrectly restored the buffer after jumping when not using indirect buffers. (See [[https://github.com/alphapapa/org-ql/issues/380#issuecomment-1881913025][#380]]. Thanks to [[https://github.com/bram85][Bram Schoenmakers]] for reporting.) ** 0.8.1 diff --git a/org-ql-find.el b/org-ql-find.el index fed9ade..3e517c6 100644 --- a/org-ql-find.el +++ b/org-ql-find.el @@ -77,7 +77,7 @@ single predicate)." :prompt prompt))) (set-buffer (marker-buffer marker)) (pop-to-buffer (current-buffer) org-ql-find-display-buffer-action) - (org-with-point-at marker + (without-restriction (run-hook-with-args 'org-ql-find-goto-hook)))) ;;;###autoload diff --git a/org-ql.info b/org-ql.info index 57c34a9..78a9c54 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1070,7 +1070,13 @@ File: README.info, Node: 082-pre, Next: 081, Up: Changelog 5.1 0.8.2-pre ============= -Nothing new yet. +*Fixes* + + • Command ‘org-ql-find’ incorrectly restored the buffer after jumping + when not using indirect buffers. (See #380 + (https://github.com/alphapapa/org-ql/issues/380#issuecomment-1881913025). + Thanks to Bram Schoenmakers (https://github.com/bram85) for + reporting.)  File: README.info, Node: 081, Next: 08, Prev: 082-pre, Up: Changelog @@ -1932,42 +1938,42 @@ Node: Links38841 Node: Tips39528 Node: Changelog39852 Node: 082-pre40704 -Node: 08140816 -Node: 0841241 -Node: 07443965 -Node: 07344188 -Node: 07244920 -Node: 07145839 -Node: 0746648 -Node: 06349512 -Node: 06250043 -Node: 06150350 -Node: 0650920 -Node: 05253976 -Node: 05154278 -Node: 0554703 -Node: 04956234 -Node: 04856516 -Node: 04756865 -Node: 04657274 -Node: 04557682 -Node: 04458043 -Node: 04358402 -Node: 04258605 -Node: 04158766 -Node: 0459013 -Node: 03263114 -Node: 03163517 -Node: 0363714 -Node: 02367014 -Node: 02267248 -Node: 02167528 -Node: 0267733 -Node: 0171811 -Node: Notes71912 -Node: Comparison with Org Agenda searches72074 -Node: org-sidebar72963 -Node: License73242 +Node: 08141097 +Node: 0841522 +Node: 07444246 +Node: 07344469 +Node: 07245201 +Node: 07146120 +Node: 0746929 +Node: 06349793 +Node: 06250324 +Node: 06150631 +Node: 0651201 +Node: 05254257 +Node: 05154559 +Node: 0554984 +Node: 04956515 +Node: 04856797 +Node: 04757146 +Node: 04657555 +Node: 04557963 +Node: 04458324 +Node: 04358683 +Node: 04258886 +Node: 04159047 +Node: 0459294 +Node: 03263395 +Node: 03163798 +Node: 0363995 +Node: 02367295 +Node: 02267529 +Node: 02167809 +Node: 0268014 +Node: 0172092 +Node: Notes72193 +Node: Comparison with Org Agenda searches72355 +Node: org-sidebar73244 +Node: License73523  End Tag Table From 3448e49d86695707737e9471cfac740afa8e6fc1 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Tue, 9 Jan 2024 02:27:11 -0600 Subject: [PATCH 078/145] Release: v0.8.2 --- README.org | 2 +- org-ql.el | 2 +- org-ql.info | 156 ++++++++++++++++++++++++++-------------------------- 3 files changed, 80 insertions(+), 80 deletions(-) diff --git a/README.org b/README.org index 17249ec..7fbb935 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.2-pre +** 0.8.2 *Fixes* diff --git a/org-ql.el b/org-ql.el index 8611708..349c3dd 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.2-pre +;; Version: 0.8.2 ;; 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 78a9c54..47fc78a 100644 --- a/org-ql.info +++ b/org-ql.info @@ -72,7 +72,7 @@ Functions / Macros Changelog -* 0.8.2-pre: 082-pre. +* 0.8.2: 082. * 0.8.1: 081. * 0.8: 08. * 0.7.4: 074. @@ -1030,7 +1030,7 @@ releases. * Menu: -* 0.8.2-pre: 082-pre. +* 0.8.2: 082. * 0.8.1: 081. * 0.8: 08. * 0.7.4: 074. @@ -1065,10 +1065,10 @@ releases. * 0.1: 01.  -File: README.info, Node: 082-pre, Next: 081, Up: Changelog +File: README.info, Node: 082, Next: 081, Up: Changelog -5.1 0.8.2-pre -============= +5.1 0.8.2 +========= *Fixes* @@ -1079,7 +1079,7 @@ File: README.info, Node: 082-pre, Next: 081, Up: Changelog reporting.)  -File: README.info, Node: 081, Next: 08, Prev: 082-pre, Up: Changelog +File: README.info, Node: 081, Next: 08, Prev: 082, Up: Changelog 5.2 0.8.1 ========= @@ -1902,78 +1902,78 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1887 -Node: Screenshots2010 -Node: Installation2128 -Node: Quelpa2642 -Node: Helm support3170 -Node: Usage3573 -Node: Commands3971 -Node: org-ql-find4436 -Node: org-ql-open-link5344 -Node: org-ql-refile6199 -Node: org-ql-search6527 -Node: helm-org-ql8458 -Node: org-ql-view8836 -Node: org-ql-view-sidebar9366 -Node: org-ql-view-recent-items9746 -Node: org-ql-sparse-tree10242 -Node: Queries11042 -Node: Non-sexp query syntax12159 -Node: General predicates13918 -Node: Ancestor/descendant predicates20843 -Node: Date/time predicates21971 -Node: Functions / Macros25095 -Node: Agenda-like views25393 -Ref: Function org-ql-block25555 -Node: Listing / acting-on results26816 -Ref: Caching27024 -Ref: Function org-ql-select27937 -Ref: Function org-ql-query30363 -Ref: Macro org-ql (deprecated)32137 -Node: Custom predicates32452 -Ref: Macro org-ql-defpred32676 -Node: Dynamic block36117 -Node: Links38841 -Node: Tips39528 -Node: Changelog39852 -Node: 082-pre40704 -Node: 08141097 -Node: 0841522 -Node: 07444246 -Node: 07344469 -Node: 07245201 -Node: 07146120 -Node: 0746929 -Node: 06349793 -Node: 06250324 -Node: 06150631 -Node: 0651201 -Node: 05254257 -Node: 05154559 -Node: 0554984 -Node: 04956515 -Node: 04856797 -Node: 04757146 -Node: 04657555 -Node: 04557963 -Node: 04458324 -Node: 04358683 -Node: 04258886 -Node: 04159047 -Node: 0459294 -Node: 03263395 -Node: 03163798 -Node: 0363995 -Node: 02367295 -Node: 02267529 -Node: 02167809 -Node: 0268014 -Node: 0172092 -Node: Notes72193 -Node: Comparison with Org Agenda searches72355 -Node: org-sidebar73244 -Node: License73523 +Node: Contents1879 +Node: Screenshots2002 +Node: Installation2120 +Node: Quelpa2634 +Node: Helm support3162 +Node: Usage3565 +Node: Commands3963 +Node: org-ql-find4428 +Node: org-ql-open-link5336 +Node: org-ql-refile6191 +Node: org-ql-search6519 +Node: helm-org-ql8450 +Node: org-ql-view8828 +Node: org-ql-view-sidebar9358 +Node: org-ql-view-recent-items9738 +Node: org-ql-sparse-tree10234 +Node: Queries11034 +Node: Non-sexp query syntax12151 +Node: General predicates13910 +Node: Ancestor/descendant predicates20835 +Node: Date/time predicates21963 +Node: Functions / Macros25087 +Node: Agenda-like views25385 +Ref: Function org-ql-block25547 +Node: Listing / acting-on results26808 +Ref: Caching27016 +Ref: Function org-ql-select27929 +Ref: Function org-ql-query30355 +Ref: Macro org-ql (deprecated)32129 +Node: Custom predicates32444 +Ref: Macro org-ql-defpred32668 +Node: Dynamic block36109 +Node: Links38833 +Node: Tips39520 +Node: Changelog39844 +Node: 08240688 +Node: 08141069 +Node: 0841490 +Node: 07444214 +Node: 07344437 +Node: 07245169 +Node: 07146088 +Node: 0746897 +Node: 06349761 +Node: 06250292 +Node: 06150599 +Node: 0651169 +Node: 05254225 +Node: 05154527 +Node: 0554952 +Node: 04956483 +Node: 04856765 +Node: 04757114 +Node: 04657523 +Node: 04557931 +Node: 04458292 +Node: 04358651 +Node: 04258854 +Node: 04159015 +Node: 0459262 +Node: 03263363 +Node: 03163766 +Node: 0363963 +Node: 02367263 +Node: 02267497 +Node: 02167777 +Node: 0267982 +Node: 0172060 +Node: Notes72161 +Node: Comparison with Org Agenda searches72323 +Node: org-sidebar73212 +Node: License73491  End Tag Table From 694739b31dcd17f0118365945d69a80e8fdb2fe4 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 10 Jan 2024 01:38:15 -0600 Subject: [PATCH 079/145] Meta: v0.8.3-pre --- README.org | 4 + org-ql.el | 2 +- org-ql.info | 225 +++++++++++++++++++++++++++------------------------- 3 files changed, 123 insertions(+), 108 deletions(-) diff --git a/README.org b/README.org index 7fbb935..c485caa 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.3-pre + +Nothing new yet. + ** 0.8.2 *Fixes* diff --git a/org-ql.el b/org-ql.el index 349c3dd..98d0423 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.2 +;; Version: 0.8.3-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 47fc78a..e10accc 100644 --- a/org-ql.info +++ b/org-ql.info @@ -72,6 +72,7 @@ Functions / Macros Changelog +* 0.8.3-pre: 083-pre. * 0.8.2: 082. * 0.8.1: 081. * 0.8: 08. @@ -1030,6 +1031,7 @@ releases. * Menu: +* 0.8.3-pre: 083-pre. * 0.8.2: 082. * 0.8.1: 081. * 0.8: 08. @@ -1065,9 +1067,17 @@ releases. * 0.1: 01.  -File: README.info, Node: 082, Next: 081, Up: Changelog +File: README.info, Node: 083-pre, Next: 082, Up: Changelog -5.1 0.8.2 +5.1 0.8.3-pre +============= + +Nothing new yet. + + +File: README.info, Node: 082, Next: 081, Prev: 083-pre, Up: Changelog + +5.2 0.8.2 ========= *Fixes* @@ -1081,7 +1091,7 @@ File: README.info, Node: 082, Next: 081, Up: Changelog  File: README.info, Node: 081, Next: 08, Prev: 082, Up: Changelog -5.2 0.8.1 +5.3 0.8.1 ========= *Fixes* @@ -1096,7 +1106,7 @@ File: README.info, Node: 081, Next: 08, Prev: 082, Up: Changelog  File: README.info, Node: 08, Next: 074, Prev: 081, Up: Changelog -5.3 0.8 +5.4 0.8 ======= *Additions* @@ -1152,7 +1162,7 @@ File: README.info, Node: 08, Next: 074, Prev: 081, Up: Changelog  File: README.info, Node: 074, Next: 073, Prev: 08, Up: Changelog -5.4 0.7.4 +5.5 0.7.4 ========= *Fixes* @@ -1162,7 +1172,7 @@ File: README.info, Node: 074, Next: 073, Prev: 08, Up: Changelog  File: README.info, Node: 073, Next: 072, Prev: 074, Up: Changelog -5.5 0.7.3 +5.6 0.7.3 ========= *Fixes* @@ -1180,7 +1190,7 @@ File: README.info, Node: 073, Next: 072, Prev: 074, Up: Changelog  File: README.info, Node: 072, Next: 071, Prev: 073, Up: Changelog -5.6 0.7.2 +5.7 0.7.2 ========= *Fixes* @@ -1201,7 +1211,7 @@ File: README.info, Node: 072, Next: 071, Prev: 073, Up: Changelog  File: README.info, Node: 071, Next: 07, Prev: 072, Up: Changelog -5.7 0.7.1 +5.8 0.7.1 ========= *Fixes* @@ -1220,7 +1230,7 @@ File: README.info, Node: 071, Next: 07, Prev: 072, Up: Changelog  File: README.info, Node: 07, Next: 063, Prev: 071, Up: Changelog -5.8 0.7 +5.9 0.7 ======= *Added* @@ -1279,8 +1289,8 @@ File: README.info, Node: 07, Next: 063, Prev: 071, Up: Changelog  File: README.info, Node: 063, Next: 062, Prev: 07, Up: Changelog -5.9 0.6.3 -========= +5.10 0.6.3 +========== *Fixed* • Non-sexp query parsing with updated version 1.0.1 of the ‘peg’ @@ -1295,7 +1305,7 @@ File: README.info, Node: 063, Next: 062, Prev: 07, Up: Changelog  File: README.info, Node: 062, Next: 061, Prev: 063, Up: Changelog -5.10 0.6.2 +5.11 0.6.2 ========== *Fixed* @@ -1306,7 +1316,7 @@ File: README.info, Node: 062, Next: 061, Prev: 063, Up: Changelog  File: README.info, Node: 061, Next: 06, Prev: 062, Up: Changelog -5.11 0.6.1 +5.12 0.6.1 ========== *Fixed* @@ -1324,7 +1334,7 @@ File: README.info, Node: 061, Next: 06, Prev: 062, Up: Changelog  File: README.info, Node: 06, Next: 052, Prev: 061, Up: Changelog -5.12 0.6 +5.13 0.6 ======== *Added* @@ -1391,7 +1401,7 @@ File: README.info, Node: 06, Next: 052, Prev: 061, Up: Changelog  File: README.info, Node: 052, Next: 051, Prev: 06, Up: Changelog -5.13 0.5.2 +5.14 0.5.2 ========== *Fixed* @@ -1402,7 +1412,7 @@ File: README.info, Node: 052, Next: 051, Prev: 06, Up: Changelog  File: README.info, Node: 051, Next: 05, Prev: 052, Up: Changelog -5.14 0.5.1 +5.15 0.5.1 ========== *Fixed* @@ -1415,7 +1425,7 @@ File: README.info, Node: 051, Next: 05, Prev: 052, Up: Changelog  File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog -5.15 0.5 +5.16 0.5 ======== *Added* @@ -1456,7 +1466,7 @@ File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog  File: README.info, Node: 049, Next: 048, Prev: 05, Up: Changelog -5.16 0.4.9 +5.17 0.4.9 ========== *Fixed* @@ -1467,7 +1477,7 @@ File: README.info, Node: 049, Next: 048, Prev: 05, Up: Changelog  File: README.info, Node: 048, Next: 047, Prev: 049, Up: Changelog -5.17 0.4.8 +5.18 0.4.8 ========== *Fixed* @@ -1479,7 +1489,7 @@ File: README.info, Node: 048, Next: 047, Prev: 049, Up: Changelog  File: README.info, Node: 047, Next: 046, Prev: 048, Up: Changelog -5.18 0.4.7 +5.19 0.4.7 ========== *Fixed* @@ -1492,7 +1502,7 @@ File: README.info, Node: 047, Next: 046, Prev: 048, Up: Changelog  File: README.info, Node: 046, Next: 045, Prev: 047, Up: Changelog -5.19 0.4.6 +5.20 0.4.6 ========== *Fixed* @@ -1505,7 +1515,7 @@ File: README.info, Node: 046, Next: 045, Prev: 047, Up: Changelog  File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog -5.20 0.4.5 +5.21 0.4.5 ========== *Fixed* @@ -1517,7 +1527,7 @@ File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog  File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog -5.21 0.4.4 +5.22 0.4.4 ========== *Fixed* @@ -1529,7 +1539,7 @@ File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog  File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog -5.22 0.4.3 +5.23 0.4.3 ========== *Fixed* @@ -1539,7 +1549,7 @@ File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog  File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog -5.23 0.4.2 +5.24 0.4.2 ========== *Fixed* @@ -1548,7 +1558,7 @@ File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog  File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog -5.24 0.4.1 +5.25 0.4.1 ========== *Fixed* @@ -1558,7 +1568,7 @@ File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog  File: README.info, Node: 04, Next: 032, Prev: 041, Up: Changelog -5.25 0.4 +5.26 0.4 ======== _Note:_ The next release, 0.5, may include changes which will require @@ -1639,7 +1649,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.26 0.3.2 +5.27 0.3.2 ========== *Fixed* @@ -1652,7 +1662,7 @@ File: README.info, Node: 032, Next: 031, Prev: 04, Up: Changelog  File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog -5.27 0.3.1 +5.28 0.3.1 ========== *Fixed* @@ -1662,7 +1672,7 @@ File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog  File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog -5.28 0.3 +5.29 0.3 ======== *Added* @@ -1730,7 +1740,7 @@ File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog  File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog -5.29 0.2.3 +5.30 0.2.3 ========== *Fixed* @@ -1740,7 +1750,7 @@ File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog  File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog -5.30 0.2.2 +5.31 0.2.2 ========== *Fixed* @@ -1751,7 +1761,7 @@ File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog  File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog -5.31 0.2.1 +5.32 0.2.1 ========== *Fixed* @@ -1761,7 +1771,7 @@ File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog  File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog -5.32 0.2 +5.33 0.2 ======== *Added* @@ -1844,7 +1854,7 @@ File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog  File: README.info, Node: 01, Prev: 02, Up: Changelog -5.33 0.1 +5.34 0.1 ======== First tagged release. @@ -1902,78 +1912,79 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1879 -Node: Screenshots2002 -Node: Installation2120 -Node: Quelpa2634 -Node: Helm support3162 -Node: Usage3565 -Node: Commands3963 -Node: org-ql-find4428 -Node: org-ql-open-link5336 -Node: org-ql-refile6191 -Node: org-ql-search6519 -Node: helm-org-ql8450 -Node: org-ql-view8828 -Node: org-ql-view-sidebar9358 -Node: org-ql-view-recent-items9738 -Node: org-ql-sparse-tree10234 -Node: Queries11034 -Node: Non-sexp query syntax12151 -Node: General predicates13910 -Node: Ancestor/descendant predicates20835 -Node: Date/time predicates21963 -Node: Functions / Macros25087 -Node: Agenda-like views25385 -Ref: Function org-ql-block25547 -Node: Listing / acting-on results26808 -Ref: Caching27016 -Ref: Function org-ql-select27929 -Ref: Function org-ql-query30355 -Ref: Macro org-ql (deprecated)32129 -Node: Custom predicates32444 -Ref: Macro org-ql-defpred32668 -Node: Dynamic block36109 -Node: Links38833 -Node: Tips39520 -Node: Changelog39844 -Node: 08240688 -Node: 08141069 -Node: 0841490 -Node: 07444214 -Node: 07344437 -Node: 07245169 -Node: 07146088 -Node: 0746897 -Node: 06349761 -Node: 06250292 -Node: 06150599 -Node: 0651169 -Node: 05254225 -Node: 05154527 -Node: 0554952 -Node: 04956483 -Node: 04856765 -Node: 04757114 -Node: 04657523 -Node: 04557931 -Node: 04458292 -Node: 04358651 -Node: 04258854 -Node: 04159015 -Node: 0459262 -Node: 03263363 -Node: 03163766 -Node: 0363963 -Node: 02367263 -Node: 02267497 -Node: 02167777 -Node: 0267982 -Node: 0172060 -Node: Notes72161 -Node: Comparison with Org Agenda searches72323 -Node: org-sidebar73212 -Node: License73491 +Node: Contents1901 +Node: Screenshots2024 +Node: Installation2142 +Node: Quelpa2656 +Node: Helm support3184 +Node: Usage3587 +Node: Commands3985 +Node: org-ql-find4450 +Node: org-ql-open-link5358 +Node: org-ql-refile6213 +Node: org-ql-search6541 +Node: helm-org-ql8472 +Node: org-ql-view8850 +Node: org-ql-view-sidebar9380 +Node: org-ql-view-recent-items9760 +Node: org-ql-sparse-tree10256 +Node: Queries11056 +Node: Non-sexp query syntax12173 +Node: General predicates13932 +Node: Ancestor/descendant predicates20857 +Node: Date/time predicates21985 +Node: Functions / Macros25109 +Node: Agenda-like views25407 +Ref: Function org-ql-block25569 +Node: Listing / acting-on results26830 +Ref: Caching27038 +Ref: Function org-ql-select27951 +Ref: Function org-ql-query30377 +Ref: Macro org-ql (deprecated)32151 +Node: Custom predicates32466 +Ref: Macro org-ql-defpred32690 +Node: Dynamic block36131 +Node: Links38855 +Node: Tips39542 +Node: Changelog39866 +Node: 083-pre40732 +Node: 08240844 +Node: 08141241 +Node: 0841662 +Node: 07444386 +Node: 07344609 +Node: 07245341 +Node: 07146260 +Node: 0747069 +Node: 06349933 +Node: 06250466 +Node: 06150773 +Node: 0651343 +Node: 05254399 +Node: 05154701 +Node: 0555126 +Node: 04956657 +Node: 04856939 +Node: 04757288 +Node: 04657697 +Node: 04558105 +Node: 04458466 +Node: 04358825 +Node: 04259028 +Node: 04159189 +Node: 0459436 +Node: 03263537 +Node: 03163940 +Node: 0364137 +Node: 02367437 +Node: 02267671 +Node: 02167951 +Node: 0268156 +Node: 0172234 +Node: Notes72335 +Node: Comparison with Org Agenda searches72497 +Node: org-sidebar73386 +Node: License73665  End Tag Table From 0b1e4b43ec522aaedeac4abf8858b8b3b86753e6 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 10 Jan 2024 01:55:16 -0600 Subject: [PATCH 080/145] Fix: (org-ql-find) Moving point and widening buffer as needed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See #380. Reported-by: Omar Antolín Camarena --- README.org | 4 ++- org-ql-find.el | 15 +++++++++- org-ql.info | 81 +++++++++++++++++++++++++++----------------------- 3 files changed, 60 insertions(+), 40 deletions(-) diff --git a/README.org b/README.org index c485caa..52740c7 100644 --- a/README.org +++ b/README.org @@ -555,7 +555,9 @@ Simple links may also be written manually in either sexp or non-sexp form, like: ** 0.8.3-pre -Nothing new yet. +*Fixes* + ++ Command ~org-ql-find~ incorrectly moved point. (See [[https://github.com/alphapapa/org-ql/issues/380#issuecomment-1881913025][#380]]. Thanks to [[https://github.com/oantolin][Omar Antolín Camarena]] for reporting.) ** 0.8.2 diff --git a/org-ql-find.el b/org-ql-find.el index 3e517c6..591e958 100644 --- a/org-ql-find.el +++ b/org-ql-find.el @@ -78,7 +78,20 @@ single predicate)." (set-buffer (marker-buffer marker)) (pop-to-buffer (current-buffer) org-ql-find-display-buffer-action) (without-restriction - (run-hook-with-args 'org-ql-find-goto-hook)))) + (goto-char marker) + (run-hook-with-args 'org-ql-find-goto-hook)) + (when (equal (current-buffer) (marker-buffer marker)) + ;; Ensure point is still within visible portion of buffer. (If + ;; `org-tree-to-indirect-buffer' is used in `org-ql-find-goto-hook', + ;; the buffer will have been changed and it won't matter; otherwise, + ;; the buffer could have been narrowed to a region excluding the + ;; selected entry.) + (let ((end-of-subtree (org-with-point-at marker + (org-end-of-subtree 'invisible-ok)))) + (unless (and (<= (point-min) marker) + (>= (point-max) end-of-subtree)) + (widen) + (goto-char marker)))))) ;;;###autoload (defun org-ql-refile (marker) diff --git a/org-ql.info b/org-ql.info index e10accc..174bbb1 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1072,7 +1072,12 @@ File: README.info, Node: 083-pre, Next: 082, Up: Changelog 5.1 0.8.3-pre ============= -Nothing new yet. +*Fixes* + + • Command ‘org-ql-find’ incorrectly moved point. (See #380 + (https://github.com/alphapapa/org-ql/issues/380#issuecomment-1881913025). + Thanks to Omar Antolín Camarena (https://github.com/oantolin) for + reporting.)  File: README.info, Node: 082, Next: 081, Prev: 083-pre, Up: Changelog @@ -1948,43 +1953,43 @@ Node: Links38855 Node: Tips39542 Node: Changelog39866 Node: 083-pre40732 -Node: 08240844 -Node: 08141241 -Node: 0841662 -Node: 07444386 -Node: 07344609 -Node: 07245341 -Node: 07146260 -Node: 0747069 -Node: 06349933 -Node: 06250466 -Node: 06150773 -Node: 0651343 -Node: 05254399 -Node: 05154701 -Node: 0555126 -Node: 04956657 -Node: 04856939 -Node: 04757288 -Node: 04657697 -Node: 04558105 -Node: 04458466 -Node: 04358825 -Node: 04259028 -Node: 04159189 -Node: 0459436 -Node: 03263537 -Node: 03163940 -Node: 0364137 -Node: 02367437 -Node: 02267671 -Node: 02167951 -Node: 0268156 -Node: 0172234 -Node: Notes72335 -Node: Comparison with Org Agenda searches72497 -Node: org-sidebar73386 -Node: License73665 +Node: 08241073 +Node: 08141470 +Node: 0841891 +Node: 07444615 +Node: 07344838 +Node: 07245570 +Node: 07146489 +Node: 0747298 +Node: 06350162 +Node: 06250695 +Node: 06151002 +Node: 0651572 +Node: 05254628 +Node: 05154930 +Node: 0555355 +Node: 04956886 +Node: 04857168 +Node: 04757517 +Node: 04657926 +Node: 04558334 +Node: 04458695 +Node: 04359054 +Node: 04259257 +Node: 04159418 +Node: 0459665 +Node: 03263766 +Node: 03164169 +Node: 0364366 +Node: 02367666 +Node: 02267900 +Node: 02168180 +Node: 0268385 +Node: 0172463 +Node: Notes72564 +Node: Comparison with Org Agenda searches72726 +Node: org-sidebar73615 +Node: License73894  End Tag Table From 7d8bd8b8847e4cf7a9fa04c7d4a4cbb2ae223e46 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 10 Jan 2024 01:56:00 -0600 Subject: [PATCH 081/145] Release: v0.8.3 --- README.org | 2 +- org-ql.el | 2 +- org-ql.info | 158 ++++++++++++++++++++++++++-------------------------- 3 files changed, 81 insertions(+), 81 deletions(-) diff --git a/README.org b/README.org index 52740c7..88daaf5 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.3-pre +** 0.8.3 *Fixes* diff --git a/org-ql.el b/org-ql.el index 98d0423..394cdcb 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.3-pre +;; Version: 0.8.3 ;; 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 174bbb1..aa16159 100644 --- a/org-ql.info +++ b/org-ql.info @@ -72,7 +72,7 @@ Functions / Macros Changelog -* 0.8.3-pre: 083-pre. +* 0.8.3: 083. * 0.8.2: 082. * 0.8.1: 081. * 0.8: 08. @@ -1031,7 +1031,7 @@ releases. * Menu: -* 0.8.3-pre: 083-pre. +* 0.8.3: 083. * 0.8.2: 082. * 0.8.1: 081. * 0.8: 08. @@ -1067,10 +1067,10 @@ releases. * 0.1: 01.  -File: README.info, Node: 083-pre, Next: 082, Up: Changelog +File: README.info, Node: 083, Next: 082, Up: Changelog -5.1 0.8.3-pre -============= +5.1 0.8.3 +========= *Fixes* @@ -1080,7 +1080,7 @@ File: README.info, Node: 083-pre, Next: 082, Up: Changelog reporting.)  -File: README.info, Node: 082, Next: 081, Prev: 083-pre, Up: Changelog +File: README.info, Node: 082, Next: 081, Prev: 083, Up: Changelog 5.2 0.8.2 ========= @@ -1917,79 +1917,79 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1901 -Node: Screenshots2024 -Node: Installation2142 -Node: Quelpa2656 -Node: Helm support3184 -Node: Usage3587 -Node: Commands3985 -Node: org-ql-find4450 -Node: org-ql-open-link5358 -Node: org-ql-refile6213 -Node: org-ql-search6541 -Node: helm-org-ql8472 -Node: org-ql-view8850 -Node: org-ql-view-sidebar9380 -Node: org-ql-view-recent-items9760 -Node: org-ql-sparse-tree10256 -Node: Queries11056 -Node: Non-sexp query syntax12173 -Node: General predicates13932 -Node: Ancestor/descendant predicates20857 -Node: Date/time predicates21985 -Node: Functions / Macros25109 -Node: Agenda-like views25407 -Ref: Function org-ql-block25569 -Node: Listing / acting-on results26830 -Ref: Caching27038 -Ref: Function org-ql-select27951 -Ref: Function org-ql-query30377 -Ref: Macro org-ql (deprecated)32151 -Node: Custom predicates32466 -Ref: Macro org-ql-defpred32690 -Node: Dynamic block36131 -Node: Links38855 -Node: Tips39542 -Node: Changelog39866 -Node: 083-pre40732 -Node: 08241073 -Node: 08141470 -Node: 0841891 -Node: 07444615 -Node: 07344838 -Node: 07245570 -Node: 07146489 -Node: 0747298 -Node: 06350162 -Node: 06250695 -Node: 06151002 -Node: 0651572 -Node: 05254628 -Node: 05154930 -Node: 0555355 -Node: 04956886 -Node: 04857168 -Node: 04757517 -Node: 04657926 -Node: 04558334 -Node: 04458695 -Node: 04359054 -Node: 04259257 -Node: 04159418 -Node: 0459665 -Node: 03263766 -Node: 03164169 -Node: 0364366 -Node: 02367666 -Node: 02267900 -Node: 02168180 -Node: 0268385 -Node: 0172463 -Node: Notes72564 -Node: Comparison with Org Agenda searches72726 -Node: org-sidebar73615 -Node: License73894 +Node: Contents1893 +Node: Screenshots2016 +Node: Installation2134 +Node: Quelpa2648 +Node: Helm support3176 +Node: Usage3579 +Node: Commands3977 +Node: org-ql-find4442 +Node: org-ql-open-link5350 +Node: org-ql-refile6205 +Node: org-ql-search6533 +Node: helm-org-ql8464 +Node: org-ql-view8842 +Node: org-ql-view-sidebar9372 +Node: org-ql-view-recent-items9752 +Node: org-ql-sparse-tree10248 +Node: Queries11048 +Node: Non-sexp query syntax12165 +Node: General predicates13924 +Node: Ancestor/descendant predicates20849 +Node: Date/time predicates21977 +Node: Functions / Macros25101 +Node: Agenda-like views25399 +Ref: Function org-ql-block25561 +Node: Listing / acting-on results26822 +Ref: Caching27030 +Ref: Function org-ql-select27943 +Ref: Function org-ql-query30369 +Ref: Macro org-ql (deprecated)32143 +Node: Custom predicates32458 +Ref: Macro org-ql-defpred32682 +Node: Dynamic block36123 +Node: Links38847 +Node: Tips39534 +Node: Changelog39858 +Node: 08340716 +Node: 08241045 +Node: 08141438 +Node: 0841859 +Node: 07444583 +Node: 07344806 +Node: 07245538 +Node: 07146457 +Node: 0747266 +Node: 06350130 +Node: 06250663 +Node: 06150970 +Node: 0651540 +Node: 05254596 +Node: 05154898 +Node: 0555323 +Node: 04956854 +Node: 04857136 +Node: 04757485 +Node: 04657894 +Node: 04558302 +Node: 04458663 +Node: 04359022 +Node: 04259225 +Node: 04159386 +Node: 0459633 +Node: 03263734 +Node: 03164137 +Node: 0364334 +Node: 02367634 +Node: 02267868 +Node: 02168148 +Node: 0268353 +Node: 0172431 +Node: Notes72532 +Node: Comparison with Org Agenda searches72694 +Node: org-sidebar73583 +Node: License73862  End Tag Table From 0168171a14cb55adf31c80c9155eaa8ab7967be5 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Fri, 12 Jan 2024 23:58:41 -0600 Subject: [PATCH 082/145] Meta: v0.8.4-pre --- README.org | 4 + org-ql.el | 2 +- org-ql.info | 229 +++++++++++++++++++++++++++------------------------- 3 files changed, 125 insertions(+), 110 deletions(-) diff --git a/README.org b/README.org index 88daaf5..b8f2475 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.4-pre + +Nothing new yet. + ** 0.8.3 *Fixes* diff --git a/org-ql.el b/org-ql.el index 394cdcb..865c598 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.3 +;; Version: 0.8.4-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 aa16159..10249a2 100644 --- a/org-ql.info +++ b/org-ql.info @@ -72,6 +72,7 @@ Functions / Macros Changelog +* 0.8.4-pre: 084-pre. * 0.8.3: 083. * 0.8.2: 082. * 0.8.1: 081. @@ -1031,6 +1032,7 @@ releases. * Menu: +* 0.8.4-pre: 084-pre. * 0.8.3: 083. * 0.8.2: 082. * 0.8.1: 081. @@ -1067,9 +1069,17 @@ releases. * 0.1: 01.  -File: README.info, Node: 083, Next: 082, Up: Changelog +File: README.info, Node: 084-pre, Next: 083, Up: Changelog -5.1 0.8.3 +5.1 0.8.4-pre +============= + +Nothing new yet. + + +File: README.info, Node: 083, Next: 082, Prev: 084-pre, Up: Changelog + +5.2 0.8.3 ========= *Fixes* @@ -1082,7 +1092,7 @@ File: README.info, Node: 083, Next: 082, Up: Changelog  File: README.info, Node: 082, Next: 081, Prev: 083, Up: Changelog -5.2 0.8.2 +5.3 0.8.2 ========= *Fixes* @@ -1096,7 +1106,7 @@ File: README.info, Node: 082, Next: 081, Prev: 083, Up: Changelog  File: README.info, Node: 081, Next: 08, Prev: 082, Up: Changelog -5.3 0.8.1 +5.4 0.8.1 ========= *Fixes* @@ -1111,7 +1121,7 @@ File: README.info, Node: 081, Next: 08, Prev: 082, Up: Changelog  File: README.info, Node: 08, Next: 074, Prev: 081, Up: Changelog -5.4 0.8 +5.5 0.8 ======= *Additions* @@ -1167,7 +1177,7 @@ File: README.info, Node: 08, Next: 074, Prev: 081, Up: Changelog  File: README.info, Node: 074, Next: 073, Prev: 08, Up: Changelog -5.5 0.7.4 +5.6 0.7.4 ========= *Fixes* @@ -1177,7 +1187,7 @@ File: README.info, Node: 074, Next: 073, Prev: 08, Up: Changelog  File: README.info, Node: 073, Next: 072, Prev: 074, Up: Changelog -5.6 0.7.3 +5.7 0.7.3 ========= *Fixes* @@ -1195,7 +1205,7 @@ File: README.info, Node: 073, Next: 072, Prev: 074, Up: Changelog  File: README.info, Node: 072, Next: 071, Prev: 073, Up: Changelog -5.7 0.7.2 +5.8 0.7.2 ========= *Fixes* @@ -1216,7 +1226,7 @@ File: README.info, Node: 072, Next: 071, Prev: 073, Up: Changelog  File: README.info, Node: 071, Next: 07, Prev: 072, Up: Changelog -5.8 0.7.1 +5.9 0.7.1 ========= *Fixes* @@ -1235,8 +1245,8 @@ File: README.info, Node: 071, Next: 07, Prev: 072, Up: Changelog  File: README.info, Node: 07, Next: 063, Prev: 071, Up: Changelog -5.9 0.7 -======= +5.10 0.7 +======== *Added* • Command ‘org-ql-find’, which jumps to entries selected using @@ -1294,7 +1304,7 @@ File: README.info, Node: 07, Next: 063, Prev: 071, Up: Changelog  File: README.info, Node: 063, Next: 062, Prev: 07, Up: Changelog -5.10 0.6.3 +5.11 0.6.3 ========== *Fixed* @@ -1310,7 +1320,7 @@ File: README.info, Node: 063, Next: 062, Prev: 07, Up: Changelog  File: README.info, Node: 062, Next: 061, Prev: 063, Up: Changelog -5.11 0.6.2 +5.12 0.6.2 ========== *Fixed* @@ -1321,7 +1331,7 @@ File: README.info, Node: 062, Next: 061, Prev: 063, Up: Changelog  File: README.info, Node: 061, Next: 06, Prev: 062, Up: Changelog -5.12 0.6.1 +5.13 0.6.1 ========== *Fixed* @@ -1339,7 +1349,7 @@ File: README.info, Node: 061, Next: 06, Prev: 062, Up: Changelog  File: README.info, Node: 06, Next: 052, Prev: 061, Up: Changelog -5.13 0.6 +5.14 0.6 ======== *Added* @@ -1406,7 +1416,7 @@ File: README.info, Node: 06, Next: 052, Prev: 061, Up: Changelog  File: README.info, Node: 052, Next: 051, Prev: 06, Up: Changelog -5.14 0.5.2 +5.15 0.5.2 ========== *Fixed* @@ -1417,7 +1427,7 @@ File: README.info, Node: 052, Next: 051, Prev: 06, Up: Changelog  File: README.info, Node: 051, Next: 05, Prev: 052, Up: Changelog -5.15 0.5.1 +5.16 0.5.1 ========== *Fixed* @@ -1430,7 +1440,7 @@ File: README.info, Node: 051, Next: 05, Prev: 052, Up: Changelog  File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog -5.16 0.5 +5.17 0.5 ======== *Added* @@ -1471,7 +1481,7 @@ File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog  File: README.info, Node: 049, Next: 048, Prev: 05, Up: Changelog -5.17 0.4.9 +5.18 0.4.9 ========== *Fixed* @@ -1482,7 +1492,7 @@ File: README.info, Node: 049, Next: 048, Prev: 05, Up: Changelog  File: README.info, Node: 048, Next: 047, Prev: 049, Up: Changelog -5.18 0.4.8 +5.19 0.4.8 ========== *Fixed* @@ -1494,7 +1504,7 @@ File: README.info, Node: 048, Next: 047, Prev: 049, Up: Changelog  File: README.info, Node: 047, Next: 046, Prev: 048, Up: Changelog -5.19 0.4.7 +5.20 0.4.7 ========== *Fixed* @@ -1507,7 +1517,7 @@ File: README.info, Node: 047, Next: 046, Prev: 048, Up: Changelog  File: README.info, Node: 046, Next: 045, Prev: 047, Up: Changelog -5.20 0.4.6 +5.21 0.4.6 ========== *Fixed* @@ -1520,7 +1530,7 @@ File: README.info, Node: 046, Next: 045, Prev: 047, Up: Changelog  File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog -5.21 0.4.5 +5.22 0.4.5 ========== *Fixed* @@ -1532,7 +1542,7 @@ File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog  File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog -5.22 0.4.4 +5.23 0.4.4 ========== *Fixed* @@ -1544,7 +1554,7 @@ File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog  File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog -5.23 0.4.3 +5.24 0.4.3 ========== *Fixed* @@ -1554,7 +1564,7 @@ File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog  File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog -5.24 0.4.2 +5.25 0.4.2 ========== *Fixed* @@ -1563,7 +1573,7 @@ File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog  File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog -5.25 0.4.1 +5.26 0.4.1 ========== *Fixed* @@ -1573,7 +1583,7 @@ File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog  File: README.info, Node: 04, Next: 032, Prev: 041, Up: Changelog -5.26 0.4 +5.27 0.4 ======== _Note:_ The next release, 0.5, may include changes which will require @@ -1654,7 +1664,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.27 0.3.2 +5.28 0.3.2 ========== *Fixed* @@ -1667,7 +1677,7 @@ File: README.info, Node: 032, Next: 031, Prev: 04, Up: Changelog  File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog -5.28 0.3.1 +5.29 0.3.1 ========== *Fixed* @@ -1677,7 +1687,7 @@ File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog  File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog -5.29 0.3 +5.30 0.3 ======== *Added* @@ -1745,7 +1755,7 @@ File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog  File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog -5.30 0.2.3 +5.31 0.2.3 ========== *Fixed* @@ -1755,7 +1765,7 @@ File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog  File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog -5.31 0.2.2 +5.32 0.2.2 ========== *Fixed* @@ -1766,7 +1776,7 @@ File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog  File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog -5.32 0.2.1 +5.33 0.2.1 ========== *Fixed* @@ -1776,7 +1786,7 @@ File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog  File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog -5.33 0.2 +5.34 0.2 ======== *Added* @@ -1859,7 +1869,7 @@ File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog  File: README.info, Node: 01, Prev: 02, Up: Changelog -5.34 0.1 +5.35 0.1 ======== First tagged release. @@ -1917,79 +1927,80 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1893 -Node: Screenshots2016 -Node: Installation2134 -Node: Quelpa2648 -Node: Helm support3176 -Node: Usage3579 -Node: Commands3977 -Node: org-ql-find4442 -Node: org-ql-open-link5350 -Node: org-ql-refile6205 -Node: org-ql-search6533 -Node: helm-org-ql8464 -Node: org-ql-view8842 -Node: org-ql-view-sidebar9372 -Node: org-ql-view-recent-items9752 -Node: org-ql-sparse-tree10248 -Node: Queries11048 -Node: Non-sexp query syntax12165 -Node: General predicates13924 -Node: Ancestor/descendant predicates20849 -Node: Date/time predicates21977 -Node: Functions / Macros25101 -Node: Agenda-like views25399 -Ref: Function org-ql-block25561 -Node: Listing / acting-on results26822 -Ref: Caching27030 -Ref: Function org-ql-select27943 -Ref: Function org-ql-query30369 -Ref: Macro org-ql (deprecated)32143 -Node: Custom predicates32458 -Ref: Macro org-ql-defpred32682 -Node: Dynamic block36123 -Node: Links38847 -Node: Tips39534 -Node: Changelog39858 -Node: 08340716 -Node: 08241045 -Node: 08141438 -Node: 0841859 -Node: 07444583 -Node: 07344806 -Node: 07245538 -Node: 07146457 -Node: 0747266 -Node: 06350130 -Node: 06250663 -Node: 06150970 -Node: 0651540 -Node: 05254596 -Node: 05154898 -Node: 0555323 -Node: 04956854 -Node: 04857136 -Node: 04757485 -Node: 04657894 -Node: 04558302 -Node: 04458663 -Node: 04359022 -Node: 04259225 -Node: 04159386 -Node: 0459633 -Node: 03263734 -Node: 03164137 -Node: 0364334 -Node: 02367634 -Node: 02267868 -Node: 02168148 -Node: 0268353 -Node: 0172431 -Node: Notes72532 -Node: Comparison with Org Agenda searches72694 -Node: org-sidebar73583 -Node: License73862 +Node: Contents1915 +Node: Screenshots2038 +Node: Installation2156 +Node: Quelpa2670 +Node: Helm support3198 +Node: Usage3601 +Node: Commands3999 +Node: org-ql-find4464 +Node: org-ql-open-link5372 +Node: org-ql-refile6227 +Node: org-ql-search6555 +Node: helm-org-ql8486 +Node: org-ql-view8864 +Node: org-ql-view-sidebar9394 +Node: org-ql-view-recent-items9774 +Node: org-ql-sparse-tree10270 +Node: Queries11070 +Node: Non-sexp query syntax12187 +Node: General predicates13946 +Node: Ancestor/descendant predicates20871 +Node: Date/time predicates21999 +Node: Functions / Macros25123 +Node: Agenda-like views25421 +Ref: Function org-ql-block25583 +Node: Listing / acting-on results26844 +Ref: Caching27052 +Ref: Function org-ql-select27965 +Ref: Function org-ql-query30391 +Ref: Macro org-ql (deprecated)32165 +Node: Custom predicates32480 +Ref: Macro org-ql-defpred32704 +Node: Dynamic block36145 +Node: Links38869 +Node: Tips39556 +Node: Changelog39880 +Node: 084-pre40760 +Node: 08340872 +Node: 08241217 +Node: 08141610 +Node: 0842031 +Node: 07444755 +Node: 07344978 +Node: 07245710 +Node: 07146629 +Node: 0747438 +Node: 06350304 +Node: 06250837 +Node: 06151144 +Node: 0651714 +Node: 05254770 +Node: 05155072 +Node: 0555497 +Node: 04957028 +Node: 04857310 +Node: 04757659 +Node: 04658068 +Node: 04558476 +Node: 04458837 +Node: 04359196 +Node: 04259399 +Node: 04159560 +Node: 0459807 +Node: 03263908 +Node: 03164311 +Node: 0364508 +Node: 02367808 +Node: 02268042 +Node: 02168322 +Node: 0268527 +Node: 0172605 +Node: Notes72706 +Node: Comparison with Org Agenda searches72868 +Node: org-sidebar73757 +Node: License74036  End Tag Table From 34f8b75b35f6cf4d886385d3d0f8f965bef3db22 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sat, 13 Jan 2024 00:02:16 -0600 Subject: [PATCH 083/145] Fix: (org-ql-find) Go to base buffer if possible Use the base buffer if it has one, because if we run the search from an indirect buffer, it's likely already narrowed to a different entry, and making an indirect buffer from that one would end up with a restriction that would likely hide the selected entry. --- README.org | 4 ++- org-ql-find.el | 3 +- org-ql.info | 84 +++++++++++++++++++++++++++----------------------- 3 files changed, 50 insertions(+), 41 deletions(-) diff --git a/README.org b/README.org index b8f2475..d1c606e 100644 --- a/README.org +++ b/README.org @@ -555,7 +555,9 @@ Simple links may also be written manually in either sexp or non-sexp form, like: ** 0.8.4-pre -Nothing new yet. +*Fixes* + ++ Command ~org-ql-find~ goes to the selected entry in the base buffer (rather than potentially an indirect buffer, whose narrowing could leave the selected entry hidden. The nuances around going to entries in buffers that may be indirect and/or narrowed are surprisingly complicated. Hopefully this is the last fix). ** 0.8.3 diff --git a/org-ql-find.el b/org-ql-find.el index 591e958..f6f2b9c 100644 --- a/org-ql-find.el +++ b/org-ql-find.el @@ -75,7 +75,8 @@ single predicate)." :query-prefix query-prefix :query-filter query-filter :prompt prompt))) - (set-buffer (marker-buffer marker)) + (set-buffer (or (buffer-base-buffer (marker-buffer marker)) + (marker-buffer marker))) (pop-to-buffer (current-buffer) org-ql-find-display-buffer-action) (without-restriction (goto-char marker) diff --git a/org-ql.info b/org-ql.info index 10249a2..e501628 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1074,7 +1074,13 @@ File: README.info, Node: 084-pre, Next: 083, Up: Changelog 5.1 0.8.4-pre ============= -Nothing new yet. +*Fixes* + + • Command ‘org-ql-find’ goes to the selected entry in the base buffer + (rather than potentially an indirect buffer, whose narrowing could + leave the selected entry hidden. The nuances around going to + entries in buffers that may be indirect and/or narrowed are + surprisingly complicated. Hopefully this is the last fix).  File: README.info, Node: 083, Next: 082, Prev: 084-pre, Up: Changelog @@ -1963,44 +1969,44 @@ Node: Links38869 Node: Tips39556 Node: Changelog39880 Node: 084-pre40760 -Node: 08340872 -Node: 08241217 -Node: 08141610 -Node: 0842031 -Node: 07444755 -Node: 07344978 -Node: 07245710 -Node: 07146629 -Node: 0747438 -Node: 06350304 -Node: 06250837 -Node: 06151144 -Node: 0651714 -Node: 05254770 -Node: 05155072 -Node: 0555497 -Node: 04957028 -Node: 04857310 -Node: 04757659 -Node: 04658068 -Node: 04558476 -Node: 04458837 -Node: 04359196 -Node: 04259399 -Node: 04159560 -Node: 0459807 -Node: 03263908 -Node: 03164311 -Node: 0364508 -Node: 02367808 -Node: 02268042 -Node: 02168322 -Node: 0268527 -Node: 0172605 -Node: Notes72706 -Node: Comparison with Org Agenda searches72868 -Node: org-sidebar73757 -Node: License74036 +Node: 08341212 +Node: 08241557 +Node: 08141950 +Node: 0842371 +Node: 07445095 +Node: 07345318 +Node: 07246050 +Node: 07146969 +Node: 0747778 +Node: 06350644 +Node: 06251177 +Node: 06151484 +Node: 0652054 +Node: 05255110 +Node: 05155412 +Node: 0555837 +Node: 04957368 +Node: 04857650 +Node: 04757999 +Node: 04658408 +Node: 04558816 +Node: 04459177 +Node: 04359536 +Node: 04259739 +Node: 04159900 +Node: 0460147 +Node: 03264248 +Node: 03164651 +Node: 0364848 +Node: 02368148 +Node: 02268382 +Node: 02168662 +Node: 0268867 +Node: 0172945 +Node: Notes73046 +Node: Comparison with Org Agenda searches73208 +Node: org-sidebar74097 +Node: License74376  End Tag Table From 9606aaf81230d1faf2c7f54925b45e527fa32bf0 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sat, 13 Jan 2024 00:03:28 -0600 Subject: [PATCH 084/145] Release: v0.8.4 --- README.org | 2 +- org-ql.el | 2 +- org-ql.info | 160 ++++++++++++++++++++++++++-------------------------- 3 files changed, 82 insertions(+), 82 deletions(-) diff --git a/README.org b/README.org index d1c606e..9175943 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.4-pre +** 0.8.4 *Fixes* diff --git a/org-ql.el b/org-ql.el index 865c598..9f24c03 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.4-pre +;; Version: 0.8.4 ;; 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 e501628..0ce52d0 100644 --- a/org-ql.info +++ b/org-ql.info @@ -72,7 +72,7 @@ Functions / Macros Changelog -* 0.8.4-pre: 084-pre. +* 0.8.4: 084. * 0.8.3: 083. * 0.8.2: 082. * 0.8.1: 081. @@ -1032,7 +1032,7 @@ releases. * Menu: -* 0.8.4-pre: 084-pre. +* 0.8.4: 084. * 0.8.3: 083. * 0.8.2: 082. * 0.8.1: 081. @@ -1069,10 +1069,10 @@ releases. * 0.1: 01.  -File: README.info, Node: 084-pre, Next: 083, Up: Changelog +File: README.info, Node: 084, Next: 083, Up: Changelog -5.1 0.8.4-pre -============= +5.1 0.8.4 +========= *Fixes* @@ -1083,7 +1083,7 @@ File: README.info, Node: 084-pre, Next: 083, Up: Changelog surprisingly complicated. Hopefully this is the last fix).  -File: README.info, Node: 083, Next: 082, Prev: 084-pre, Up: Changelog +File: README.info, Node: 083, Next: 082, Prev: 084, Up: Changelog 5.2 0.8.3 ========= @@ -1933,80 +1933,80 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1915 -Node: Screenshots2038 -Node: Installation2156 -Node: Quelpa2670 -Node: Helm support3198 -Node: Usage3601 -Node: Commands3999 -Node: org-ql-find4464 -Node: org-ql-open-link5372 -Node: org-ql-refile6227 -Node: org-ql-search6555 -Node: helm-org-ql8486 -Node: org-ql-view8864 -Node: org-ql-view-sidebar9394 -Node: org-ql-view-recent-items9774 -Node: org-ql-sparse-tree10270 -Node: Queries11070 -Node: Non-sexp query syntax12187 -Node: General predicates13946 -Node: Ancestor/descendant predicates20871 -Node: Date/time predicates21999 -Node: Functions / Macros25123 -Node: Agenda-like views25421 -Ref: Function org-ql-block25583 -Node: Listing / acting-on results26844 -Ref: Caching27052 -Ref: Function org-ql-select27965 -Ref: Function org-ql-query30391 -Ref: Macro org-ql (deprecated)32165 -Node: Custom predicates32480 -Ref: Macro org-ql-defpred32704 -Node: Dynamic block36145 -Node: Links38869 -Node: Tips39556 -Node: Changelog39880 -Node: 084-pre40760 -Node: 08341212 -Node: 08241557 -Node: 08141950 -Node: 0842371 -Node: 07445095 -Node: 07345318 -Node: 07246050 -Node: 07146969 -Node: 0747778 -Node: 06350644 -Node: 06251177 -Node: 06151484 -Node: 0652054 -Node: 05255110 -Node: 05155412 -Node: 0555837 -Node: 04957368 -Node: 04857650 -Node: 04757999 -Node: 04658408 -Node: 04558816 -Node: 04459177 -Node: 04359536 -Node: 04259739 -Node: 04159900 -Node: 0460147 -Node: 03264248 -Node: 03164651 -Node: 0364848 -Node: 02368148 -Node: 02268382 -Node: 02168662 -Node: 0268867 -Node: 0172945 -Node: Notes73046 -Node: Comparison with Org Agenda searches73208 -Node: org-sidebar74097 -Node: License74376 +Node: Contents1907 +Node: Screenshots2030 +Node: Installation2148 +Node: Quelpa2662 +Node: Helm support3190 +Node: Usage3593 +Node: Commands3991 +Node: org-ql-find4456 +Node: org-ql-open-link5364 +Node: org-ql-refile6219 +Node: org-ql-search6547 +Node: helm-org-ql8478 +Node: org-ql-view8856 +Node: org-ql-view-sidebar9386 +Node: org-ql-view-recent-items9766 +Node: org-ql-sparse-tree10262 +Node: Queries11062 +Node: Non-sexp query syntax12179 +Node: General predicates13938 +Node: Ancestor/descendant predicates20863 +Node: Date/time predicates21991 +Node: Functions / Macros25115 +Node: Agenda-like views25413 +Ref: Function org-ql-block25575 +Node: Listing / acting-on results26836 +Ref: Caching27044 +Ref: Function org-ql-select27957 +Ref: Function org-ql-query30383 +Ref: Macro org-ql (deprecated)32157 +Node: Custom predicates32472 +Ref: Macro org-ql-defpred32696 +Node: Dynamic block36137 +Node: Links38861 +Node: Tips39548 +Node: Changelog39872 +Node: 08440744 +Node: 08341184 +Node: 08241525 +Node: 08141918 +Node: 0842339 +Node: 07445063 +Node: 07345286 +Node: 07246018 +Node: 07146937 +Node: 0747746 +Node: 06350612 +Node: 06251145 +Node: 06151452 +Node: 0652022 +Node: 05255078 +Node: 05155380 +Node: 0555805 +Node: 04957336 +Node: 04857618 +Node: 04757967 +Node: 04658376 +Node: 04558784 +Node: 04459145 +Node: 04359504 +Node: 04259707 +Node: 04159868 +Node: 0460115 +Node: 03264216 +Node: 03164619 +Node: 0364816 +Node: 02368116 +Node: 02268350 +Node: 02168630 +Node: 0268835 +Node: 0172913 +Node: Notes73014 +Node: Comparison with Org Agenda searches73176 +Node: org-sidebar74065 +Node: License74344  End Tag Table From 9c63a458211c2b6214f352fdd80f2363a761d42e Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sat, 13 Jan 2024 00:47:35 -0600 Subject: [PATCH 085/145] Meta: Update makem.sh --- makem.sh | 71 +++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 57 insertions(+), 14 deletions(-) diff --git a/makem.sh b/makem.sh index 82a2db0..c320e5d 100755 --- a/makem.sh +++ b/makem.sh @@ -3,7 +3,7 @@ # * makem.sh --- Script to aid building and testing Emacs Lisp packages # URL: https://github.com/alphapapa/makem.sh -# Version: 0.6-pre +# Version: 0.7 # * Commentary: @@ -112,6 +112,12 @@ Source files are automatically discovered from git, or may be specified with options. Package dependencies are discovered from "Package-Requires" headers in source files, from -pkg.el files, and from a Cask file. + +Checkdoc's spell checker may not recognize some words, causing the +`lint-checkdoc' rule to fail. Custom words can be added in file-local +or directory-local variables using the variable +`ispell-buffer-session-localwords', which should be set to a list of +strings. EOF } @@ -177,6 +183,7 @@ function elisp-checkdoc-file { (setq makem-checkdoc-errors-p t) ;; Return nil because we *are* generating a buffered list of errors. nil)))) + (put 'ispell-buffer-session-localwords 'safe-local-variable #'list-of-strings-p) (mapcar #'checkdoc-file files) (when makem-checkdoc-errors-p (kill-emacs 1)))) @@ -379,6 +386,36 @@ function byte-compile-file { # ** Files +function submodules { + # Echo a list of submodules's paths relative to the repo root. + # TODO: Parse with bash regexp instead of cut. + git submodule status | awk '{print $2}' +} + +function project-root { + # Echo the root of the project (or superproject, if running from + # within a submodule). + root_dir=$(git rev-parse --show-superproject-working-tree) + [[ $root_dir ]] || root_dir=$(git rev-parse --show-toplevel) + [[ $root_dir ]] || error "Can't find repo root." + + echo "$root_dir" +} + +function files-project { + # Echo a list of files in project; or with $1, files in it + # matching that pattern with "git ls-files". Excludes submodules. + [[ $1 ]] && pattern="/$1" || pattern="." + + local excludes + for submodule in $(submodules) + do + excludes+=(":!:$submodule") + done + + git ls-files -- "$pattern" "${excludes[@]}" +} + function dirs-project { # Echo list of directories to be used in load path. files-project-feature | dirnames @@ -387,7 +424,7 @@ function dirs-project { function files-project-elisp { # Echo list of Elisp files in project. - git ls-files 2>/dev/null \ + files-project 2>/dev/null \ | egrep "\.el$" \ | filter-files-exclude-default \ | filter-files-exclude-args @@ -396,13 +433,13 @@ function files-project-elisp { function files-project-feature { # Echo list of Elisp files that are not tests and provide a feature. files-project-elisp \ - | egrep -v "$test_files_regexp" \ + | grep -E -v "$test_files_regexp" \ | filter-files-feature } function files-project-test { # Echo list of Elisp test files. - files-project-elisp | egrep "$test_files_regexp" + files-project-elisp | grep -E "$test_files_regexp" } function dirnames { @@ -415,7 +452,7 @@ function dirnames { function filter-files-exclude-default { # Filter out paths (STDIN) which should be excluded by default. - egrep -v "(/\.cask/|-autoloads.el|.dir-locals)" + grep -E -v "(/\.cask/|-autoloads\.el|\.dir-locals)" } function filter-files-exclude-args { @@ -441,7 +478,7 @@ function filter-files-feature { # Read paths on STDIN and echo ones that (provide 'a-feature). while read path do - egrep "^\\(provide '" "$path" &>/dev/null \ + grep -E "^\\(provide '" "$path" &>/dev/null \ && echo "$path" done } @@ -489,7 +526,7 @@ function ert-tests-p { function package-main-file { # Echo the package's main file. - file_pkg=$(git ls-files ./*-pkg.el 2>/dev/null) + file_pkg=$(files-project "*-pkg.el" 2>/dev/null) if [[ $file_pkg ]] then @@ -512,23 +549,23 @@ function dependencies { # Search package headers. Use -a so grep won't think that an Elisp file containing # control characters (rare, but sometimes necessary) is binary and refuse to search it. - egrep -a -i '^;; Package-Requires: ' $(files-project-feature) $(files-project-test) \ - | egrep -o '\([^([:space:]][^)]*\)' \ - | egrep -o '^[^[:space:])]+' \ + grep -E -a -i '^;; Package-Requires: ' $(files-project-feature) $(files-project-test) \ + | grep -E -o '\([^([:space:]][^)]*\)' \ + | grep -E -o '^[^[:space:])]+' \ | sed -r 's/\(//g' \ - | egrep -v '^emacs$' # Ignore Emacs version requirement. + | grep -E -v '^emacs$' # Ignore Emacs version requirement. # Search Cask file. if [[ -r Cask ]] then - egrep '\(depends-on "[^"]+"' Cask \ + grep -E '\(depends-on "[^"]+"' Cask \ | sed -r -e 's/\(depends-on "([^"]+)".*/\1/g' fi # Search -pkg.el file. - if [[ $(git ls-files ./*-pkg.el 2>/dev/null) ]] + if [[ $(files-project "*-pkg.el" 2>/dev/null) ]] then - sed -nr 's/.*\(([-[:alnum:]]+)[[:blank:]]+"[.[:digit:]]+"\).*/\1/p' $(git ls-files ./*-pkg.el 2>/dev/null) + sed -nr 's/.*\(([-[:alnum:]]+)[[:blank:]]+"[.[:digit:]]+"\).*/\1/p' $(files-project- -- -pkg.el 2>/dev/null) fi } @@ -581,6 +618,9 @@ function sandbox { local deps=($(dependencies)) debug "Installing dependencies: ${deps[@]}" + # Ensure built-in packages get upgraded to newer versions from ELPA. + args_sandbox_package_install+=(--eval "(setq package-install-upgrade-built-in t)") + for package in "${deps[@]}" do args_sandbox_package_install+=(--eval "(package-install '$package)") @@ -1193,6 +1233,9 @@ paths_temp+=("$package_initialize_file") trap cleanup EXIT INT TERM +# Change to project root directory first. +cd "$(project-root)" + # Discover project files. files_project_feature=($(files-project-feature)) files_project_test=($(files-project-test)) From 8d3c93b8838bd5d5347dd8962b68cc3cabcf0147 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sat, 13 Jan 2024 00:47:47 -0600 Subject: [PATCH 086/145] Tidy: Compiler warning I've no explanation for why this isn't caught by makem.sh's linting compilation and declarations, but somehow it shows up at installation time. --- org-ql-completing-read.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/org-ql-completing-read.el b/org-ql-completing-read.el index 4db51e6..640033d 100644 --- a/org-ql-completing-read.el +++ b/org-ql-completing-read.el @@ -26,6 +26,8 @@ (require 'org-ql) +(declare-function org-ql-search "org-ql-search") + ;;;; Variables (defvar-keymap org-ql-completing-read-map From 770e60766a8f309943d68c1e7234e109904360ba Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 21 Feb 2024 04:51:30 -0600 Subject: [PATCH 087/145] Meta: v0.8.5-pre --- README.org | 4 + org-ql.el | 2 +- org-ql.info | 233 +++++++++++++++++++++++++++------------------------- 3 files changed, 127 insertions(+), 112 deletions(-) diff --git a/README.org b/README.org index 9175943..a1af574 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.5-pre + +Nothing new yet. + ** 0.8.4 *Fixes* diff --git a/org-ql.el b/org-ql.el index 9f24c03..28e1b0f 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.4 +;; Version: 0.8.5-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 0ce52d0..a0cfe4a 100644 --- a/org-ql.info +++ b/org-ql.info @@ -72,6 +72,7 @@ Functions / Macros Changelog +* 0.8.5-pre: 085-pre. * 0.8.4: 084. * 0.8.3: 083. * 0.8.2: 082. @@ -1032,6 +1033,7 @@ releases. * Menu: +* 0.8.5-pre: 085-pre. * 0.8.4: 084. * 0.8.3: 083. * 0.8.2: 082. @@ -1069,9 +1071,17 @@ releases. * 0.1: 01.  -File: README.info, Node: 084, Next: 083, Up: Changelog +File: README.info, Node: 085-pre, Next: 084, Up: Changelog -5.1 0.8.4 +5.1 0.8.5-pre +============= + +Nothing new yet. + + +File: README.info, Node: 084, Next: 083, Prev: 085-pre, Up: Changelog + +5.2 0.8.4 ========= *Fixes* @@ -1085,7 +1095,7 @@ File: README.info, Node: 084, Next: 083, Up: Changelog  File: README.info, Node: 083, Next: 082, Prev: 084, Up: Changelog -5.2 0.8.3 +5.3 0.8.3 ========= *Fixes* @@ -1098,7 +1108,7 @@ File: README.info, Node: 083, Next: 082, Prev: 084, Up: Changelog  File: README.info, Node: 082, Next: 081, Prev: 083, Up: Changelog -5.3 0.8.2 +5.4 0.8.2 ========= *Fixes* @@ -1112,7 +1122,7 @@ File: README.info, Node: 082, Next: 081, Prev: 083, Up: Changelog  File: README.info, Node: 081, Next: 08, Prev: 082, Up: Changelog -5.4 0.8.1 +5.5 0.8.1 ========= *Fixes* @@ -1127,7 +1137,7 @@ File: README.info, Node: 081, Next: 08, Prev: 082, Up: Changelog  File: README.info, Node: 08, Next: 074, Prev: 081, Up: Changelog -5.5 0.8 +5.6 0.8 ======= *Additions* @@ -1183,7 +1193,7 @@ File: README.info, Node: 08, Next: 074, Prev: 081, Up: Changelog  File: README.info, Node: 074, Next: 073, Prev: 08, Up: Changelog -5.6 0.7.4 +5.7 0.7.4 ========= *Fixes* @@ -1193,7 +1203,7 @@ File: README.info, Node: 074, Next: 073, Prev: 08, Up: Changelog  File: README.info, Node: 073, Next: 072, Prev: 074, Up: Changelog -5.7 0.7.3 +5.8 0.7.3 ========= *Fixes* @@ -1211,7 +1221,7 @@ File: README.info, Node: 073, Next: 072, Prev: 074, Up: Changelog  File: README.info, Node: 072, Next: 071, Prev: 073, Up: Changelog -5.8 0.7.2 +5.9 0.7.2 ========= *Fixes* @@ -1232,8 +1242,8 @@ File: README.info, Node: 072, Next: 071, Prev: 073, Up: Changelog  File: README.info, Node: 071, Next: 07, Prev: 072, Up: Changelog -5.9 0.7.1 -========= +5.10 0.7.1 +========== *Fixes* • Function ‘org-ql-completing-read’ is more compatible with default @@ -1251,7 +1261,7 @@ File: README.info, Node: 071, Next: 07, Prev: 072, Up: Changelog  File: README.info, Node: 07, Next: 063, Prev: 071, Up: Changelog -5.10 0.7 +5.11 0.7 ======== *Added* @@ -1310,7 +1320,7 @@ File: README.info, Node: 07, Next: 063, Prev: 071, Up: Changelog  File: README.info, Node: 063, Next: 062, Prev: 07, Up: Changelog -5.11 0.6.3 +5.12 0.6.3 ========== *Fixed* @@ -1326,7 +1336,7 @@ File: README.info, Node: 063, Next: 062, Prev: 07, Up: Changelog  File: README.info, Node: 062, Next: 061, Prev: 063, Up: Changelog -5.12 0.6.2 +5.13 0.6.2 ========== *Fixed* @@ -1337,7 +1347,7 @@ File: README.info, Node: 062, Next: 061, Prev: 063, Up: Changelog  File: README.info, Node: 061, Next: 06, Prev: 062, Up: Changelog -5.13 0.6.1 +5.14 0.6.1 ========== *Fixed* @@ -1355,7 +1365,7 @@ File: README.info, Node: 061, Next: 06, Prev: 062, Up: Changelog  File: README.info, Node: 06, Next: 052, Prev: 061, Up: Changelog -5.14 0.6 +5.15 0.6 ======== *Added* @@ -1422,7 +1432,7 @@ File: README.info, Node: 06, Next: 052, Prev: 061, Up: Changelog  File: README.info, Node: 052, Next: 051, Prev: 06, Up: Changelog -5.15 0.5.2 +5.16 0.5.2 ========== *Fixed* @@ -1433,7 +1443,7 @@ File: README.info, Node: 052, Next: 051, Prev: 06, Up: Changelog  File: README.info, Node: 051, Next: 05, Prev: 052, Up: Changelog -5.16 0.5.1 +5.17 0.5.1 ========== *Fixed* @@ -1446,7 +1456,7 @@ File: README.info, Node: 051, Next: 05, Prev: 052, Up: Changelog  File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog -5.17 0.5 +5.18 0.5 ======== *Added* @@ -1487,7 +1497,7 @@ File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog  File: README.info, Node: 049, Next: 048, Prev: 05, Up: Changelog -5.18 0.4.9 +5.19 0.4.9 ========== *Fixed* @@ -1498,7 +1508,7 @@ File: README.info, Node: 049, Next: 048, Prev: 05, Up: Changelog  File: README.info, Node: 048, Next: 047, Prev: 049, Up: Changelog -5.19 0.4.8 +5.20 0.4.8 ========== *Fixed* @@ -1510,7 +1520,7 @@ File: README.info, Node: 048, Next: 047, Prev: 049, Up: Changelog  File: README.info, Node: 047, Next: 046, Prev: 048, Up: Changelog -5.20 0.4.7 +5.21 0.4.7 ========== *Fixed* @@ -1523,7 +1533,7 @@ File: README.info, Node: 047, Next: 046, Prev: 048, Up: Changelog  File: README.info, Node: 046, Next: 045, Prev: 047, Up: Changelog -5.21 0.4.6 +5.22 0.4.6 ========== *Fixed* @@ -1536,7 +1546,7 @@ File: README.info, Node: 046, Next: 045, Prev: 047, Up: Changelog  File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog -5.22 0.4.5 +5.23 0.4.5 ========== *Fixed* @@ -1548,7 +1558,7 @@ File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog  File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog -5.23 0.4.4 +5.24 0.4.4 ========== *Fixed* @@ -1560,7 +1570,7 @@ File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog  File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog -5.24 0.4.3 +5.25 0.4.3 ========== *Fixed* @@ -1570,7 +1580,7 @@ File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog  File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog -5.25 0.4.2 +5.26 0.4.2 ========== *Fixed* @@ -1579,7 +1589,7 @@ File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog  File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog -5.26 0.4.1 +5.27 0.4.1 ========== *Fixed* @@ -1589,7 +1599,7 @@ File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog  File: README.info, Node: 04, Next: 032, Prev: 041, Up: Changelog -5.27 0.4 +5.28 0.4 ======== _Note:_ The next release, 0.5, may include changes which will require @@ -1670,7 +1680,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.28 0.3.2 +5.29 0.3.2 ========== *Fixed* @@ -1683,7 +1693,7 @@ File: README.info, Node: 032, Next: 031, Prev: 04, Up: Changelog  File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog -5.29 0.3.1 +5.30 0.3.1 ========== *Fixed* @@ -1693,7 +1703,7 @@ File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog  File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog -5.30 0.3 +5.31 0.3 ======== *Added* @@ -1761,7 +1771,7 @@ File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog  File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog -5.31 0.2.3 +5.32 0.2.3 ========== *Fixed* @@ -1771,7 +1781,7 @@ File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog  File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog -5.32 0.2.2 +5.33 0.2.2 ========== *Fixed* @@ -1782,7 +1792,7 @@ File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog  File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog -5.33 0.2.1 +5.34 0.2.1 ========== *Fixed* @@ -1792,7 +1802,7 @@ File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog  File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog -5.34 0.2 +5.35 0.2 ======== *Added* @@ -1875,7 +1885,7 @@ File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog  File: README.info, Node: 01, Prev: 02, Up: Changelog -5.35 0.1 +5.36 0.1 ======== First tagged release. @@ -1933,80 +1943,81 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1907 -Node: Screenshots2030 -Node: Installation2148 -Node: Quelpa2662 -Node: Helm support3190 -Node: Usage3593 -Node: Commands3991 -Node: org-ql-find4456 -Node: org-ql-open-link5364 -Node: org-ql-refile6219 -Node: org-ql-search6547 -Node: helm-org-ql8478 -Node: org-ql-view8856 -Node: org-ql-view-sidebar9386 -Node: org-ql-view-recent-items9766 -Node: org-ql-sparse-tree10262 -Node: Queries11062 -Node: Non-sexp query syntax12179 -Node: General predicates13938 -Node: Ancestor/descendant predicates20863 -Node: Date/time predicates21991 -Node: Functions / Macros25115 -Node: Agenda-like views25413 -Ref: Function org-ql-block25575 -Node: Listing / acting-on results26836 -Ref: Caching27044 -Ref: Function org-ql-select27957 -Ref: Function org-ql-query30383 -Ref: Macro org-ql (deprecated)32157 -Node: Custom predicates32472 -Ref: Macro org-ql-defpred32696 -Node: Dynamic block36137 -Node: Links38861 -Node: Tips39548 -Node: Changelog39872 -Node: 08440744 -Node: 08341184 -Node: 08241525 -Node: 08141918 -Node: 0842339 -Node: 07445063 -Node: 07345286 -Node: 07246018 -Node: 07146937 -Node: 0747746 -Node: 06350612 -Node: 06251145 -Node: 06151452 -Node: 0652022 -Node: 05255078 -Node: 05155380 -Node: 0555805 -Node: 04957336 -Node: 04857618 -Node: 04757967 -Node: 04658376 -Node: 04558784 -Node: 04459145 -Node: 04359504 -Node: 04259707 -Node: 04159868 -Node: 0460115 -Node: 03264216 -Node: 03164619 -Node: 0364816 -Node: 02368116 -Node: 02268350 -Node: 02168630 -Node: 0268835 -Node: 0172913 -Node: Notes73014 -Node: Comparison with Org Agenda searches73176 -Node: org-sidebar74065 -Node: License74344 +Node: Contents1929 +Node: Screenshots2052 +Node: Installation2170 +Node: Quelpa2684 +Node: Helm support3212 +Node: Usage3615 +Node: Commands4013 +Node: org-ql-find4478 +Node: org-ql-open-link5386 +Node: org-ql-refile6241 +Node: org-ql-search6569 +Node: helm-org-ql8500 +Node: org-ql-view8878 +Node: org-ql-view-sidebar9408 +Node: org-ql-view-recent-items9788 +Node: org-ql-sparse-tree10284 +Node: Queries11084 +Node: Non-sexp query syntax12201 +Node: General predicates13960 +Node: Ancestor/descendant predicates20885 +Node: Date/time predicates22013 +Node: Functions / Macros25137 +Node: Agenda-like views25435 +Ref: Function org-ql-block25597 +Node: Listing / acting-on results26858 +Ref: Caching27066 +Ref: Function org-ql-select27979 +Ref: Function org-ql-query30405 +Ref: Macro org-ql (deprecated)32179 +Node: Custom predicates32494 +Ref: Macro org-ql-defpred32718 +Node: Dynamic block36159 +Node: Links38883 +Node: Tips39570 +Node: Changelog39894 +Node: 085-pre40788 +Node: 08440900 +Node: 08341356 +Node: 08241697 +Node: 08142090 +Node: 0842511 +Node: 07445235 +Node: 07345458 +Node: 07246190 +Node: 07147109 +Node: 0747920 +Node: 06350786 +Node: 06251319 +Node: 06151626 +Node: 0652196 +Node: 05255252 +Node: 05155554 +Node: 0555979 +Node: 04957510 +Node: 04857792 +Node: 04758141 +Node: 04658550 +Node: 04558958 +Node: 04459319 +Node: 04359678 +Node: 04259881 +Node: 04160042 +Node: 0460289 +Node: 03264390 +Node: 03164793 +Node: 0364990 +Node: 02368290 +Node: 02268524 +Node: 02168804 +Node: 0269009 +Node: 0173087 +Node: Notes73188 +Node: Comparison with Org Agenda searches73350 +Node: org-sidebar74239 +Node: License74518  End Tag Table From b6efba9aebe24794101afd608ab60322e6e73277 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 21 Feb 2024 04:57:44 -0600 Subject: [PATCH 088/145] Fix: (heading) Don't match strings as regexps Reported-by: Alex Popescu --- README.org | 3 +- org-ql.el | 36 ++++--------------- org-ql.info | 85 +++++++++++++++++++++++--------------------- tests/test-org-ql.el | 10 ++++-- 4 files changed, 61 insertions(+), 73 deletions(-) diff --git a/README.org b/README.org index a1af574..d122bdd 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.5-pre -Nothing new yet. +*Fixes* ++ Predicate ~heading~ incorrectly matched strings as regular expressions, sometimes returning incorrect results. (See [[https://github.com/alphapapa/org-ql/discussions/410][discussion]]. Thanks to [[https://github.com/al3xandru][Alex Popescu]] for reporting.) ** 0.8.4 diff --git a/org-ql.el b/org-ql.el index 28e1b0f..da4456e 100644 --- a/org-ql.el +++ b/org-ql.el @@ -1461,40 +1461,16 @@ Org effort string, like \"5\" or \"0:05\"." (list :regexp (rx bol (0+ space) ":STYLE:" (1+ space) "habit" (0+ space) eol)))) :body (org-is-habit-p)) -(org-ql-defpred (heading h) (&rest strings) +(org-ql-defpred (heading h) (&rest _strings) "Return non-nil if current entry's heading matches all STRINGS. Matching is done case-insensitively." :coalesce t :normalizers ((`(,predicate-names . ,args) - ;; "h" alias. - `(heading ,@args))) - ;; TODO: Adjust regexp to avoid matching in tag list. - :preambles ((`(,predicate-names) - ;; This clause protects against the case in which the - ;; arguments are nil, which would cause an error in - ;; `rx-to-string' in other clauses. This can happen - ;; with `org-ql-completing-read', e.g. when the input - ;; is "h:" while the user is typing. - (list :regexp (rx bol (1+ "*") (1+ blank) (0+ nonl)) - :case-fold t :query query)) - (`(,predicate-names ,string) - ;; Only one string: match with preamble, then let predicate confirm (because - ;; the match could be in e.g. the tags rather than the heading text). - (list :regexp (rx-to-string `(seq bol (1+ "*") (1+ blank) (0+ nonl) - ,string) - 'no-group) - :case-fold t :query query)) - (`(,predicate-names . ,strings) - ;; Multiple strings: use preamble to match against first - ;; string, then let the predicate match the rest. - (list :regexp (rx-to-string `(seq bol (1+ "*") (1+ blank) (0+ nonl) - ,(car strings)) - 'no-group) - :case-fold t :query query))) - ;; TODO: In Org 9.2+, `org-get-heading' takes 2 more arguments. - :body (let ((heading (org-get-heading 'no-tags 'no-todo)) - (case-fold-search t)) - (--all? (string-match it heading) strings))) + ;; NOTE: Each string argument must be converted to a regexp + ;; for testing by the body, so we just normalize to the + ;; `heading-regexp' predicate, leaving this predicate as + ;; one that merely regexp-quotes its arguments. + `(heading-regexp ,@(mapcar #'regexp-quote args))))) (org-ql-defpred (heading-regexp h*) (&rest regexps) "Return non-nil if current entry's heading matches all REGEXPS (regexp strings). diff --git a/org-ql.info b/org-ql.info index a0cfe4a..33a3dca 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1076,7 +1076,12 @@ File: README.info, Node: 085-pre, Next: 084, Up: Changelog 5.1 0.8.5-pre ============= -Nothing new yet. +*Fixes* + • Predicate ‘heading’ incorrectly matched strings as regular + expressions, sometimes returning incorrect results. (See + discussion (https://github.com/alphapapa/org-ql/discussions/410). + Thanks to Alex Popescu (https://github.com/al3xandru) for + reporting.)  File: README.info, Node: 084, Next: 083, Prev: 085-pre, Up: Changelog @@ -1979,45 +1984,45 @@ Node: Links38883 Node: Tips39570 Node: Changelog39894 Node: 085-pre40788 -Node: 08440900 -Node: 08341356 -Node: 08241697 -Node: 08142090 -Node: 0842511 -Node: 07445235 -Node: 07345458 -Node: 07246190 -Node: 07147109 -Node: 0747920 -Node: 06350786 -Node: 06251319 -Node: 06151626 -Node: 0652196 -Node: 05255252 -Node: 05155554 -Node: 0555979 -Node: 04957510 -Node: 04857792 -Node: 04758141 -Node: 04658550 -Node: 04558958 -Node: 04459319 -Node: 04359678 -Node: 04259881 -Node: 04160042 -Node: 0460289 -Node: 03264390 -Node: 03164793 -Node: 0364990 -Node: 02368290 -Node: 02268524 -Node: 02168804 -Node: 0269009 -Node: 0173087 -Node: Notes73188 -Node: Comparison with Org Agenda searches73350 -Node: org-sidebar74239 -Node: License74518 +Node: 08441175 +Node: 08341631 +Node: 08241972 +Node: 08142365 +Node: 0842786 +Node: 07445510 +Node: 07345733 +Node: 07246465 +Node: 07147384 +Node: 0748195 +Node: 06351061 +Node: 06251594 +Node: 06151901 +Node: 0652471 +Node: 05255527 +Node: 05155829 +Node: 0556254 +Node: 04957785 +Node: 04858067 +Node: 04758416 +Node: 04658825 +Node: 04559233 +Node: 04459594 +Node: 04359953 +Node: 04260156 +Node: 04160317 +Node: 0460564 +Node: 03264665 +Node: 03165068 +Node: 0365265 +Node: 02368565 +Node: 02268799 +Node: 02169079 +Node: 0269284 +Node: 0173362 +Node: Notes73463 +Node: Comparison with Org Agenda searches73625 +Node: org-sidebar74514 +Node: License74793  End Tag Table diff --git a/tests/test-org-ql.el b/tests/test-org-ql.el index 7bf6a9b..247fa78 100644 --- a/tests/test-org-ql.el +++ b/tests/test-org-ql.el @@ -218,7 +218,8 @@ with keyword arg NOW in PLIST." (it "coalesces a single AND clause that uses two predicates (and preserves predicate order)" (expect (org-ql--normalize-query '(and (rifle "foo") (rifle "bar") (heading "baz") (heading "buz"))) - :to-equal '(and (rifle :regexps '("foo" "bar")) (heading "baz" "buz")))) + ;; NOTE: `heading' is normalized to `heading-regexp'. + :to-equal '(and (rifle :regexps '("foo" "bar")) (heading-regexp "baz" "buz")))) (it "preserves independent OR clauses" (expect (org-ql--normalize-query '(and (or (rifle "foo") (rifle "bar")) (or (rifle "baz") (rifle "buz")))) @@ -1112,7 +1113,12 @@ with keyword arg NOW in PLIST." '("Take over the world"))) (org-ql-it "with two arguments" (org-ql-expect ('(heading "Take over" "world")) - '("Take over the world")))) + '("Take over the world"))) + (org-ql-it "does not match strings as regexps" + (org-ql-expect ('(heading "over")) + '("Take over the universe" "Take over the world" "Take over Mars" "Take over the moon")) + (org-ql-expect ('(heading "[over]")) + nil))) (describe "(heading-regexp)" (org-ql-it "with one argument" From c90bae0eabad948dad0b693f1005b79eec457f30 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 21 Feb 2024 05:41:49 -0600 Subject: [PATCH 089/145] Fix: (ancestors, parent) Normalize sub-queries I'm not sure why calling the REC labeled function didn't correctly normalize these sub-queries; it seemed to only normalize for one round, leaving some queries incorrectly normalized. But this fixes it. Fixes #365. Reported-by: Gabriele Mongiano --- README.org | 1 + org-ql.el | 4 +-- org-ql.info | 82 +++++++++++++++++++++++--------------------- tests/test-org-ql.el | 12 +++++++ 4 files changed, 58 insertions(+), 41 deletions(-) diff --git a/README.org b/README.org index d122bdd..4d9fcbe 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 ~heading~ incorrectly matched strings as regular expressions, sometimes returning incorrect results. (See [[https://github.com/alphapapa/org-ql/discussions/410][discussion]]. Thanks to [[https://github.com/al3xandru][Alex Popescu]] for reporting.) ++ Predicates ~ancestor~ and ~parent~ did not normalize their sub-queries, sometimes returning incorrect results. ([[https://github.com/alphapapa/org-ql/issues/365][#365]]. Thanks to [[https://github.com/kofm][Gabriele Mongiano]] for reporting.) ** 0.8.4 diff --git a/org-ql.el b/org-ql.el index da4456e..2bc33f5 100644 --- a/org-ql.el +++ b/org-ql.el @@ -2077,7 +2077,7 @@ With KEYWORDS, return non-nil if its keyword is one of KEYWORDS." :normalizers ((`(,predicate-names ;; Avoid infinitely compiling already-compiled functions. ,(and query (guard (not (byte-code-function-p query))))) - `(ancestors ,(org-ql--query-predicate (rec query)))) + `(ancestors ,(org-ql--query-predicate (org-ql--normalize-query query)))) (`(,predicate-names) '(ancestors (lambda () t)))) :body (org-with-wide-buffer @@ -2089,7 +2089,7 @@ With KEYWORDS, return non-nil if its keyword is one of KEYWORDS." :normalizers ((`(,predicate-names ;; Avoid infinitely compiling already-compiled functions. ,(and query (guard (not (byte-code-function-p query))))) - `(parent ,(org-ql--query-predicate (rec query)))) + `(parent ,(org-ql--query-predicate (org-ql--normalize-query query)))) (`(,predicate-names) '(parent (lambda () t)))) :body (org-with-wide-buffer diff --git a/org-ql.info b/org-ql.info index 33a3dca..f17deee 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1082,6 +1082,10 @@ File: README.info, Node: 085-pre, Next: 084, Up: Changelog discussion (https://github.com/alphapapa/org-ql/discussions/410). Thanks to Alex Popescu (https://github.com/al3xandru) for reporting.) + • Predicates ‘ancestor’ and ‘parent’ did not normalize their + sub-queries, sometimes returning incorrect results. (#365 + (https://github.com/alphapapa/org-ql/issues/365). Thanks to + Gabriele Mongiano (https://github.com/kofm) for reporting.)  File: README.info, Node: 084, Next: 083, Prev: 085-pre, Up: Changelog @@ -1984,45 +1988,45 @@ Node: Links38883 Node: Tips39570 Node: Changelog39894 Node: 085-pre40788 -Node: 08441175 -Node: 08341631 -Node: 08241972 -Node: 08142365 -Node: 0842786 -Node: 07445510 -Node: 07345733 -Node: 07246465 -Node: 07147384 -Node: 0748195 -Node: 06351061 -Node: 06251594 -Node: 06151901 -Node: 0652471 -Node: 05255527 -Node: 05155829 -Node: 0556254 -Node: 04957785 -Node: 04858067 -Node: 04758416 -Node: 04658825 -Node: 04559233 -Node: 04459594 -Node: 04359953 -Node: 04260156 -Node: 04160317 -Node: 0460564 -Node: 03264665 -Node: 03165068 -Node: 0365265 -Node: 02368565 -Node: 02268799 -Node: 02169079 -Node: 0269284 -Node: 0173362 -Node: Notes73463 -Node: Comparison with Org Agenda searches73625 -Node: org-sidebar74514 -Node: License74793 +Node: 08441444 +Node: 08341900 +Node: 08242241 +Node: 08142634 +Node: 0843055 +Node: 07445779 +Node: 07346002 +Node: 07246734 +Node: 07147653 +Node: 0748464 +Node: 06351330 +Node: 06251863 +Node: 06152170 +Node: 0652740 +Node: 05255796 +Node: 05156098 +Node: 0556523 +Node: 04958054 +Node: 04858336 +Node: 04758685 +Node: 04659094 +Node: 04559502 +Node: 04459863 +Node: 04360222 +Node: 04260425 +Node: 04160586 +Node: 0460833 +Node: 03264934 +Node: 03165337 +Node: 0365534 +Node: 02368834 +Node: 02269068 +Node: 02169348 +Node: 0269553 +Node: 0173631 +Node: Notes73732 +Node: Comparison with Org Agenda searches73894 +Node: org-sidebar74783 +Node: License75062  End Tag Table diff --git a/tests/test-org-ql.el b/tests/test-org-ql.el index 247fa78..8d2b84c 100644 --- a/tests/test-org-ql.el +++ b/tests/test-org-ql.el @@ -254,6 +254,18 @@ with keyword arg NOW in PLIST." (expect (org-ql--normalize-query "\"quoted phrase\"") :to-equal '(rifle :regexps '("\"quoted phrase\"")))) + (describe "Ancestor/Parent predicates" + ;; NOTE: Because the ancestor and parent predicates byte-compile their + ;; subquery predicates, we have to test the byte-compiled forms here. + (expect (org-ql--normalize-query '(ancestors "scheduled")) + ;; No colon after keyword, so not a predicate query. + :to-equal ;; '(ancestors (rifle :regexps '("scheduled"))) + `(ancestors #[nil "\300\301\302\"\207" [rifle :regexps ("scheduled")] 3])) + (expect (org-ql--normalize-query '(parent "scheduled")) + ;; No colon after keyword, so not a predicate query. + :to-equal ;; '(parent (rifle :regexps '("scheduled"))) + `(parent #[nil "\300\301\302\"\207" [rifle :regexps ("scheduled")] 3]))) + (describe "Plain strings" (it "normalizes plain strings to the default predicate (using AND)" (expect (org-ql--normalize-query '(and "string1" "string2")) From bfff0b5517d55d01bf12de27e10a73c9a077767b Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 21 Feb 2024 05:46:04 -0600 Subject: [PATCH 090/145] Release: v0.8.5 --- README.org | 2 +- org-ql.el | 2 +- org-ql.info | 162 ++++++++++++++++++++++++++-------------------------- 3 files changed, 83 insertions(+), 83 deletions(-) diff --git a/README.org b/README.org index 4d9fcbe..39f18c5 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.5-pre +** 0.8.5 *Fixes* + Predicate ~heading~ incorrectly matched strings as regular expressions, sometimes returning incorrect results. (See [[https://github.com/alphapapa/org-ql/discussions/410][discussion]]. Thanks to [[https://github.com/al3xandru][Alex Popescu]] for reporting.) diff --git a/org-ql.el b/org-ql.el index 2bc33f5..d1f13a3 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.5-pre +;; Version: 0.8.5 ;; 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 f17deee..ec5076b 100644 --- a/org-ql.info +++ b/org-ql.info @@ -72,7 +72,7 @@ Functions / Macros Changelog -* 0.8.5-pre: 085-pre. +* 0.8.5: 085. * 0.8.4: 084. * 0.8.3: 083. * 0.8.2: 082. @@ -1033,7 +1033,7 @@ releases. * Menu: -* 0.8.5-pre: 085-pre. +* 0.8.5: 085. * 0.8.4: 084. * 0.8.3: 083. * 0.8.2: 082. @@ -1071,10 +1071,10 @@ releases. * 0.1: 01.  -File: README.info, Node: 085-pre, Next: 084, Up: Changelog +File: README.info, Node: 085, Next: 084, Up: Changelog -5.1 0.8.5-pre -============= +5.1 0.8.5 +========= *Fixes* • Predicate ‘heading’ incorrectly matched strings as regular @@ -1088,7 +1088,7 @@ File: README.info, Node: 085-pre, Next: 084, Up: Changelog Gabriele Mongiano (https://github.com/kofm) for reporting.)  -File: README.info, Node: 084, Next: 083, Prev: 085-pre, Up: Changelog +File: README.info, Node: 084, Next: 083, Prev: 085, Up: Changelog 5.2 0.8.4 ========= @@ -1952,81 +1952,81 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1929 -Node: Screenshots2052 -Node: Installation2170 -Node: Quelpa2684 -Node: Helm support3212 -Node: Usage3615 -Node: Commands4013 -Node: org-ql-find4478 -Node: org-ql-open-link5386 -Node: org-ql-refile6241 -Node: org-ql-search6569 -Node: helm-org-ql8500 -Node: org-ql-view8878 -Node: org-ql-view-sidebar9408 -Node: org-ql-view-recent-items9788 -Node: org-ql-sparse-tree10284 -Node: Queries11084 -Node: Non-sexp query syntax12201 -Node: General predicates13960 -Node: Ancestor/descendant predicates20885 -Node: Date/time predicates22013 -Node: Functions / Macros25137 -Node: Agenda-like views25435 -Ref: Function org-ql-block25597 -Node: Listing / acting-on results26858 -Ref: Caching27066 -Ref: Function org-ql-select27979 -Ref: Function org-ql-query30405 -Ref: Macro org-ql (deprecated)32179 -Node: Custom predicates32494 -Ref: Macro org-ql-defpred32718 -Node: Dynamic block36159 -Node: Links38883 -Node: Tips39570 -Node: Changelog39894 -Node: 085-pre40788 -Node: 08441444 -Node: 08341900 -Node: 08242241 -Node: 08142634 -Node: 0843055 -Node: 07445779 -Node: 07346002 -Node: 07246734 -Node: 07147653 -Node: 0748464 -Node: 06351330 -Node: 06251863 -Node: 06152170 -Node: 0652740 -Node: 05255796 -Node: 05156098 -Node: 0556523 -Node: 04958054 -Node: 04858336 -Node: 04758685 -Node: 04659094 -Node: 04559502 -Node: 04459863 -Node: 04360222 -Node: 04260425 -Node: 04160586 -Node: 0460833 -Node: 03264934 -Node: 03165337 -Node: 0365534 -Node: 02368834 -Node: 02269068 -Node: 02169348 -Node: 0269553 -Node: 0173631 -Node: Notes73732 -Node: Comparison with Org Agenda searches73894 -Node: org-sidebar74783 -Node: License75062 +Node: Contents1921 +Node: Screenshots2044 +Node: Installation2162 +Node: Quelpa2676 +Node: Helm support3204 +Node: Usage3607 +Node: Commands4005 +Node: org-ql-find4470 +Node: org-ql-open-link5378 +Node: org-ql-refile6233 +Node: org-ql-search6561 +Node: helm-org-ql8492 +Node: org-ql-view8870 +Node: org-ql-view-sidebar9400 +Node: org-ql-view-recent-items9780 +Node: org-ql-sparse-tree10276 +Node: Queries11076 +Node: Non-sexp query syntax12193 +Node: General predicates13952 +Node: Ancestor/descendant predicates20877 +Node: Date/time predicates22005 +Node: Functions / Macros25129 +Node: Agenda-like views25427 +Ref: Function org-ql-block25589 +Node: Listing / acting-on results26850 +Ref: Caching27058 +Ref: Function org-ql-select27971 +Ref: Function org-ql-query30397 +Ref: Macro org-ql (deprecated)32171 +Node: Custom predicates32486 +Ref: Macro org-ql-defpred32710 +Node: Dynamic block36151 +Node: Links38875 +Node: Tips39562 +Node: Changelog39886 +Node: 08540772 +Node: 08441416 +Node: 08341868 +Node: 08242209 +Node: 08142602 +Node: 0843023 +Node: 07445747 +Node: 07345970 +Node: 07246702 +Node: 07147621 +Node: 0748432 +Node: 06351298 +Node: 06251831 +Node: 06152138 +Node: 0652708 +Node: 05255764 +Node: 05156066 +Node: 0556491 +Node: 04958022 +Node: 04858304 +Node: 04758653 +Node: 04659062 +Node: 04559470 +Node: 04459831 +Node: 04360190 +Node: 04260393 +Node: 04160554 +Node: 0460801 +Node: 03264902 +Node: 03165305 +Node: 0365502 +Node: 02368802 +Node: 02269036 +Node: 02169316 +Node: 0269521 +Node: 0173599 +Node: Notes73700 +Node: Comparison with Org Agenda searches73862 +Node: org-sidebar74751 +Node: License75030  End Tag Table From e41fe9018a4699532ec875bedddc9746f8e362aa Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 21 Feb 2024 20:00:39 -0600 Subject: [PATCH 091/145] Docs: Add development section --- README.org | 9 +++ org-ql.info | 200 ++++++++++++++++++++++++++++++---------------------- 2 files changed, 126 insertions(+), 83 deletions(-) diff --git a/README.org b/README.org index 947a37e..0e11006 100644 --- a/README.org +++ b/README.org @@ -19,6 +19,7 @@ It includes three libraries: The =org-ql= library is flexible and may be used as - [[#installation][Installation]] - [[#usage][Usage]] - [[#changelog][Changelog]] +- [[#development][Development]] :END: @@ -949,6 +950,14 @@ Nothing new yet. First tagged release. +* Development + +Bug reports, feature requests, and suggestions are welcome. For patches, see below. + +** Copyright assignment + +While Org QL is currently distributed in MELPA, it's [[https://github.com/alphapapa/org-ql/issues/409][intended]] to merge Org QL into Org mode. When that happens, it will become a part of Emacs and Org, and therefore cumulative contributions of more than 15 lines of code will require that the author assign copyright of such contributions to the FSF. Authors who are interested in doing so may contact [[mailto:assign@gnu.org][assign@gnu.org]] to request the appropriate form. + * Notes :PROPERTIES: :TOC: :ignore this diff --git a/org-ql.info b/org-ql.info index fb0383c..0ecc336 100644 --- a/org-ql.info +++ b/org-ql.info @@ -26,6 +26,7 @@ and saved views. * Installation:: * Usage:: * Changelog:: +* Development:: * Notes:: * License:: @@ -110,6 +111,10 @@ Changelog * 0.2: 02. * 0.1: 01. +Development + +* Copyright assignment:: + Notes * Comparison with Org Agenda searches:: @@ -122,7 +127,7 @@ File: README.info, Node: Contents, Next: Screenshots, Prev: Top, Up: Top 1 Contents ********** - • • • • + • • • • •  File: README.info, Node: Screenshots, Next: Installation, Prev: Contents, Up: Top @@ -1021,7 +1026,7 @@ File: README.info, Node: Tips, Prev: Links, Up: Usage (https://github.com/alphapapa/burly.el).  -File: README.info, Node: Changelog, Next: Notes, Prev: Usage, Up: Top +File: README.info, Node: Changelog, Next: Development, Prev: Usage, Up: Top 5 Changelog *********** @@ -1910,9 +1915,36 @@ File: README.info, Node: 01, Prev: 02, Up: Changelog First tagged release.  -File: README.info, Node: Notes, Next: License, Prev: Changelog, Up: Top +File: README.info, Node: Development, Next: Notes, Prev: Changelog, Up: Top -6 Notes +6 Development +************* + +Bug reports, feature requests, and suggestions are welcome. For +patches, see below. + +* Menu: + +* Copyright assignment:: + + +File: README.info, Node: Copyright assignment, Up: Development + +6.1 Copyright assignment +======================== + +While Org QL is currently distributed in MELPA, it’s intended +(https://github.com/alphapapa/org-ql/issues/409) to merge Org QL into +Org mode. When that happens, it will become a part of Emacs and Org, +and therefore cumulative contributions of more than 15 lines of code +will require that the author assign copyright of such contributions to +the FSF. Authors who are interested in doing so may contact +assign@gnu.org to request the appropriate form. + + +File: README.info, Node: Notes, Next: License, Prev: Development, Up: Top + +7 Notes ******* * Menu: @@ -1923,7 +1955,7 @@ File: README.info, Node: Notes, Next: License, Prev: Changelog, Up: Top  File: README.info, Node: Comparison with Org Agenda searches, Next: org-sidebar, Up: Notes -6.1 Comparison with Org Agenda searches +7.1 Comparison with Org Agenda searches ======================================= Of course, queries like these can already be written with Org Agenda @@ -1943,7 +1975,7 @@ todo:TO-READ’, or in Lisp syntax, ‘(and "lisp" (todo "TO-READ"))’.  File: README.info, Node: org-sidebar, Prev: Comparison with Org Agenda searches, Up: Notes -6.2 org-sidebar +7.2 org-sidebar =============== This package is used by org-sidebar @@ -1953,7 +1985,7 @@ customizable agenda-like view in a sidebar window.  File: README.info, Node: License, Prev: Notes, Up: Top -7 License +8 License ********* GPLv3 @@ -1962,82 +1994,84 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1940 -Node: Screenshots2063 -Node: Installation2181 -Node: Quelpa2695 -Node: Helm support3223 -Node: Usage3626 -Node: Commands4024 -Node: org-ql-find4489 -Node: org-ql-open-link5397 -Node: org-ql-refile6252 -Node: org-ql-search6580 -Node: helm-org-ql8511 -Node: org-ql-view8889 -Node: org-ql-view-sidebar9419 -Node: org-ql-view-recent-items9799 -Node: org-ql-sparse-tree10295 -Node: Queries11095 -Node: Non-sexp query syntax12212 -Node: General predicates13971 -Node: Ancestor/descendant predicates20896 -Node: Date/time predicates22024 -Node: Functions / Macros25148 -Node: Agenda-like views25446 -Ref: Function org-ql-block25608 -Node: Listing / acting-on results26869 -Ref: Caching27077 -Ref: Function org-ql-select27990 -Ref: Function org-ql-query30416 -Ref: Macro org-ql (deprecated)32190 -Node: Custom predicates32505 -Ref: Macro org-ql-defpred32729 -Node: Dynamic block36170 -Node: Links38894 -Node: Tips39581 -Node: Changelog39905 -Node: 09-pre40810 -Node: 08540917 -Node: 08441576 -Node: 08342028 -Node: 08242369 -Node: 08142762 -Node: 0843183 -Node: 07445907 -Node: 07346130 -Node: 07246862 -Node: 07147783 -Node: 0748594 -Node: 06351460 -Node: 06251993 -Node: 06152300 -Node: 0652870 -Node: 05255926 -Node: 05156228 -Node: 0556653 -Node: 04958184 -Node: 04858466 -Node: 04758815 -Node: 04659224 -Node: 04559632 -Node: 04459993 -Node: 04360352 -Node: 04260555 -Node: 04160716 -Node: 0460963 -Node: 03265064 -Node: 03165467 -Node: 0365664 -Node: 02368964 -Node: 02269198 -Node: 02169478 -Node: 0269683 -Node: 0173761 -Node: Notes73862 -Node: Comparison with Org Agenda searches74024 -Node: org-sidebar74913 -Node: License75192 +Node: Contents1995 +Node: Screenshots2122 +Node: Installation2240 +Node: Quelpa2754 +Node: Helm support3282 +Node: Usage3685 +Node: Commands4083 +Node: org-ql-find4548 +Node: org-ql-open-link5456 +Node: org-ql-refile6311 +Node: org-ql-search6639 +Node: helm-org-ql8570 +Node: org-ql-view8948 +Node: org-ql-view-sidebar9478 +Node: org-ql-view-recent-items9858 +Node: org-ql-sparse-tree10354 +Node: Queries11154 +Node: Non-sexp query syntax12271 +Node: General predicates14030 +Node: Ancestor/descendant predicates20955 +Node: Date/time predicates22083 +Node: Functions / Macros25207 +Node: Agenda-like views25505 +Ref: Function org-ql-block25667 +Node: Listing / acting-on results26928 +Ref: Caching27136 +Ref: Function org-ql-select28049 +Ref: Function org-ql-query30475 +Ref: Macro org-ql (deprecated)32249 +Node: Custom predicates32564 +Ref: Macro org-ql-defpred32788 +Node: Dynamic block36229 +Node: Links38953 +Node: Tips39640 +Node: Changelog39964 +Node: 09-pre40875 +Node: 08540982 +Node: 08441641 +Node: 08342093 +Node: 08242434 +Node: 08142827 +Node: 0843248 +Node: 07445972 +Node: 07346195 +Node: 07246927 +Node: 07147848 +Node: 0748659 +Node: 06351525 +Node: 06252058 +Node: 06152365 +Node: 0652935 +Node: 05255991 +Node: 05156293 +Node: 0556718 +Node: 04958249 +Node: 04858531 +Node: 04758880 +Node: 04659289 +Node: 04559697 +Node: 04460058 +Node: 04360417 +Node: 04260620 +Node: 04160781 +Node: 0461028 +Node: 03265129 +Node: 03165532 +Node: 0365729 +Node: 02369029 +Node: 02269263 +Node: 02169543 +Node: 0269748 +Node: 0173826 +Node: Development73927 +Node: Copyright assignment74160 +Node: Notes74750 +Node: Comparison with Org Agenda searches74914 +Node: org-sidebar75803 +Node: License76082  End Tag Table From d3f6dde344e7e499b6a5da7cae85472044248840 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 3 Apr 2024 15:25:06 -0500 Subject: [PATCH 092/145] Meta: v0.8.6-pre --- README.org | 4 + org-ql.el | 2 +- org-ql.info | 237 +++++++++++++++++++++++++++------------------------- 3 files changed, 129 insertions(+), 114 deletions(-) diff --git a/README.org b/README.org index 39f18c5..cf74b52 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.6-pre + +Nothing new yet. + ** 0.8.5 *Fixes* diff --git a/org-ql.el b/org-ql.el index d1f13a3..bae593b 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.5 +;; Version: 0.8.6-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 ec5076b..25c1f11 100644 --- a/org-ql.info +++ b/org-ql.info @@ -72,6 +72,7 @@ Functions / Macros Changelog +* 0.8.6-pre: 086-pre. * 0.8.5: 085. * 0.8.4: 084. * 0.8.3: 083. @@ -1033,6 +1034,7 @@ releases. * Menu: +* 0.8.6-pre: 086-pre. * 0.8.5: 085. * 0.8.4: 084. * 0.8.3: 083. @@ -1071,9 +1073,17 @@ releases. * 0.1: 01.  -File: README.info, Node: 085, Next: 084, Up: Changelog +File: README.info, Node: 086-pre, Next: 085, Up: Changelog -5.1 0.8.5 +5.1 0.8.6-pre +============= + +Nothing new yet. + + +File: README.info, Node: 085, Next: 084, Prev: 086-pre, Up: Changelog + +5.2 0.8.5 ========= *Fixes* @@ -1090,7 +1100,7 @@ File: README.info, Node: 085, Next: 084, Up: Changelog  File: README.info, Node: 084, Next: 083, Prev: 085, Up: Changelog -5.2 0.8.4 +5.3 0.8.4 ========= *Fixes* @@ -1104,7 +1114,7 @@ File: README.info, Node: 084, Next: 083, Prev: 085, Up: Changelog  File: README.info, Node: 083, Next: 082, Prev: 084, Up: Changelog -5.3 0.8.3 +5.4 0.8.3 ========= *Fixes* @@ -1117,7 +1127,7 @@ File: README.info, Node: 083, Next: 082, Prev: 084, Up: Changelog  File: README.info, Node: 082, Next: 081, Prev: 083, Up: Changelog -5.4 0.8.2 +5.5 0.8.2 ========= *Fixes* @@ -1131,7 +1141,7 @@ File: README.info, Node: 082, Next: 081, Prev: 083, Up: Changelog  File: README.info, Node: 081, Next: 08, Prev: 082, Up: Changelog -5.5 0.8.1 +5.6 0.8.1 ========= *Fixes* @@ -1146,7 +1156,7 @@ File: README.info, Node: 081, Next: 08, Prev: 082, Up: Changelog  File: README.info, Node: 08, Next: 074, Prev: 081, Up: Changelog -5.6 0.8 +5.7 0.8 ======= *Additions* @@ -1202,7 +1212,7 @@ File: README.info, Node: 08, Next: 074, Prev: 081, Up: Changelog  File: README.info, Node: 074, Next: 073, Prev: 08, Up: Changelog -5.7 0.7.4 +5.8 0.7.4 ========= *Fixes* @@ -1212,7 +1222,7 @@ File: README.info, Node: 074, Next: 073, Prev: 08, Up: Changelog  File: README.info, Node: 073, Next: 072, Prev: 074, Up: Changelog -5.8 0.7.3 +5.9 0.7.3 ========= *Fixes* @@ -1230,8 +1240,8 @@ File: README.info, Node: 073, Next: 072, Prev: 074, Up: Changelog  File: README.info, Node: 072, Next: 071, Prev: 073, Up: Changelog -5.9 0.7.2 -========= +5.10 0.7.2 +========== *Fixes* • Timestamp predicates are more tolerant of partial input (e.g. @@ -1251,7 +1261,7 @@ File: README.info, Node: 072, Next: 071, Prev: 073, Up: Changelog  File: README.info, Node: 071, Next: 07, Prev: 072, Up: Changelog -5.10 0.7.1 +5.11 0.7.1 ========== *Fixes* @@ -1270,7 +1280,7 @@ File: README.info, Node: 071, Next: 07, Prev: 072, Up: Changelog  File: README.info, Node: 07, Next: 063, Prev: 071, Up: Changelog -5.11 0.7 +5.12 0.7 ======== *Added* @@ -1329,7 +1339,7 @@ File: README.info, Node: 07, Next: 063, Prev: 071, Up: Changelog  File: README.info, Node: 063, Next: 062, Prev: 07, Up: Changelog -5.12 0.6.3 +5.13 0.6.3 ========== *Fixed* @@ -1345,7 +1355,7 @@ File: README.info, Node: 063, Next: 062, Prev: 07, Up: Changelog  File: README.info, Node: 062, Next: 061, Prev: 063, Up: Changelog -5.13 0.6.2 +5.14 0.6.2 ========== *Fixed* @@ -1356,7 +1366,7 @@ File: README.info, Node: 062, Next: 061, Prev: 063, Up: Changelog  File: README.info, Node: 061, Next: 06, Prev: 062, Up: Changelog -5.14 0.6.1 +5.15 0.6.1 ========== *Fixed* @@ -1374,7 +1384,7 @@ File: README.info, Node: 061, Next: 06, Prev: 062, Up: Changelog  File: README.info, Node: 06, Next: 052, Prev: 061, Up: Changelog -5.15 0.6 +5.16 0.6 ======== *Added* @@ -1441,7 +1451,7 @@ File: README.info, Node: 06, Next: 052, Prev: 061, Up: Changelog  File: README.info, Node: 052, Next: 051, Prev: 06, Up: Changelog -5.16 0.5.2 +5.17 0.5.2 ========== *Fixed* @@ -1452,7 +1462,7 @@ File: README.info, Node: 052, Next: 051, Prev: 06, Up: Changelog  File: README.info, Node: 051, Next: 05, Prev: 052, Up: Changelog -5.17 0.5.1 +5.18 0.5.1 ========== *Fixed* @@ -1465,7 +1475,7 @@ File: README.info, Node: 051, Next: 05, Prev: 052, Up: Changelog  File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog -5.18 0.5 +5.19 0.5 ======== *Added* @@ -1506,7 +1516,7 @@ File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog  File: README.info, Node: 049, Next: 048, Prev: 05, Up: Changelog -5.19 0.4.9 +5.20 0.4.9 ========== *Fixed* @@ -1517,7 +1527,7 @@ File: README.info, Node: 049, Next: 048, Prev: 05, Up: Changelog  File: README.info, Node: 048, Next: 047, Prev: 049, Up: Changelog -5.20 0.4.8 +5.21 0.4.8 ========== *Fixed* @@ -1529,7 +1539,7 @@ File: README.info, Node: 048, Next: 047, Prev: 049, Up: Changelog  File: README.info, Node: 047, Next: 046, Prev: 048, Up: Changelog -5.21 0.4.7 +5.22 0.4.7 ========== *Fixed* @@ -1542,7 +1552,7 @@ File: README.info, Node: 047, Next: 046, Prev: 048, Up: Changelog  File: README.info, Node: 046, Next: 045, Prev: 047, Up: Changelog -5.22 0.4.6 +5.23 0.4.6 ========== *Fixed* @@ -1555,7 +1565,7 @@ File: README.info, Node: 046, Next: 045, Prev: 047, Up: Changelog  File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog -5.23 0.4.5 +5.24 0.4.5 ========== *Fixed* @@ -1567,7 +1577,7 @@ File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog  File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog -5.24 0.4.4 +5.25 0.4.4 ========== *Fixed* @@ -1579,7 +1589,7 @@ File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog  File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog -5.25 0.4.3 +5.26 0.4.3 ========== *Fixed* @@ -1589,7 +1599,7 @@ File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog  File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog -5.26 0.4.2 +5.27 0.4.2 ========== *Fixed* @@ -1598,7 +1608,7 @@ File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog  File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog -5.27 0.4.1 +5.28 0.4.1 ========== *Fixed* @@ -1608,7 +1618,7 @@ File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog  File: README.info, Node: 04, Next: 032, Prev: 041, Up: Changelog -5.28 0.4 +5.29 0.4 ======== _Note:_ The next release, 0.5, may include changes which will require @@ -1689,7 +1699,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.29 0.3.2 +5.30 0.3.2 ========== *Fixed* @@ -1702,7 +1712,7 @@ File: README.info, Node: 032, Next: 031, Prev: 04, Up: Changelog  File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog -5.30 0.3.1 +5.31 0.3.1 ========== *Fixed* @@ -1712,7 +1722,7 @@ File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog  File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog -5.31 0.3 +5.32 0.3 ======== *Added* @@ -1780,7 +1790,7 @@ File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog  File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog -5.32 0.2.3 +5.33 0.2.3 ========== *Fixed* @@ -1790,7 +1800,7 @@ File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog  File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog -5.33 0.2.2 +5.34 0.2.2 ========== *Fixed* @@ -1801,7 +1811,7 @@ File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog  File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog -5.34 0.2.1 +5.35 0.2.1 ========== *Fixed* @@ -1811,7 +1821,7 @@ File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog  File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog -5.35 0.2 +5.36 0.2 ======== *Added* @@ -1894,7 +1904,7 @@ File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog  File: README.info, Node: 01, Prev: 02, Up: Changelog -5.36 0.1 +5.37 0.1 ======== First tagged release. @@ -1952,81 +1962,82 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1921 -Node: Screenshots2044 -Node: Installation2162 -Node: Quelpa2676 -Node: Helm support3204 -Node: Usage3607 -Node: Commands4005 -Node: org-ql-find4470 -Node: org-ql-open-link5378 -Node: org-ql-refile6233 -Node: org-ql-search6561 -Node: helm-org-ql8492 -Node: org-ql-view8870 -Node: org-ql-view-sidebar9400 -Node: org-ql-view-recent-items9780 -Node: org-ql-sparse-tree10276 -Node: Queries11076 -Node: Non-sexp query syntax12193 -Node: General predicates13952 -Node: Ancestor/descendant predicates20877 -Node: Date/time predicates22005 -Node: Functions / Macros25129 -Node: Agenda-like views25427 -Ref: Function org-ql-block25589 -Node: Listing / acting-on results26850 -Ref: Caching27058 -Ref: Function org-ql-select27971 -Ref: Function org-ql-query30397 -Ref: Macro org-ql (deprecated)32171 -Node: Custom predicates32486 -Ref: Macro org-ql-defpred32710 -Node: Dynamic block36151 -Node: Links38875 -Node: Tips39562 -Node: Changelog39886 -Node: 08540772 -Node: 08441416 -Node: 08341868 -Node: 08242209 -Node: 08142602 -Node: 0843023 -Node: 07445747 -Node: 07345970 -Node: 07246702 -Node: 07147621 -Node: 0748432 -Node: 06351298 -Node: 06251831 -Node: 06152138 -Node: 0652708 -Node: 05255764 -Node: 05156066 -Node: 0556491 -Node: 04958022 -Node: 04858304 -Node: 04758653 -Node: 04659062 -Node: 04559470 -Node: 04459831 -Node: 04360190 -Node: 04260393 -Node: 04160554 -Node: 0460801 -Node: 03264902 -Node: 03165305 -Node: 0365502 -Node: 02368802 -Node: 02269036 -Node: 02169316 -Node: 0269521 -Node: 0173599 -Node: Notes73700 -Node: Comparison with Org Agenda searches73862 -Node: org-sidebar74751 -Node: License75030 +Node: Contents1943 +Node: Screenshots2066 +Node: Installation2184 +Node: Quelpa2698 +Node: Helm support3226 +Node: Usage3629 +Node: Commands4027 +Node: org-ql-find4492 +Node: org-ql-open-link5400 +Node: org-ql-refile6255 +Node: org-ql-search6583 +Node: helm-org-ql8514 +Node: org-ql-view8892 +Node: org-ql-view-sidebar9422 +Node: org-ql-view-recent-items9802 +Node: org-ql-sparse-tree10298 +Node: Queries11098 +Node: Non-sexp query syntax12215 +Node: General predicates13974 +Node: Ancestor/descendant predicates20899 +Node: Date/time predicates22027 +Node: Functions / Macros25151 +Node: Agenda-like views25449 +Ref: Function org-ql-block25611 +Node: Listing / acting-on results26872 +Ref: Caching27080 +Ref: Function org-ql-select27993 +Ref: Function org-ql-query30419 +Ref: Macro org-ql (deprecated)32193 +Node: Custom predicates32508 +Ref: Macro org-ql-defpred32732 +Node: Dynamic block36173 +Node: Links38897 +Node: Tips39584 +Node: Changelog39908 +Node: 086-pre40816 +Node: 08540928 +Node: 08441588 +Node: 08342040 +Node: 08242381 +Node: 08142774 +Node: 0843195 +Node: 07445919 +Node: 07346142 +Node: 07246874 +Node: 07147795 +Node: 0748606 +Node: 06351472 +Node: 06252005 +Node: 06152312 +Node: 0652882 +Node: 05255938 +Node: 05156240 +Node: 0556665 +Node: 04958196 +Node: 04858478 +Node: 04758827 +Node: 04659236 +Node: 04559644 +Node: 04460005 +Node: 04360364 +Node: 04260567 +Node: 04160728 +Node: 0460975 +Node: 03265076 +Node: 03165479 +Node: 0365676 +Node: 02368976 +Node: 02269210 +Node: 02169490 +Node: 0269695 +Node: 0173773 +Node: Notes73874 +Node: Comparison with Org Agenda searches74036 +Node: org-sidebar74925 +Node: License75204  End Tag Table From 8bd73b4b469ce29f54c1c9dcf27d71507d82437a Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 3 Apr 2024 15:25:58 -0500 Subject: [PATCH 093/145] Fix: (org-ql-view-bookmark-make-record) buffers-files as symbol --- README.org | 3 +- org-ql-view.el | 1 + org-ql.info | 84 ++++++++++++++++++++++++++------------------------ 3 files changed, 46 insertions(+), 42 deletions(-) diff --git a/README.org b/README.org index cf74b52..19eb49e 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.6-pre -Nothing new yet. +*Fixes* ++ Bookmarking ~org-ql-view~ buffers when the ~buffers-files~ argument is a symbol (like ~org-agenda-files~). ** 0.8.5 diff --git a/org-ql-view.el b/org-ql-view.el index 4d3c8c3..41ada72 100644 --- a/org-ql-view.el +++ b/org-ql-view.el @@ -548,6 +548,7 @@ dates in the past, and negative for dates in the future." ;; Replace buffers with their filenames, and signal error if any are not file-backed. (setf plist (plist-put plist :buffers-files (cl-etypecase buffers-files + (symbol buffers-files) (string buffers-files) (buffer (file-nameize buffers-files)) (list (mapcar #'file-nameize buffers-files))))) diff --git a/org-ql.info b/org-ql.info index 25c1f11..1e920e7 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1078,7 +1078,9 @@ File: README.info, Node: 086-pre, Next: 085, Up: Changelog 5.1 0.8.6-pre ============= -Nothing new yet. +*Fixes* + • Bookmarking ‘org-ql-view’ buffers when the ‘buffers-files’ argument + is a symbol (like ‘org-agenda-files’).  File: README.info, Node: 085, Next: 084, Prev: 086-pre, Up: Changelog @@ -1998,46 +2000,46 @@ Node: Links38897 Node: Tips39584 Node: Changelog39908 Node: 086-pre40816 -Node: 08540928 -Node: 08441588 -Node: 08342040 -Node: 08242381 -Node: 08142774 -Node: 0843195 -Node: 07445919 -Node: 07346142 -Node: 07246874 -Node: 07147795 -Node: 0748606 -Node: 06351472 -Node: 06252005 -Node: 06152312 -Node: 0652882 -Node: 05255938 -Node: 05156240 -Node: 0556665 -Node: 04958196 -Node: 04858478 -Node: 04758827 -Node: 04659236 -Node: 04559644 -Node: 04460005 -Node: 04360364 -Node: 04260567 -Node: 04160728 -Node: 0460975 -Node: 03265076 -Node: 03165479 -Node: 0365676 -Node: 02368976 -Node: 02269210 -Node: 02169490 -Node: 0269695 -Node: 0173773 -Node: Notes73874 -Node: Comparison with Org Agenda searches74036 -Node: org-sidebar74925 -Node: License75204 +Node: 08541050 +Node: 08441710 +Node: 08342162 +Node: 08242503 +Node: 08142896 +Node: 0843317 +Node: 07446041 +Node: 07346264 +Node: 07246996 +Node: 07147917 +Node: 0748728 +Node: 06351594 +Node: 06252127 +Node: 06152434 +Node: 0653004 +Node: 05256060 +Node: 05156362 +Node: 0556787 +Node: 04958318 +Node: 04858600 +Node: 04758949 +Node: 04659358 +Node: 04559766 +Node: 04460127 +Node: 04360486 +Node: 04260689 +Node: 04160850 +Node: 0461097 +Node: 03265198 +Node: 03165601 +Node: 0365798 +Node: 02369098 +Node: 02269332 +Node: 02169612 +Node: 0269817 +Node: 0173895 +Node: Notes73996 +Node: Comparison with Org Agenda searches74158 +Node: org-sidebar75047 +Node: License75326  End Tag Table From 1f264bf4649dc2ad90f16a763794561ee6164d84 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 3 Apr 2024 15:26:33 -0500 Subject: [PATCH 094/145] Release: v0.8.6 --- README.org | 2 +- org-ql.el | 2 +- org-ql.info | 164 ++++++++++++++++++++++++++-------------------------- 3 files changed, 84 insertions(+), 84 deletions(-) diff --git a/README.org b/README.org index 19eb49e..e4f791e 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.6-pre +** 0.8.6 *Fixes* + Bookmarking ~org-ql-view~ buffers when the ~buffers-files~ argument is a symbol (like ~org-agenda-files~). diff --git a/org-ql.el b/org-ql.el index bae593b..f8a84bb 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.6-pre +;; Version: 0.8.6 ;; 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 1e920e7..519a64f 100644 --- a/org-ql.info +++ b/org-ql.info @@ -72,7 +72,7 @@ Functions / Macros Changelog -* 0.8.6-pre: 086-pre. +* 0.8.6: 086. * 0.8.5: 085. * 0.8.4: 084. * 0.8.3: 083. @@ -1034,7 +1034,7 @@ releases. * Menu: -* 0.8.6-pre: 086-pre. +* 0.8.6: 086. * 0.8.5: 085. * 0.8.4: 084. * 0.8.3: 083. @@ -1073,17 +1073,17 @@ releases. * 0.1: 01.  -File: README.info, Node: 086-pre, Next: 085, Up: Changelog +File: README.info, Node: 086, Next: 085, Up: Changelog -5.1 0.8.6-pre -============= +5.1 0.8.6 +========= *Fixes* • Bookmarking ‘org-ql-view’ buffers when the ‘buffers-files’ argument is a symbol (like ‘org-agenda-files’).  -File: README.info, Node: 085, Next: 084, Prev: 086-pre, Up: Changelog +File: README.info, Node: 085, Next: 084, Prev: 086, Up: Changelog 5.2 0.8.5 ========= @@ -1964,82 +1964,82 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1943 -Node: Screenshots2066 -Node: Installation2184 -Node: Quelpa2698 -Node: Helm support3226 -Node: Usage3629 -Node: Commands4027 -Node: org-ql-find4492 -Node: org-ql-open-link5400 -Node: org-ql-refile6255 -Node: org-ql-search6583 -Node: helm-org-ql8514 -Node: org-ql-view8892 -Node: org-ql-view-sidebar9422 -Node: org-ql-view-recent-items9802 -Node: org-ql-sparse-tree10298 -Node: Queries11098 -Node: Non-sexp query syntax12215 -Node: General predicates13974 -Node: Ancestor/descendant predicates20899 -Node: Date/time predicates22027 -Node: Functions / Macros25151 -Node: Agenda-like views25449 -Ref: Function org-ql-block25611 -Node: Listing / acting-on results26872 -Ref: Caching27080 -Ref: Function org-ql-select27993 -Ref: Function org-ql-query30419 -Ref: Macro org-ql (deprecated)32193 -Node: Custom predicates32508 -Ref: Macro org-ql-defpred32732 -Node: Dynamic block36173 -Node: Links38897 -Node: Tips39584 -Node: Changelog39908 -Node: 086-pre40816 -Node: 08541050 -Node: 08441710 -Node: 08342162 -Node: 08242503 -Node: 08142896 -Node: 0843317 -Node: 07446041 -Node: 07346264 -Node: 07246996 -Node: 07147917 -Node: 0748728 -Node: 06351594 -Node: 06252127 -Node: 06152434 -Node: 0653004 -Node: 05256060 -Node: 05156362 -Node: 0556787 -Node: 04958318 -Node: 04858600 -Node: 04758949 -Node: 04659358 -Node: 04559766 -Node: 04460127 -Node: 04360486 -Node: 04260689 -Node: 04160850 -Node: 0461097 -Node: 03265198 -Node: 03165601 -Node: 0365798 -Node: 02369098 -Node: 02269332 -Node: 02169612 -Node: 0269817 -Node: 0173895 -Node: Notes73996 -Node: Comparison with Org Agenda searches74158 -Node: org-sidebar75047 -Node: License75326 +Node: Contents1935 +Node: Screenshots2058 +Node: Installation2176 +Node: Quelpa2690 +Node: Helm support3218 +Node: Usage3621 +Node: Commands4019 +Node: org-ql-find4484 +Node: org-ql-open-link5392 +Node: org-ql-refile6247 +Node: org-ql-search6575 +Node: helm-org-ql8506 +Node: org-ql-view8884 +Node: org-ql-view-sidebar9414 +Node: org-ql-view-recent-items9794 +Node: org-ql-sparse-tree10290 +Node: Queries11090 +Node: Non-sexp query syntax12207 +Node: General predicates13966 +Node: Ancestor/descendant predicates20891 +Node: Date/time predicates22019 +Node: Functions / Macros25143 +Node: Agenda-like views25441 +Ref: Function org-ql-block25603 +Node: Listing / acting-on results26864 +Ref: Caching27072 +Ref: Function org-ql-select27985 +Ref: Function org-ql-query30411 +Ref: Macro org-ql (deprecated)32185 +Node: Custom predicates32500 +Ref: Macro org-ql-defpred32724 +Node: Dynamic block36165 +Node: Links38889 +Node: Tips39576 +Node: Changelog39900 +Node: 08640800 +Node: 08541022 +Node: 08441678 +Node: 08342130 +Node: 08242471 +Node: 08142864 +Node: 0843285 +Node: 07446009 +Node: 07346232 +Node: 07246964 +Node: 07147885 +Node: 0748696 +Node: 06351562 +Node: 06252095 +Node: 06152402 +Node: 0652972 +Node: 05256028 +Node: 05156330 +Node: 0556755 +Node: 04958286 +Node: 04858568 +Node: 04758917 +Node: 04659326 +Node: 04559734 +Node: 04460095 +Node: 04360454 +Node: 04260657 +Node: 04160818 +Node: 0461065 +Node: 03265166 +Node: 03165569 +Node: 0365766 +Node: 02369066 +Node: 02269300 +Node: 02169580 +Node: 0269785 +Node: 0173863 +Node: Notes73964 +Node: Comparison with Org Agenda searches74126 +Node: org-sidebar75015 +Node: License75294  End Tag Table From 0f01f0a9d8a23cf48e5801e9365c84537e927b3b Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 12 Jun 2024 22:47:33 -0500 Subject: [PATCH 095/145] Tidy: Compilation warnings --- org-ql-completing-read.el | 1 + org-ql-find.el | 2 ++ org-ql-search.el | 2 ++ org-ql-view.el | 1 + tests/test-org-ql.el | 2 ++ 5 files changed, 8 insertions(+) diff --git a/org-ql-completing-read.el b/org-ql-completing-read.el index 640033d..18cfd7f 100644 --- a/org-ql-completing-read.el +++ b/org-ql-completing-read.el @@ -27,6 +27,7 @@ (require 'org-ql) (declare-function org-ql-search "org-ql-search") +(declare-function org-ql--normalize-query "org-ql" t t) ;;;; Variables diff --git a/org-ql-find.el b/org-ql-find.el index f6f2b9c..820d2dd 100644 --- a/org-ql-find.el +++ b/org-ql-find.el @@ -33,6 +33,8 @@ (require 'org-ql-search) (require 'org-ql-completing-read) +(declare-function org-ql--normalize-query "org-ql" t t) + ;;;; Customization (defgroup org-ql-find nil diff --git a/org-ql-search.el b/org-ql-search.el index d08397a..9c783b9 100644 --- a/org-ql-search.el +++ b/org-ql-search.el @@ -40,6 +40,8 @@ (require 'org-ql) (require 'org-ql-view) +(declare-function org-ql--normalize-query "org-ql" t t) + ;;;; Compatibility (defalias 'org-ql-search--link-heading-search-string diff --git a/org-ql-view.el b/org-ql-view.el index 5889a56..918fc7f 100644 --- a/org-ql-view.el +++ b/org-ql-view.el @@ -44,6 +44,7 @@ (declare-function org-ql-search "org-ql-search" t) (declare-function org-ql-search--org-link-store-props "org-ql-search" t) +(declare-function org-ql--normalize-query "org-ql" t t) (require 'dash) (require 's) diff --git a/tests/test-org-ql.el b/tests/test-org-ql.el index 8d2b84c..1259004 100644 --- a/tests/test-org-ql.el +++ b/tests/test-org-ql.el @@ -35,6 +35,8 @@ (require 'xr) +(declare-function org-ql--normalize-query "org-ql" t t) + ;;;; Variables (defvar org-ql-test-buffer nil From f7c3a61e32e8da62da1e69a2a79ec5b333a7d1f5 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 12 Jun 2024 22:50:45 -0500 Subject: [PATCH 096/145] Fix: (helm-org-ql [v0.6.2]) Compilation warnings --- README.org | 4 ++ helm-org-ql.el | 22 +++++-- org-ql.info | 175 +++++++++++++++++++++++++++---------------------- 3 files changed, 116 insertions(+), 85 deletions(-) diff --git a/README.org b/README.org index b210126..aebc64a 100644 --- a/README.org +++ b/README.org @@ -558,6 +558,10 @@ Simple links may also be written manually in either sexp or non-sexp form, like: Nothing new yet. +*** helm-org-ql + +Tagged v0.6.2, fixing a compilation warning. + ** 0.8.6 *Fixes* diff --git a/helm-org-ql.el b/helm-org-ql.el index 5d460a5..c6a38a7 100644 --- a/helm-org-ql.el +++ b/helm-org-ql.el @@ -2,8 +2,8 @@ ;; Author: Adam Porter ;; URL: https://github.com/alphapapa/org-ql -;; Version: 0.6.1 -;; Package-Requires: ((emacs "26.1") (dash "2.18.1") (s "1.12.0") (helm-org "1.0") (org-ql "0.6-pre")) +;; Version: 0.6.2 +;; Package-Requires: ((emacs "26.1") (compat "29.1.4.5") (dash "2.18.1") (s "1.12.0") (helm-org "1.0") (org-ql "0.6-pre")) ;;; Commentary: @@ -35,6 +35,7 @@ (require 'cl-lib) (require 'org) +(require 'compat) (require 'dash) (require 's) @@ -44,6 +45,15 @@ (require 'org-ql) (require 'org-ql-search) +(declare-function org-ql--normalize-query "org-ql" t t) + +;;;; Compatibility + +(defalias 'helm-org-ql--show-entry + (if (version< org-version "9.6") + 'org-show-entry + 'org-fold-show-entry)) + ;;;; Variables (defvar helm-org-ql-map @@ -102,7 +112,7 @@ NAME is passed to `helm-org-ql-source', which see. NOTE: Atoms in the query are turned into strings where appropriate, which makes it unnecessary to type quotation marks -around words that are intended to be searched for as indepenent +around words that are intended to be searched for as independent strings. All query tokens are wrapped in the operator BOOLEAN (default @@ -151,7 +161,7 @@ Is transformed into this query: ;; it to go to the previous heading. I don't know why it does that. (switch-to-buffer (marker-buffer marker)) (goto-char marker) - (org-show-entry)) + (helm-org-ql--show-entry)) (defun helm-org-ql-show-marker-indirect (marker) "Show heading at MARKER with `org-tree-to-indirect-buffer'." @@ -177,7 +187,7 @@ Is transformed into this query: ;;;###autoload (cl-defun helm-org-ql-source (buffers-files &key (name "helm-org-ql")) - "Return Helm source named NAME that searches BUFFERS-FILES with `helm-org-ql'." + "Return Helm source named NAME to search BUFFERS-FILES with `helm-org-ql'." ;; Expansion of `helm-build-sync-source' macro. (helm-make-source name 'helm-source-sync :candidates (lambda () @@ -201,7 +211,7 @@ Is transformed into this query: (defun helm-org-ql--heading (window-width) "Return string for Helm for heading at point. WINDOW-WIDTH should be the width of the Helm window." - (font-lock-ensure (point-at-bol) (point-at-eol)) + (font-lock-ensure (pos-bol) (pos-eol)) ;; TODO: It would be better to avoid calculating the prefix and width ;; at each heading, but there's no easy way to do that once in each ;; buffer, unless we manually called `org-ql' in each buffer, which diff --git a/org-ql.info b/org-ql.info index 1f3b1f6..3471e69 100644 --- a/org-ql.info +++ b/org-ql.info @@ -112,6 +112,10 @@ Changelog * 0.2: 02. * 0.1: 01. +0.9-pre + +* helm-org-ql: helm-org-ql (1). + Development * Copyright assignment:: @@ -1087,6 +1091,18 @@ File: README.info, Node: 09-pre, Next: 086, Up: Changelog Nothing new yet. +* Menu: + +* helm-org-ql: helm-org-ql (1). + + +File: README.info, Node: helm-org-ql (1), Up: 09-pre + +5.1.1 helm-org-ql +----------------- + +Tagged v0.6.2, fixing a compilation warning. +  File: README.info, Node: 086, Next: 085, Prev: 09-pre, Up: Changelog @@ -2006,85 +2022,86 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents2009 -Node: Screenshots2136 -Node: Installation2254 -Node: Quelpa2768 -Node: Helm support3296 -Node: Usage3699 -Node: Commands4097 -Node: org-ql-find4562 -Node: org-ql-open-link5470 -Node: org-ql-refile6325 -Node: org-ql-search6653 -Node: helm-org-ql8584 -Node: org-ql-view8962 -Node: org-ql-view-sidebar9492 -Node: org-ql-view-recent-items9872 -Node: org-ql-sparse-tree10368 -Node: Queries11168 -Node: Non-sexp query syntax12285 -Node: General predicates14044 -Node: Ancestor/descendant predicates20969 -Node: Date/time predicates22097 -Node: Functions / Macros25221 -Node: Agenda-like views25519 -Ref: Function org-ql-block25681 -Node: Listing / acting-on results26942 -Ref: Caching27150 -Ref: Function org-ql-select28063 -Ref: Function org-ql-query30489 -Ref: Macro org-ql (deprecated)32263 -Node: Custom predicates32578 -Ref: Macro org-ql-defpred32802 -Node: Dynamic block36243 -Node: Links38967 -Node: Tips39654 -Node: Changelog39978 -Node: 09-pre40903 -Node: 08641010 -Node: 08541247 -Node: 08441903 -Node: 08342355 -Node: 08242696 -Node: 08143089 -Node: 0843510 -Node: 07446234 -Node: 07346457 -Node: 07247191 -Node: 07148112 -Node: 0748923 -Node: 06351789 -Node: 06252322 -Node: 06152629 -Node: 0653199 -Node: 05256255 -Node: 05156557 -Node: 0556982 -Node: 04958513 -Node: 04858795 -Node: 04759144 -Node: 04659553 -Node: 04559961 -Node: 04460322 -Node: 04360681 -Node: 04260884 -Node: 04161045 -Node: 0461292 -Node: 03265393 -Node: 03165796 -Node: 0365993 -Node: 02369293 -Node: 02269527 -Node: 02169807 -Node: 0270012 -Node: 0174090 -Node: Development74191 -Node: Copyright assignment74424 -Node: Notes75014 -Node: Comparison with Org Agenda searches75178 -Node: org-sidebar76067 -Node: License76346 +Node: Contents2051 +Node: Screenshots2178 +Node: Installation2296 +Node: Quelpa2810 +Node: Helm support3338 +Node: Usage3741 +Node: Commands4139 +Node: org-ql-find4604 +Node: org-ql-open-link5512 +Node: org-ql-refile6367 +Node: org-ql-search6695 +Node: helm-org-ql8626 +Node: org-ql-view9004 +Node: org-ql-view-sidebar9534 +Node: org-ql-view-recent-items9914 +Node: org-ql-sparse-tree10410 +Node: Queries11210 +Node: Non-sexp query syntax12327 +Node: General predicates14086 +Node: Ancestor/descendant predicates21011 +Node: Date/time predicates22139 +Node: Functions / Macros25263 +Node: Agenda-like views25561 +Ref: Function org-ql-block25723 +Node: Listing / acting-on results26984 +Ref: Caching27192 +Ref: Function org-ql-select28105 +Ref: Function org-ql-query30531 +Ref: Macro org-ql (deprecated)32305 +Node: Custom predicates32620 +Ref: Macro org-ql-defpred32844 +Node: Dynamic block36285 +Node: Links39009 +Node: Tips39696 +Node: Changelog40020 +Node: 09-pre40945 +Node: helm-org-ql (1)41094 +Node: 08641235 +Node: 08541472 +Node: 08442128 +Node: 08342580 +Node: 08242921 +Node: 08143314 +Node: 0843735 +Node: 07446459 +Node: 07346682 +Node: 07247416 +Node: 07148337 +Node: 0749148 +Node: 06352014 +Node: 06252547 +Node: 06152854 +Node: 0653424 +Node: 05256480 +Node: 05156782 +Node: 0557207 +Node: 04958738 +Node: 04859020 +Node: 04759369 +Node: 04659778 +Node: 04560186 +Node: 04460547 +Node: 04360906 +Node: 04261109 +Node: 04161270 +Node: 0461517 +Node: 03265618 +Node: 03166021 +Node: 0366218 +Node: 02369518 +Node: 02269752 +Node: 02170032 +Node: 0270237 +Node: 0174315 +Node: Development74416 +Node: Copyright assignment74649 +Node: Notes75239 +Node: Comparison with Org Agenda searches75403 +Node: org-sidebar76292 +Node: License76571  End Tag Table From e9d08ca3443a10cd751e56c6fe0021ca73b4c8c2 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 12 Jun 2024 23:08:54 -0500 Subject: [PATCH 097/145] Tidy: (org-ql-defpred) Docstring This does not solve the compilation warning, because that's caused by the Pcase patterns at the end of the docstring, which the linter falsely identifies as incorrect. --- org-ql.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/org-ql.el b/org-ql.el index 3f48a0b..11e93e6 100644 --- a/org-ql.el +++ b/org-ql.el @@ -1141,7 +1141,7 @@ defined in `org-ql-predicates' by calling `org-ql-defpred'." (byte-compile 'org-ql--query-preamble))) (cl-defmacro org-ql-defpred (name args docstring &key body preambles normalizers coalesce) - "Define an \\+`org-ql' selector predicate \\=`org-ql--predicate-NAME'. + "Define an Org QL selector predicate `org-ql--predicate-NAME'. NAME may be a symbol or a list of symbols: if a list, the first is used as NAME and the rest are aliases. A function is only created for NAME, not for aliases, so a normalizer should be used @@ -1226,7 +1226,7 @@ Then if NORMALIZERS were: It would be expanded to: - ((\\=`(,(or 'heading 'h) . ,args) + ((\\=`(,(or \\='heading \\='h) . ,args) \\=`(heading ,@args)))" ;; FIXME: Update defpred tutorial to include :coalesce. From d5269bb5e283f3b12b45fb05c4a7926d23e07d1f Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 12 Jun 2024 23:45:43 -0500 Subject: [PATCH 098/145] Comment: Add FIXME --- org-ql.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/org-ql.el b/org-ql.el index 11e93e6..02d51dc 100644 --- a/org-ql.el +++ b/org-ql.el @@ -1118,6 +1118,9 @@ defined in `org-ql-predicates' by calling `org-ql-defpred'." ;; Only one preamble is allowed element) (pcase element + ;; FIXME: Should the pattern below be "`(or . ,_)"? It + ;; seems to work fine either way, but it seems like it + ;; should be changed. (`(or _) element) ,@preamble-patterns From 5ef4364d0a439e409dcc5610f7df9e161a0144d7 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sat, 22 Jun 2024 05:00:03 -0500 Subject: [PATCH 099/145] Tidy: Compiler warnings --- org-ql-view.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/org-ql-view.el b/org-ql-view.el index 918fc7f..02ebb3f 100644 --- a/org-ql-view.el +++ b/org-ql-view.el @@ -611,6 +611,7 @@ The optional, second argument is temporarily _IGNORED for purposes of compatibility with changes in Org 9.4." (require 'url-parse) (require 'url-util) + (declare-function url-path-and-query "url-parse") (when (version<= "9.3" (org-version)) ;; Org 9.3+ makes a backward-incompatible change to link escaping. ;; I don't think it would be a good idea to try to guess whether @@ -712,6 +713,8 @@ When opened, the link searches the buffer it's opened from." ;; Transient manual is written very well, not everything is covered in ;; it, so I'm having to try to imitate examples from `magit-transient'. +(require 'eieio-core) + (require 'transient) (defclass org-ql-view--variable (transient-variable) From b8284c8f5caf16a1c6b4408344477eff0991ba7c Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 26 Jun 2024 09:58:11 -0500 Subject: [PATCH 100/145] Meta: v0.8.7-pre --- README.org | 4 + org-ql.el | 2 +- org-ql.info | 241 +++++++++++++++++++++++++++------------------------- 3 files changed, 131 insertions(+), 116 deletions(-) diff --git a/README.org b/README.org index e4f791e..e38b31c 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.7-pre + +Nothing new yet. + ** 0.8.6 *Fixes* diff --git a/org-ql.el b/org-ql.el index f8a84bb..ead158e 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.6 +;; Version: 0.8.7-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 519a64f..dffc0ab 100644 --- a/org-ql.info +++ b/org-ql.info @@ -72,6 +72,7 @@ Functions / Macros Changelog +* 0.8.7-pre: 087-pre. * 0.8.6: 086. * 0.8.5: 085. * 0.8.4: 084. @@ -1034,6 +1035,7 @@ releases. * Menu: +* 0.8.7-pre: 087-pre. * 0.8.6: 086. * 0.8.5: 085. * 0.8.4: 084. @@ -1073,9 +1075,17 @@ releases. * 0.1: 01.  -File: README.info, Node: 086, Next: 085, Up: Changelog +File: README.info, Node: 087-pre, Next: 086, Up: Changelog -5.1 0.8.6 +5.1 0.8.7-pre +============= + +Nothing new yet. + + +File: README.info, Node: 086, Next: 085, Prev: 087-pre, Up: Changelog + +5.2 0.8.6 ========= *Fixes* @@ -1085,7 +1095,7 @@ File: README.info, Node: 086, Next: 085, Up: Changelog  File: README.info, Node: 085, Next: 084, Prev: 086, Up: Changelog -5.2 0.8.5 +5.3 0.8.5 ========= *Fixes* @@ -1102,7 +1112,7 @@ File: README.info, Node: 085, Next: 084, Prev: 086, Up: Changelog  File: README.info, Node: 084, Next: 083, Prev: 085, Up: Changelog -5.3 0.8.4 +5.4 0.8.4 ========= *Fixes* @@ -1116,7 +1126,7 @@ File: README.info, Node: 084, Next: 083, Prev: 085, Up: Changelog  File: README.info, Node: 083, Next: 082, Prev: 084, Up: Changelog -5.4 0.8.3 +5.5 0.8.3 ========= *Fixes* @@ -1129,7 +1139,7 @@ File: README.info, Node: 083, Next: 082, Prev: 084, Up: Changelog  File: README.info, Node: 082, Next: 081, Prev: 083, Up: Changelog -5.5 0.8.2 +5.6 0.8.2 ========= *Fixes* @@ -1143,7 +1153,7 @@ File: README.info, Node: 082, Next: 081, Prev: 083, Up: Changelog  File: README.info, Node: 081, Next: 08, Prev: 082, Up: Changelog -5.6 0.8.1 +5.7 0.8.1 ========= *Fixes* @@ -1158,7 +1168,7 @@ File: README.info, Node: 081, Next: 08, Prev: 082, Up: Changelog  File: README.info, Node: 08, Next: 074, Prev: 081, Up: Changelog -5.7 0.8 +5.8 0.8 ======= *Additions* @@ -1214,7 +1224,7 @@ File: README.info, Node: 08, Next: 074, Prev: 081, Up: Changelog  File: README.info, Node: 074, Next: 073, Prev: 08, Up: Changelog -5.8 0.7.4 +5.9 0.7.4 ========= *Fixes* @@ -1224,8 +1234,8 @@ File: README.info, Node: 074, Next: 073, Prev: 08, Up: Changelog  File: README.info, Node: 073, Next: 072, Prev: 074, Up: Changelog -5.9 0.7.3 -========= +5.10 0.7.3 +========== *Fixes* • Disable ‘case-fold-search’ when collecting headings in outline @@ -1242,7 +1252,7 @@ File: README.info, Node: 073, Next: 072, Prev: 074, Up: Changelog  File: README.info, Node: 072, Next: 071, Prev: 073, Up: Changelog -5.10 0.7.2 +5.11 0.7.2 ========== *Fixes* @@ -1263,7 +1273,7 @@ File: README.info, Node: 072, Next: 071, Prev: 073, Up: Changelog  File: README.info, Node: 071, Next: 07, Prev: 072, Up: Changelog -5.11 0.7.1 +5.12 0.7.1 ========== *Fixes* @@ -1282,7 +1292,7 @@ File: README.info, Node: 071, Next: 07, Prev: 072, Up: Changelog  File: README.info, Node: 07, Next: 063, Prev: 071, Up: Changelog -5.12 0.7 +5.13 0.7 ======== *Added* @@ -1341,7 +1351,7 @@ File: README.info, Node: 07, Next: 063, Prev: 071, Up: Changelog  File: README.info, Node: 063, Next: 062, Prev: 07, Up: Changelog -5.13 0.6.3 +5.14 0.6.3 ========== *Fixed* @@ -1357,7 +1367,7 @@ File: README.info, Node: 063, Next: 062, Prev: 07, Up: Changelog  File: README.info, Node: 062, Next: 061, Prev: 063, Up: Changelog -5.14 0.6.2 +5.15 0.6.2 ========== *Fixed* @@ -1368,7 +1378,7 @@ File: README.info, Node: 062, Next: 061, Prev: 063, Up: Changelog  File: README.info, Node: 061, Next: 06, Prev: 062, Up: Changelog -5.15 0.6.1 +5.16 0.6.1 ========== *Fixed* @@ -1386,7 +1396,7 @@ File: README.info, Node: 061, Next: 06, Prev: 062, Up: Changelog  File: README.info, Node: 06, Next: 052, Prev: 061, Up: Changelog -5.16 0.6 +5.17 0.6 ======== *Added* @@ -1453,7 +1463,7 @@ File: README.info, Node: 06, Next: 052, Prev: 061, Up: Changelog  File: README.info, Node: 052, Next: 051, Prev: 06, Up: Changelog -5.17 0.5.2 +5.18 0.5.2 ========== *Fixed* @@ -1464,7 +1474,7 @@ File: README.info, Node: 052, Next: 051, Prev: 06, Up: Changelog  File: README.info, Node: 051, Next: 05, Prev: 052, Up: Changelog -5.18 0.5.1 +5.19 0.5.1 ========== *Fixed* @@ -1477,7 +1487,7 @@ File: README.info, Node: 051, Next: 05, Prev: 052, Up: Changelog  File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog -5.19 0.5 +5.20 0.5 ======== *Added* @@ -1518,7 +1528,7 @@ File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog  File: README.info, Node: 049, Next: 048, Prev: 05, Up: Changelog -5.20 0.4.9 +5.21 0.4.9 ========== *Fixed* @@ -1529,7 +1539,7 @@ File: README.info, Node: 049, Next: 048, Prev: 05, Up: Changelog  File: README.info, Node: 048, Next: 047, Prev: 049, Up: Changelog -5.21 0.4.8 +5.22 0.4.8 ========== *Fixed* @@ -1541,7 +1551,7 @@ File: README.info, Node: 048, Next: 047, Prev: 049, Up: Changelog  File: README.info, Node: 047, Next: 046, Prev: 048, Up: Changelog -5.22 0.4.7 +5.23 0.4.7 ========== *Fixed* @@ -1554,7 +1564,7 @@ File: README.info, Node: 047, Next: 046, Prev: 048, Up: Changelog  File: README.info, Node: 046, Next: 045, Prev: 047, Up: Changelog -5.23 0.4.6 +5.24 0.4.6 ========== *Fixed* @@ -1567,7 +1577,7 @@ File: README.info, Node: 046, Next: 045, Prev: 047, Up: Changelog  File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog -5.24 0.4.5 +5.25 0.4.5 ========== *Fixed* @@ -1579,7 +1589,7 @@ File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog  File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog -5.25 0.4.4 +5.26 0.4.4 ========== *Fixed* @@ -1591,7 +1601,7 @@ File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog  File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog -5.26 0.4.3 +5.27 0.4.3 ========== *Fixed* @@ -1601,7 +1611,7 @@ File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog  File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog -5.27 0.4.2 +5.28 0.4.2 ========== *Fixed* @@ -1610,7 +1620,7 @@ File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog  File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog -5.28 0.4.1 +5.29 0.4.1 ========== *Fixed* @@ -1620,7 +1630,7 @@ File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog  File: README.info, Node: 04, Next: 032, Prev: 041, Up: Changelog -5.29 0.4 +5.30 0.4 ======== _Note:_ The next release, 0.5, may include changes which will require @@ -1701,7 +1711,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.30 0.3.2 +5.31 0.3.2 ========== *Fixed* @@ -1714,7 +1724,7 @@ File: README.info, Node: 032, Next: 031, Prev: 04, Up: Changelog  File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog -5.31 0.3.1 +5.32 0.3.1 ========== *Fixed* @@ -1724,7 +1734,7 @@ File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog  File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog -5.32 0.3 +5.33 0.3 ======== *Added* @@ -1792,7 +1802,7 @@ File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog  File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog -5.33 0.2.3 +5.34 0.2.3 ========== *Fixed* @@ -1802,7 +1812,7 @@ File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog  File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog -5.34 0.2.2 +5.35 0.2.2 ========== *Fixed* @@ -1813,7 +1823,7 @@ File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog  File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog -5.35 0.2.1 +5.36 0.2.1 ========== *Fixed* @@ -1823,7 +1833,7 @@ File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog  File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog -5.36 0.2 +5.37 0.2 ======== *Added* @@ -1906,7 +1916,7 @@ File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog  File: README.info, Node: 01, Prev: 02, Up: Changelog -5.37 0.1 +5.38 0.1 ======== First tagged release. @@ -1964,82 +1974,83 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1935 -Node: Screenshots2058 -Node: Installation2176 -Node: Quelpa2690 -Node: Helm support3218 -Node: Usage3621 -Node: Commands4019 -Node: org-ql-find4484 -Node: org-ql-open-link5392 -Node: org-ql-refile6247 -Node: org-ql-search6575 -Node: helm-org-ql8506 -Node: org-ql-view8884 -Node: org-ql-view-sidebar9414 -Node: org-ql-view-recent-items9794 -Node: org-ql-sparse-tree10290 -Node: Queries11090 -Node: Non-sexp query syntax12207 -Node: General predicates13966 -Node: Ancestor/descendant predicates20891 -Node: Date/time predicates22019 -Node: Functions / Macros25143 -Node: Agenda-like views25441 -Ref: Function org-ql-block25603 -Node: Listing / acting-on results26864 -Ref: Caching27072 -Ref: Function org-ql-select27985 -Ref: Function org-ql-query30411 -Ref: Macro org-ql (deprecated)32185 -Node: Custom predicates32500 -Ref: Macro org-ql-defpred32724 -Node: Dynamic block36165 -Node: Links38889 -Node: Tips39576 -Node: Changelog39900 -Node: 08640800 -Node: 08541022 -Node: 08441678 -Node: 08342130 -Node: 08242471 -Node: 08142864 -Node: 0843285 -Node: 07446009 -Node: 07346232 -Node: 07246964 -Node: 07147885 -Node: 0748696 -Node: 06351562 -Node: 06252095 -Node: 06152402 -Node: 0652972 -Node: 05256028 -Node: 05156330 -Node: 0556755 -Node: 04958286 -Node: 04858568 -Node: 04758917 -Node: 04659326 -Node: 04559734 -Node: 04460095 -Node: 04360454 -Node: 04260657 -Node: 04160818 -Node: 0461065 -Node: 03265166 -Node: 03165569 -Node: 0365766 -Node: 02369066 -Node: 02269300 -Node: 02169580 -Node: 0269785 -Node: 0173863 -Node: Notes73964 -Node: Comparison with Org Agenda searches74126 -Node: org-sidebar75015 -Node: License75294 +Node: Contents1957 +Node: Screenshots2080 +Node: Installation2198 +Node: Quelpa2712 +Node: Helm support3240 +Node: Usage3643 +Node: Commands4041 +Node: org-ql-find4506 +Node: org-ql-open-link5414 +Node: org-ql-refile6269 +Node: org-ql-search6597 +Node: helm-org-ql8528 +Node: org-ql-view8906 +Node: org-ql-view-sidebar9436 +Node: org-ql-view-recent-items9816 +Node: org-ql-sparse-tree10312 +Node: Queries11112 +Node: Non-sexp query syntax12229 +Node: General predicates13988 +Node: Ancestor/descendant predicates20913 +Node: Date/time predicates22041 +Node: Functions / Macros25165 +Node: Agenda-like views25463 +Ref: Function org-ql-block25625 +Node: Listing / acting-on results26886 +Ref: Caching27094 +Ref: Function org-ql-select28007 +Ref: Function org-ql-query30433 +Ref: Macro org-ql (deprecated)32207 +Node: Custom predicates32522 +Ref: Macro org-ql-defpred32746 +Node: Dynamic block36187 +Node: Links38911 +Node: Tips39598 +Node: Changelog39922 +Node: 087-pre40844 +Node: 08640956 +Node: 08541194 +Node: 08441850 +Node: 08342302 +Node: 08242643 +Node: 08143036 +Node: 0843457 +Node: 07446181 +Node: 07346404 +Node: 07247138 +Node: 07148059 +Node: 0748870 +Node: 06351736 +Node: 06252269 +Node: 06152576 +Node: 0653146 +Node: 05256202 +Node: 05156504 +Node: 0556929 +Node: 04958460 +Node: 04858742 +Node: 04759091 +Node: 04659500 +Node: 04559908 +Node: 04460269 +Node: 04360628 +Node: 04260831 +Node: 04160992 +Node: 0461239 +Node: 03265340 +Node: 03165743 +Node: 0365940 +Node: 02369240 +Node: 02269474 +Node: 02169754 +Node: 0269959 +Node: 0174037 +Node: Notes74138 +Node: Comparison with Org Agenda searches74300 +Node: org-sidebar75189 +Node: License75468  End Tag Table From 0d9c46247db0971c44a3c67ae38c148ea07146da Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Sun, 8 Aug 2021 16:34:43 +0800 Subject: [PATCH 101/145] org-ql-regexp-part-ts-time: Fix for time intervals --- org-ql.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/org-ql.el b/org-ql.el index ead158e..569bdaa 100644 --- a/org-ql.el +++ b/org-ql.el @@ -170,7 +170,8 @@ regexps.") Includes leading space character.") (defvar org-ql-regexp-part-ts-time - (rx " " (repeat 1 2 digit) ":" (repeat 2 digit)) + (rx " " (repeat 1 2 digit) ":" (repeat 2 digit) + (optional "-" (repeat 1 2 digit) ":" (repeat 2 digit))) "Matches the inner, time part of an Org timestamp (i.e. HH:MM). Includes leading space character. Used to build other timestamp regexps.") From 02b4213826fe21bebed562e9860e1d2a7a393ce2 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 26 Jun 2024 09:56:14 -0500 Subject: [PATCH 102/145] Tests: Timestamps with inner time ranges --- tests/data-ts.org | 23 +++++++++++++++++++++++ tests/test-org-ql.el | 31 ++++++++++++++++++++++++++++++- 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 tests/data-ts.org diff --git a/tests/data-ts.org b/tests/data-ts.org new file mode 100644 index 0000000..01ebd57 --- /dev/null +++ b/tests/data-ts.org @@ -0,0 +1,23 @@ +#+title: Timestamp-specific tests + +/Timestamps in this file are active ones./ + +* Single-timestamp ranges + +** Single-timestamp, without repeater +<2024-06-25 Tue 08:00-09:00> + +** Single-timestamp, with repeater (deadline) +DEADLINE: <2024-06-25 Tue 08:00-09:00 ++7d> + +* Multi-timestamp ranges + +/Not sure that it would make sense to use repeaters for this kind of range./ + +** Multi-timestamp, without repeater +<2024-06-25 Tue 08:00>--<2024-06-26 Wed 08:00> + +* Canary + +/This entry should never be matched./ + diff --git a/tests/test-org-ql.el b/tests/test-org-ql.el index 8d2b84c..8721e0f 100644 --- a/tests/test-org-ql.el +++ b/tests/test-org-ql.el @@ -1688,7 +1688,36 @@ with keyword arg NOW in PLIST." (org-ql-expect ((org-ql--query-string-to-sexp "ts-active:with-time=")) '("Take over the universe" "Take over the world" "Visit Mars" "Visit the moon" "Practice leaping tall buildings in a single bound" "Get haircut" "Internet" "Spaceship lease" "Fix flux capacitor" "/r/emacs" "Shop for groceries" "Rewrite Emacs in Common Lisp")) (org-ql-expect ((org-ql--query-string-to-sexp "ts-active:with-time=t")) - '("Skype with president of Antarctica" "Renew membership in supervillain club" "Order a pizza")))) + '("Skype with president of Antarctica" "Renew membership in supervillain club" "Order a pizza"))) + + (describe "matches timestamps with inner time ranges" + (before-each + (setq org-ql-test-buffer (org-ql-test-data-buffer "data-ts.org") + org-ql-test-num-headings (with-current-buffer org-ql-test-buffer + (org-with-wide-buffer + (goto-char (point-min)) + ;; Exclude the "Canary" heading. + (1- (cl-loop while (re-search-forward org-heading-regexp nil t) + sum 1)))))) + + (org-ql-it "without specified timestamp" + (org-ql-expect ('(ts-active)) + '("Single-timestamp, without repeater" "Single-timestamp, with repeater (deadline)" "Multi-timestamp, without repeater"))) + (org-ql-it "with specified timestamps" + (org-ql-expect ('(ts-active :on "2024-06-25")) + '("Single-timestamp, without repeater" "Single-timestamp, with repeater (deadline)" "Multi-timestamp, without repeater")) + (org-ql-expect ('(ts-active :on "2024-06-26")) + '("Multi-timestamp, without repeater"))) + (org-ql-it "with specified time values" + (org-ql-expect ('(ts-active :to "2024-06-25 09:00")) + '("Single-timestamp, without repeater" "Single-timestamp, with repeater (deadline)" "Multi-timestamp, without repeater")) + ;; FIXME: The test below fails because timestamps with + ;; ranges are not yet parsed into multiple timestamps and + ;; compared as a range. This will have to be addressed in + ;; a new version. + ;; (org-ql-expect ('(ts-active :from "2024-06-25 08:30")) + ;; '("Single-timestamp, without repeater" "Single-timestamp, with repeater (deadline)" "Multi-timestamp, without repeater")) + ))) (describe "inactive" From e3b956e54d6d66a346e18683f9d6be48022f1935 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 26 Jun 2024 10:22:09 -0500 Subject: [PATCH 103/145] Docs: Update changelog --- README.org | 3 +- org-ql.info | 92 +++++++++++++++++++++++++++++------------------------ 2 files changed, 52 insertions(+), 43 deletions(-) diff --git a/README.org b/README.org index e38b31c..2b73078 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.7-pre -Nothing new yet. +*Fixes* ++ Timestamps with internal time ranges (e.g. ~<2024-06-26 10:00-11:00>~) are matched for simple queries. (This support is not yet comprehensive, e.g. a query that depends on the specific inner time range may not behave as expected. Previously such timestamps were not matched at all. See [[https://github.com/alphapapa/org-ql/pull/237][#237]] and [[https://github.com/alphapapa/org-ql/issues/371][#371]]. Thanks to [[https://github.com/yantar92][Ihor Radchenko]].) ** 0.8.6 diff --git a/org-ql.info b/org-ql.info index dffc0ab..711f169 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1080,7 +1080,15 @@ File: README.info, Node: 087-pre, Next: 086, Up: Changelog 5.1 0.8.7-pre ============= -Nothing new yet. +*Fixes* + • Timestamps with internal time ranges (e.g. ‘<2024-06-26 + 10:00-11:00>’) are matched for simple queries. (This support is + not yet comprehensive, e.g. a query that depends on the specific + inner time range may not behave as expected. Previously such + timestamps were not matched at all. See #237 + (https://github.com/alphapapa/org-ql/pull/237) and #371 + (https://github.com/alphapapa/org-ql/issues/371). Thanks to Ihor + Radchenko (https://github.com/yantar92).)  File: README.info, Node: 086, Next: 085, Prev: 087-pre, Up: Changelog @@ -2010,47 +2018,47 @@ Node: Links38911 Node: Tips39598 Node: Changelog39922 Node: 087-pre40844 -Node: 08640956 -Node: 08541194 -Node: 08441850 -Node: 08342302 -Node: 08242643 -Node: 08143036 -Node: 0843457 -Node: 07446181 -Node: 07346404 -Node: 07247138 -Node: 07148059 -Node: 0748870 -Node: 06351736 -Node: 06252269 -Node: 06152576 -Node: 0653146 -Node: 05256202 -Node: 05156504 -Node: 0556929 -Node: 04958460 -Node: 04858742 -Node: 04759091 -Node: 04659500 -Node: 04559908 -Node: 04460269 -Node: 04360628 -Node: 04260831 -Node: 04160992 -Node: 0461239 -Node: 03265340 -Node: 03165743 -Node: 0365940 -Node: 02369240 -Node: 02269474 -Node: 02169754 -Node: 0269959 -Node: 0174037 -Node: Notes74138 -Node: Comparison with Org Agenda searches74300 -Node: org-sidebar75189 -Node: License75468 +Node: 08641453 +Node: 08541691 +Node: 08442347 +Node: 08342799 +Node: 08243140 +Node: 08143533 +Node: 0843954 +Node: 07446678 +Node: 07346901 +Node: 07247635 +Node: 07148556 +Node: 0749367 +Node: 06352233 +Node: 06252766 +Node: 06153073 +Node: 0653643 +Node: 05256699 +Node: 05157001 +Node: 0557426 +Node: 04958957 +Node: 04859239 +Node: 04759588 +Node: 04659997 +Node: 04560405 +Node: 04460766 +Node: 04361125 +Node: 04261328 +Node: 04161489 +Node: 0461736 +Node: 03265837 +Node: 03166240 +Node: 0366437 +Node: 02369737 +Node: 02269971 +Node: 02170251 +Node: 0270456 +Node: 0174534 +Node: Notes74635 +Node: Comparison with Org Agenda searches74797 +Node: org-sidebar75686 +Node: License75965  End Tag Table From 914e64746f382436a1024cf40e5fa5c41bd37b87 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 26 Jun 2024 10:41:58 -0500 Subject: [PATCH 104/145] Fix: (org-ql-search) Interactive narrowing Fixes #430. Closes #436. Reported-by: Akira Komamura --- README.org | 1 + org-ql-search.el | 2 +- org-ql.info | 84 +++++++++++++++++++++++++----------------------- 3 files changed, 45 insertions(+), 42 deletions(-) diff --git a/README.org b/README.org index 2b73078..c746528 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* + Timestamps with internal time ranges (e.g. ~<2024-06-26 10:00-11:00>~) are matched for simple queries. (This support is not yet comprehensive, e.g. a query that depends on the specific inner time range may not behave as expected. Previously such timestamps were not matched at all. See [[https://github.com/alphapapa/org-ql/pull/237][#237]] and [[https://github.com/alphapapa/org-ql/issues/371][#371]]. Thanks to [[https://github.com/yantar92][Ihor Radchenko]].) ++ Command ~org-ql-search~ did not narrow properly when called interactively. ** 0.8.6 diff --git a/org-ql-search.el b/org-ql-search.el index 57215f8..b8cd148 100644 --- a/org-ql-search.el +++ b/org-ql-search.el @@ -184,7 +184,7 @@ necessary." (interactive (list (org-ql-view--complete-buffers-files) (read-string "Query: " (when org-ql-view-query (format "%S" org-ql-view-query))) - :narrow (or org-ql-view-narrow (eq current-prefix-arg '(4))) + :narrow (or org-ql-view-narrow (equal current-prefix-arg '(4))) :super-groups (org-ql-view--complete-super-groups) :sort (org-ql-view--complete-sort))) ;; NOTE: Using `with-temp-buffer' is a hack to work around the fact that `make-local-variable' diff --git a/org-ql.info b/org-ql.info index 711f169..cce0f1e 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1089,6 +1089,8 @@ File: README.info, Node: 087-pre, Next: 086, Up: Changelog (https://github.com/alphapapa/org-ql/pull/237) and #371 (https://github.com/alphapapa/org-ql/issues/371). Thanks to Ihor Radchenko (https://github.com/yantar92).) + • Command ‘org-ql-search’ did not narrow properly when called + interactively.  File: README.info, Node: 086, Next: 085, Prev: 087-pre, Up: Changelog @@ -2018,47 +2020,47 @@ Node: Links38911 Node: Tips39598 Node: Changelog39922 Node: 087-pre40844 -Node: 08641453 -Node: 08541691 -Node: 08442347 -Node: 08342799 -Node: 08243140 -Node: 08143533 -Node: 0843954 -Node: 07446678 -Node: 07346901 -Node: 07247635 -Node: 07148556 -Node: 0749367 -Node: 06352233 -Node: 06252766 -Node: 06153073 -Node: 0653643 -Node: 05256699 -Node: 05157001 -Node: 0557426 -Node: 04958957 -Node: 04859239 -Node: 04759588 -Node: 04659997 -Node: 04560405 -Node: 04460766 -Node: 04361125 -Node: 04261328 -Node: 04161489 -Node: 0461736 -Node: 03265837 -Node: 03166240 -Node: 0366437 -Node: 02369737 -Node: 02269971 -Node: 02170251 -Node: 0270456 -Node: 0174534 -Node: Notes74635 -Node: Comparison with Org Agenda searches74797 -Node: org-sidebar75686 -Node: License75965 +Node: 08641544 +Node: 08541782 +Node: 08442438 +Node: 08342890 +Node: 08243231 +Node: 08143624 +Node: 0844045 +Node: 07446769 +Node: 07346992 +Node: 07247726 +Node: 07148647 +Node: 0749458 +Node: 06352324 +Node: 06252857 +Node: 06153164 +Node: 0653734 +Node: 05256790 +Node: 05157092 +Node: 0557517 +Node: 04959048 +Node: 04859330 +Node: 04759679 +Node: 04660088 +Node: 04560496 +Node: 04460857 +Node: 04361216 +Node: 04261419 +Node: 04161580 +Node: 0461827 +Node: 03265928 +Node: 03166331 +Node: 0366528 +Node: 02369828 +Node: 02270062 +Node: 02170342 +Node: 0270547 +Node: 0174625 +Node: Notes74726 +Node: Comparison with Org Agenda searches74888 +Node: org-sidebar75777 +Node: License76056  End Tag Table From ffc3477013f0ebdb5e223d5af5c1ef489d8b0055 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 26 Jun 2024 10:52:31 -0500 Subject: [PATCH 105/145] Fix: (org-ql-regexp-part-ts-date) Allow punctuation in day-of-week Fixes . Closes . Reported-by: Florian D. --- README.org | 1 + org-ql.el | 5 +-- org-ql.info | 87 +++++++++++++++++++++++--------------------- tests/data-ts.org | 6 +++ tests/test-org-ql.el | 29 +++++++++++---- 5 files changed, 76 insertions(+), 52 deletions(-) diff --git a/README.org b/README.org index c746528..6180135 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* + Timestamps with internal time ranges (e.g. ~<2024-06-26 10:00-11:00>~) are matched for simple queries. (This support is not yet comprehensive, e.g. a query that depends on the specific inner time range may not behave as expected. Previously such timestamps were not matched at all. See [[https://github.com/alphapapa/org-ql/pull/237][#237]] and [[https://github.com/alphapapa/org-ql/issues/371][#371]]. Thanks to [[https://github.com/yantar92][Ihor Radchenko]].) ++ Timestamps with day-of-the-week abbreviations are matched more flexibly (allowing, e.g. a period in French locales). (See [[https://github.com/alphapapa/org-ql/discussions/429][#429]], [[https://github.com/alphapapa/org-ql/issues/432][#432]]. Thanks to [[https://github.com/neurolit][Florian D.]] for reporting.) + Command ~org-ql-search~ did not narrow properly when called interactively. ** 0.8.6 diff --git a/org-ql.el b/org-ql.el index 569bdaa..6300dd0 100644 --- a/org-ql.el +++ b/org-ql.el @@ -157,10 +157,9 @@ This list should not contain any duplicates.")) (defvar org-ql-regexp-part-ts-date (rx (repeat 4 digit) "-" (repeat 2 digit) "-" (repeat 2 digit) ;; Day of week - (optional " " (1+ alpha))) + (optional " " (1+ (or alpha punct)))) "Matches the inner, date part of an Org timestamp, both active and inactive. -Also matches optional day-of-week. Used to build other timestamp -regexps.") +Used to build other timestamp regexps.") (defvar org-ql-regexp-part-ts-repeaters ;; Repeaters (not sure if the colon is necessary, but it's in the org.el one) diff --git a/org-ql.info b/org-ql.info index cce0f1e..325eeb0 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1089,6 +1089,11 @@ File: README.info, Node: 087-pre, Next: 086, Up: Changelog (https://github.com/alphapapa/org-ql/pull/237) and #371 (https://github.com/alphapapa/org-ql/issues/371). Thanks to Ihor Radchenko (https://github.com/yantar92).) + • Timestamps with day-of-the-week abbreviations are matched more + flexibly (allowing, e.g. a period in French locales). (See #429 + (https://github.com/alphapapa/org-ql/discussions/429), #432 + (https://github.com/alphapapa/org-ql/issues/432). Thanks to + Florian D. (https://github.com/neurolit) for reporting.) • Command ‘org-ql-search’ did not narrow properly when called interactively. @@ -2020,47 +2025,47 @@ Node: Links38911 Node: Tips39598 Node: Changelog39922 Node: 087-pre40844 -Node: 08641544 -Node: 08541782 -Node: 08442438 -Node: 08342890 -Node: 08243231 -Node: 08143624 -Node: 0844045 -Node: 07446769 -Node: 07346992 -Node: 07247726 -Node: 07148647 -Node: 0749458 -Node: 06352324 -Node: 06252857 -Node: 06153164 -Node: 0653734 -Node: 05256790 -Node: 05157092 -Node: 0557517 -Node: 04959048 -Node: 04859330 -Node: 04759679 -Node: 04660088 -Node: 04560496 -Node: 04460857 -Node: 04361216 -Node: 04261419 -Node: 04161580 -Node: 0461827 -Node: 03265928 -Node: 03166331 -Node: 0366528 -Node: 02369828 -Node: 02270062 -Node: 02170342 -Node: 0270547 -Node: 0174625 -Node: Notes74726 -Node: Comparison with Org Agenda searches74888 -Node: org-sidebar75777 -Node: License76056 +Node: 08641879 +Node: 08542117 +Node: 08442773 +Node: 08343225 +Node: 08243566 +Node: 08143959 +Node: 0844380 +Node: 07447104 +Node: 07347327 +Node: 07248061 +Node: 07148982 +Node: 0749793 +Node: 06352659 +Node: 06253192 +Node: 06153499 +Node: 0654069 +Node: 05257125 +Node: 05157427 +Node: 0557852 +Node: 04959383 +Node: 04859665 +Node: 04760014 +Node: 04660423 +Node: 04560831 +Node: 04461192 +Node: 04361551 +Node: 04261754 +Node: 04161915 +Node: 0462162 +Node: 03266263 +Node: 03166666 +Node: 0366863 +Node: 02370163 +Node: 02270397 +Node: 02170677 +Node: 0270882 +Node: 0174960 +Node: Notes75061 +Node: Comparison with Org Agenda searches75223 +Node: org-sidebar76112 +Node: License76391  End Tag Table diff --git a/tests/data-ts.org b/tests/data-ts.org index 01ebd57..a5169a7 100644 --- a/tests/data-ts.org +++ b/tests/data-ts.org @@ -17,6 +17,12 @@ DEADLINE: <2024-06-25 Tue 08:00-09:00 ++7d> ** Multi-timestamp, without repeater <2024-06-25 Tue 08:00>--<2024-06-26 Wed 08:00> +* Day-of-week abbreviations + +** French + +<2024-07-12 Fri> + * Canary /This entry should never be matched./ diff --git a/tests/test-org-ql.el b/tests/test-org-ql.el index 8721e0f..6717472 100644 --- a/tests/test-org-ql.el +++ b/tests/test-org-ql.el @@ -1700,16 +1700,16 @@ with keyword arg NOW in PLIST." (1- (cl-loop while (re-search-forward org-heading-regexp nil t) sum 1)))))) - (org-ql-it "without specified timestamp" + (org-ql-it "without :with-time" (org-ql-expect ('(ts-active)) - '("Single-timestamp, without repeater" "Single-timestamp, with repeater (deadline)" "Multi-timestamp, without repeater"))) - (org-ql-it "with specified timestamps" - (org-ql-expect ('(ts-active :on "2024-06-25")) + '("Single-timestamp, without repeater" "Single-timestamp, with repeater (deadline)" "Multi-timestamp, without repeater" "French"))) + (org-ql-it ":with-time t" + (org-ql-expect ('(ts-active :on "2024-06-25" :with-time t)) '("Single-timestamp, without repeater" "Single-timestamp, with repeater (deadline)" "Multi-timestamp, without repeater")) - (org-ql-expect ('(ts-active :on "2024-06-26")) + (org-ql-expect ('(ts-active :on "2024-06-26" :with-time t)) '("Multi-timestamp, without repeater"))) - (org-ql-it "with specified time values" - (org-ql-expect ('(ts-active :to "2024-06-25 09:00")) + (org-ql-it ":with-time t and with specified time value in :to" + (org-ql-expect ('(ts-active :to "2024-06-25 09:00" :with-time t)) '("Single-timestamp, without repeater" "Single-timestamp, with repeater (deadline)" "Multi-timestamp, without repeater")) ;; FIXME: The test below fails because timestamps with ;; ranges are not yet parsed into multiple timestamps and @@ -1856,7 +1856,20 @@ with keyword arg NOW in PLIST." '("Visit Mars"))) (org-ql-then (:now "2019-07-07") (org-ql-expect ('(ts :on today)) - nil))))) + nil)))) + + (describe "Day-of-week abbreviations" + (before-each + (setq org-ql-test-buffer (org-ql-test-data-buffer "data-ts.org") + org-ql-test-num-headings (with-current-buffer org-ql-test-buffer + (org-with-wide-buffer + (goto-char (point-min)) + ;; Exclude the "Canary" heading. + (1- (cl-loop while (re-search-forward org-heading-regexp nil t) + sum 1)))))) + (org-ql-it "matches French abbreviations (with trailing period)" + (org-ql-expect ('(ts :on "2024-07-12")) + '("French"))))) (describe "Compound queries" From b362dd68b000c804327bdf1b58d30e73449d4f4f Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 26 Jun 2024 11:28:11 -0500 Subject: [PATCH 106/145] Fix: (org-dblock-write:org-ql) Resolve element properties Fixes . Reported-by: Jez Cope --- README.org | 3 ++ org-ql-search.el | 3 +- org-ql.info | 87 +++++++++++++++++++++++++----------------------- 3 files changed, 51 insertions(+), 42 deletions(-) diff --git a/README.org b/README.org index 6180135..8be6a28 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: + Timestamps with day-of-the-week abbreviations are matched more flexibly (allowing, e.g. a period in French locales). (See [[https://github.com/alphapapa/org-ql/discussions/429][#429]], [[https://github.com/alphapapa/org-ql/issues/432][#432]]. Thanks to [[https://github.com/neurolit][Florian D.]] for reporting.) + Command ~org-ql-search~ did not narrow properly when called interactively. +*Compatibility* ++ Dynamic blocks work with Org 9.7. ([[https://github.com/alphapapa/org-ql/issues/431][#431]]. Thanks to [[https://github.com/jezcope][Jez Cope]] for reporting.) + ** 0.8.6 *Fixes* diff --git a/org-ql-search.el b/org-ql-search.el index b8cd148..72a2153 100644 --- a/org-ql-search.el +++ b/org-ql-search.el @@ -347,7 +347,8 @@ this (must be a single line in the Org buffer): (org-element-property (intern (concat ":" (upcase property))) element))))) (elements (org-ql-query :from (current-buffer) :where query - :select '(org-element-headline-parser (line-end-position)) + :select '(org-ql-view--resolve-element-properties + (org-element-headline-parser (line-end-position))) :order-by sort))) (when take (setf elements (cl-etypecase take diff --git a/org-ql.info b/org-ql.info index 325eeb0..4c8ac2c 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1097,6 +1097,11 @@ File: README.info, Node: 087-pre, Next: 086, Up: Changelog • Command ‘org-ql-search’ did not narrow properly when called interactively. + *Compatibility* + • Dynamic blocks work with Org 9.7. (#431 + (https://github.com/alphapapa/org-ql/issues/431). Thanks to Jez + Cope (https://github.com/jezcope) for reporting.) +  File: README.info, Node: 086, Next: 085, Prev: 087-pre, Up: Changelog @@ -2025,47 +2030,47 @@ Node: Links38911 Node: Tips39598 Node: Changelog39922 Node: 087-pre40844 -Node: 08641879 -Node: 08542117 -Node: 08442773 -Node: 08343225 -Node: 08243566 -Node: 08143959 -Node: 0844380 -Node: 07447104 -Node: 07347327 -Node: 07248061 -Node: 07148982 -Node: 0749793 -Node: 06352659 -Node: 06253192 -Node: 06153499 -Node: 0654069 -Node: 05257125 -Node: 05157427 -Node: 0557852 -Node: 04959383 -Node: 04859665 -Node: 04760014 -Node: 04660423 -Node: 04560831 -Node: 04461192 -Node: 04361551 -Node: 04261754 -Node: 04161915 -Node: 0462162 -Node: 03266263 -Node: 03166666 -Node: 0366863 -Node: 02370163 -Node: 02270397 -Node: 02170677 -Node: 0270882 -Node: 0174960 -Node: Notes75061 -Node: Comparison with Org Agenda searches75223 -Node: org-sidebar76112 -Node: License76391 +Node: 08642072 +Node: 08542310 +Node: 08442966 +Node: 08343418 +Node: 08243759 +Node: 08144152 +Node: 0844573 +Node: 07447297 +Node: 07347520 +Node: 07248254 +Node: 07149175 +Node: 0749986 +Node: 06352852 +Node: 06253385 +Node: 06153692 +Node: 0654262 +Node: 05257318 +Node: 05157620 +Node: 0558045 +Node: 04959576 +Node: 04859858 +Node: 04760207 +Node: 04660616 +Node: 04561024 +Node: 04461385 +Node: 04361744 +Node: 04261947 +Node: 04162108 +Node: 0462355 +Node: 03266456 +Node: 03166859 +Node: 0367056 +Node: 02370356 +Node: 02270590 +Node: 02170870 +Node: 0271075 +Node: 0175153 +Node: Notes75254 +Node: Comparison with Org Agenda searches75416 +Node: org-sidebar76305 +Node: License76584  End Tag Table From c2b4404808185a9d5e160c8eea7967f906f77fd3 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 26 Jun 2024 11:31:17 -0500 Subject: [PATCH 107/145] Release: v0.8.7 --- README.org | 2 +- org-ql.el | 2 +- org-ql.info | 166 ++++++++++++++++++++++++++-------------------------- 3 files changed, 85 insertions(+), 85 deletions(-) diff --git a/README.org b/README.org index 8be6a28..9e3bd54 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.7-pre +** 0.8.7 *Fixes* + Timestamps with internal time ranges (e.g. ~<2024-06-26 10:00-11:00>~) are matched for simple queries. (This support is not yet comprehensive, e.g. a query that depends on the specific inner time range may not behave as expected. Previously such timestamps were not matched at all. See [[https://github.com/alphapapa/org-ql/pull/237][#237]] and [[https://github.com/alphapapa/org-ql/issues/371][#371]]. Thanks to [[https://github.com/yantar92][Ihor Radchenko]].) diff --git a/org-ql.el b/org-ql.el index 6300dd0..87d2dab 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.7-pre +;; Version: 0.8.7 ;; 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 4c8ac2c..a408934 100644 --- a/org-ql.info +++ b/org-ql.info @@ -72,7 +72,7 @@ Functions / Macros Changelog -* 0.8.7-pre: 087-pre. +* 0.8.7: 087. * 0.8.6: 086. * 0.8.5: 085. * 0.8.4: 084. @@ -1035,7 +1035,7 @@ releases. * Menu: -* 0.8.7-pre: 087-pre. +* 0.8.7: 087. * 0.8.6: 086. * 0.8.5: 085. * 0.8.4: 084. @@ -1075,10 +1075,10 @@ releases. * 0.1: 01.  -File: README.info, Node: 087-pre, Next: 086, Up: Changelog +File: README.info, Node: 087, Next: 086, Up: Changelog -5.1 0.8.7-pre -============= +5.1 0.8.7 +========= *Fixes* • Timestamps with internal time ranges (e.g. ‘<2024-06-26 @@ -1103,7 +1103,7 @@ File: README.info, Node: 087-pre, Next: 086, Up: Changelog Cope (https://github.com/jezcope) for reporting.)  -File: README.info, Node: 086, Next: 085, Prev: 087-pre, Up: Changelog +File: README.info, Node: 086, Next: 085, Prev: 087, Up: Changelog 5.2 0.8.6 ========= @@ -1994,83 +1994,83 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1957 -Node: Screenshots2080 -Node: Installation2198 -Node: Quelpa2712 -Node: Helm support3240 -Node: Usage3643 -Node: Commands4041 -Node: org-ql-find4506 -Node: org-ql-open-link5414 -Node: org-ql-refile6269 -Node: org-ql-search6597 -Node: helm-org-ql8528 -Node: org-ql-view8906 -Node: org-ql-view-sidebar9436 -Node: org-ql-view-recent-items9816 -Node: org-ql-sparse-tree10312 -Node: Queries11112 -Node: Non-sexp query syntax12229 -Node: General predicates13988 -Node: Ancestor/descendant predicates20913 -Node: Date/time predicates22041 -Node: Functions / Macros25165 -Node: Agenda-like views25463 -Ref: Function org-ql-block25625 -Node: Listing / acting-on results26886 -Ref: Caching27094 -Ref: Function org-ql-select28007 -Ref: Function org-ql-query30433 -Ref: Macro org-ql (deprecated)32207 -Node: Custom predicates32522 -Ref: Macro org-ql-defpred32746 -Node: Dynamic block36187 -Node: Links38911 -Node: Tips39598 -Node: Changelog39922 -Node: 087-pre40844 -Node: 08642072 -Node: 08542310 -Node: 08442966 -Node: 08343418 -Node: 08243759 -Node: 08144152 -Node: 0844573 -Node: 07447297 -Node: 07347520 -Node: 07248254 -Node: 07149175 -Node: 0749986 -Node: 06352852 -Node: 06253385 -Node: 06153692 -Node: 0654262 -Node: 05257318 -Node: 05157620 -Node: 0558045 -Node: 04959576 -Node: 04859858 -Node: 04760207 -Node: 04660616 -Node: 04561024 -Node: 04461385 -Node: 04361744 -Node: 04261947 -Node: 04162108 -Node: 0462355 -Node: 03266456 -Node: 03166859 -Node: 0367056 -Node: 02370356 -Node: 02270590 -Node: 02170870 -Node: 0271075 -Node: 0175153 -Node: Notes75254 -Node: Comparison with Org Agenda searches75416 -Node: org-sidebar76305 -Node: License76584 +Node: Contents1949 +Node: Screenshots2072 +Node: Installation2190 +Node: Quelpa2704 +Node: Helm support3232 +Node: Usage3635 +Node: Commands4033 +Node: org-ql-find4498 +Node: org-ql-open-link5406 +Node: org-ql-refile6261 +Node: org-ql-search6589 +Node: helm-org-ql8520 +Node: org-ql-view8898 +Node: org-ql-view-sidebar9428 +Node: org-ql-view-recent-items9808 +Node: org-ql-sparse-tree10304 +Node: Queries11104 +Node: Non-sexp query syntax12221 +Node: General predicates13980 +Node: Ancestor/descendant predicates20905 +Node: Date/time predicates22033 +Node: Functions / Macros25157 +Node: Agenda-like views25455 +Ref: Function org-ql-block25617 +Node: Listing / acting-on results26878 +Ref: Caching27086 +Ref: Function org-ql-select27999 +Ref: Function org-ql-query30425 +Ref: Macro org-ql (deprecated)32199 +Node: Custom predicates32514 +Ref: Macro org-ql-defpred32738 +Node: Dynamic block36179 +Node: Links38903 +Node: Tips39590 +Node: Changelog39914 +Node: 08740828 +Node: 08642044 +Node: 08542278 +Node: 08442934 +Node: 08343386 +Node: 08243727 +Node: 08144120 +Node: 0844541 +Node: 07447265 +Node: 07347488 +Node: 07248222 +Node: 07149143 +Node: 0749954 +Node: 06352820 +Node: 06253353 +Node: 06153660 +Node: 0654230 +Node: 05257286 +Node: 05157588 +Node: 0558013 +Node: 04959544 +Node: 04859826 +Node: 04760175 +Node: 04660584 +Node: 04560992 +Node: 04461353 +Node: 04361712 +Node: 04261915 +Node: 04162076 +Node: 0462323 +Node: 03266424 +Node: 03166827 +Node: 0367024 +Node: 02370324 +Node: 02270558 +Node: 02170838 +Node: 0271043 +Node: 0175121 +Node: Notes75222 +Node: Comparison with Org Agenda searches75384 +Node: org-sidebar76273 +Node: License76552  End Tag Table From d4faa216407b6b99f8e4a75512ac8fc8640d67c5 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 26 Jun 2024 12:01:32 -0500 Subject: [PATCH 108/145] Fix: (data-ts.org) French day-of-week abbreviation The test data in v0.8.7 was accidentally changed to the English abbreviation (the perils of working on systems with differing locales), but the feature works as intended. See . --- tests/data-ts.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/data-ts.org b/tests/data-ts.org index a5169a7..d533493 100644 --- a/tests/data-ts.org +++ b/tests/data-ts.org @@ -21,7 +21,7 @@ DEADLINE: <2024-06-25 Tue 08:00-09:00 ++7d> ** French -<2024-07-12 Fri> +<2024-07-12 ven.> * Canary From ccbd5b45942602616a34ede5368446041f84c4f7 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 27 Jun 2024 07:02:09 -0500 Subject: [PATCH 109/145] 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 bfb0fbeec11007fa570a8fbca7e61f950f8ee206 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 27 Jun 2024 07:41:16 -0500 Subject: [PATCH 110/145] Tests: Declare requirement on xr This was overlooked because makem.sh gets run with --install-linters, which installs relint, which depends on xr. --- 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 3e1ce25..7f5431c 100644 --- a/tests/test-org-ql.el +++ b/tests/test-org-ql.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2019 Adam Porter ;; Author: Adam Porter -;; Package-Requires: ((buttercup) (with-simulated-input)) +;; Package-Requires: ((buttercup) (with-simulated-input) (xr)) ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by From a8608f408bc526d1bb1b806eb418ff52f6233046 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 27 Jun 2024 07:44:10 -0500 Subject: [PATCH 111/145] Fix/Meta: (makem.sh) Update to v0.7.1 This omits the obsolete Org ELPA repository, which apparently was causing a very old version of Org to be installed, which appeared to be causing Buttercup to inexplicably hang (sometimes, on some systems, in some circumstances...?). I don't know if this is related to Guix commit , which disables the tests due to Buttercup hanging, because Guix is not running the tests through makem.sh. --- makem.sh | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/makem.sh b/makem.sh index c320e5d..fd81e0f 100755 --- a/makem.sh +++ b/makem.sh @@ -3,7 +3,7 @@ # * makem.sh --- Script to aid building and testing Emacs Lisp packages # URL: https://github.com/alphapapa/makem.sh -# Version: 0.7 +# Version: 0.7.1 # * Commentary: @@ -307,7 +307,6 @@ function elisp-package-initialize-file { (setq package-archives (list (cons "gnu" "https://elpa.gnu.org/packages/") (cons "melpa" "https://melpa.org/packages/") (cons "melpa-stable" "https://stable.melpa.org/packages/"))) -$elisp_org_package_archive (package-initialize) EOF echo $file @@ -1124,21 +1123,15 @@ args_package_archives=( --eval "(add-to-list 'package-archives '(\"melpa\" . \"https://melpa.org/packages/\") t)" ) -args_org_package_archives=( - --eval "(add-to-list 'package-archives '(\"org\" . \"https://orgmode.org/elpa/\") t)" -) - args_package_init=( --eval "(package-initialize)" ) -elisp_org_package_archive="(add-to-list 'package-archives '(\"org\" . \"https://orgmode.org/elpa/\") t)" - # * Args args=$(getopt -n "$0" \ - -o dhce:E:i:s::vf:CO \ - -l compile-batch,exclude:,emacs:,install-deps,install-linters,debug,debug-load-path,help,install:,verbose,file:,no-color,no-compile,no-org-repo,sandbox:: \ + -o dhce:E:i:s::vf:C \ + -l compile-batch,exclude:,emacs:,install-deps,install-linters,debug,debug-load-path,help,install:,verbose,file:,no-color,no-compile,sandbox:: \ -- "$@") \ || { usage; exit 1; } eval set -- "$args" @@ -1202,9 +1195,6 @@ do shift args_files+=("$1") ;; - -O|--no-org-repo) - unset elisp_org_package_archive - ;; --no-color) unset color ;; From 611198155dbdd5c82d00475aa6587273150c5e8f Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 27 Jun 2024 08:03:04 -0500 Subject: [PATCH 112/145] Tests: Fix filename tests for CI As the comment says, in CI the filenames are being abbreviated, which I can't explain (it has not always been this way). So we compare them in abbreviated form. --- tests/test-org-ql.el | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/tests/test-org-ql.el b/tests/test-org-ql.el index 7f5431c..7618327 100644 --- a/tests/test-org-ql.el +++ b/tests/test-org-ql.el @@ -2111,21 +2111,31 @@ with keyword arg NOW in PLIST." (describe "Buffers/Files" :var ((query '(and (todo "TODO") (regexp "heading"))) (one-filename (car 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))))) + ;; 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))))))) (describe "Dynamic blocks" (describe "warn about sexp queries" From b7d4856f926cb71e01427a940dc948a48b0a702d Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 27 Jun 2024 09:10:47 -0500 Subject: [PATCH 113/145] 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. But on the current Emacs snapshot build used in CI, Buttercup is hanging indefinitely, which may be the same problem that led Guix to disable the tests in . But I've no way of knowing whether that's a problem in org-ql (seems unlikely), Emacs snapshot, or Buttercup. It would be nice to solve this before Emacs 30.1 is released, but I don't know how to peer inside Buttercup to find out what it's hanging on. Fixes #433. Reported-by: Akira Komamura Co-developed-by: Stefan Monnier --- README.org | 3 +- org-ql.el | 8 ++--- org-ql.info | 96 ++++++++++++++++++++++++++++------------------------- 3 files changed, 56 insertions(+), 51 deletions(-) diff --git a/README.org b/README.org index 4fb2fb9..61995fb 100644 --- a/README.org +++ b/README.org @@ -556,7 +556,8 @@ Simple links may also be written manually in either sexp or non-sexp form, like: ** 0.9-pre -Nothing new yet. +*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]].) *** helm-org-ql diff --git a/org-ql.el b/org-ql.el index 921a5b2..811bd92 100644 --- a/org-ql.el +++ b/org-ql.el @@ -1118,10 +1118,10 @@ defined in `org-ql-predicates' by calling `org-ql-defpred'." ;; Only one preamble is allowed element) (pcase element - ;; FIXME: Should the pattern below be "`(or . ,_)"? It - ;; seems to work fine either way, but it seems like it - ;; should be changed. - (`(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 cf608ad..c2641b7 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1091,7 +1091,11 @@ File: README.info, Node: 09-pre, Next: 087, Up: Changelog 5.1 0.9-pre =========== -Nothing new yet. +*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).) * Menu: @@ -2088,51 +2092,51 @@ Node: Links39023 Node: Tips39710 Node: Changelog40034 Node: 09-pre40973 -Node: helm-org-ql (1)41122 -Node: 08741263 -Node: 08642494 -Node: 08542728 -Node: 08443384 -Node: 08343836 -Node: 08244177 -Node: 08144570 -Node: 0844991 -Node: 07447715 -Node: 07347940 -Node: 07248674 -Node: 07149595 -Node: 0750406 -Node: 06353272 -Node: 06253805 -Node: 06154112 -Node: 0654682 -Node: 05257738 -Node: 05158040 -Node: 0558465 -Node: 04959996 -Node: 04860278 -Node: 04760627 -Node: 04661036 -Node: 04561444 -Node: 04461805 -Node: 04362164 -Node: 04262367 -Node: 04162528 -Node: 0462775 -Node: 03266876 -Node: 03167279 -Node: 0367476 -Node: 02370776 -Node: 02271010 -Node: 02171290 -Node: 0271495 -Node: 0175573 -Node: Development75674 -Node: Copyright assignment75907 -Node: Notes76497 -Node: Comparison with Org Agenda searches76661 -Node: org-sidebar77550 -Node: License77829 +Node: helm-org-ql (1)41339 +Node: 08741480 +Node: 08642711 +Node: 08542945 +Node: 08443601 +Node: 08344053 +Node: 08244394 +Node: 08144787 +Node: 0845208 +Node: 07447932 +Node: 07348157 +Node: 07248891 +Node: 07149812 +Node: 0750623 +Node: 06353489 +Node: 06254022 +Node: 06154329 +Node: 0654899 +Node: 05257955 +Node: 05158257 +Node: 0558682 +Node: 04960213 +Node: 04860495 +Node: 04760844 +Node: 04661253 +Node: 04561661 +Node: 04462022 +Node: 04362381 +Node: 04262584 +Node: 04162745 +Node: 0462992 +Node: 03267093 +Node: 03167496 +Node: 0367693 +Node: 02370993 +Node: 02271227 +Node: 02171507 +Node: 0271712 +Node: 0175790 +Node: Development75891 +Node: Copyright assignment76124 +Node: Notes76714 +Node: Comparison with Org Agenda searches76878 +Node: org-sidebar77767 +Node: License78046  End Tag Table From ba49d0e3c7ed38e0603707bb7d23f6ce12b0813d Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Mon, 26 Aug 2024 07:14:31 -0500 Subject: [PATCH 114/145] Change: Respect narrowing in org-ql-find This allows searching within a narrowed buffer with org-ql-find. Using "C-u" searches the widened buffer, while "C-u C-u" prompts to select the buffers to search (which previously worked with just "C-u"). --- org-ql-completing-read.el | 5 ++++- org-ql-find.el | 40 ++++++++++++++++++++++++--------------- 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/org-ql-completing-read.el b/org-ql-completing-read.el index 18cfd7f..03f3db1 100644 --- a/org-ql-completing-read.el +++ b/org-ql-completing-read.el @@ -134,7 +134,7 @@ value, or nil." ;;;###autoload (cl-defun org-ql-completing-read - (buffers-files &key query-prefix query-filter + (buffers-files &key query-prefix query-filter narrowp (action #'org-ql-completing-read-action) ;; FIXME: Unused argument. ;; (annotate #'org-ql-completing-read-snippet) @@ -145,6 +145,8 @@ value, or nil." "Return marker at entry in BUFFERS-FILES selected with `org-ql'. PROMPT is shown to the user. +NARROWP is passed to `org-ql-select', which see. + QUERY-PREFIX may be a string to prepend to the query entered by the user (e.g. use \"heading:\" to only search headings, easily creating a custom command that saves the user from having to type @@ -323,6 +325,7 @@ single predicate)." bow (or ,@query-tokens) (0+ (not space)) (optional (repeat 1 3 (0+ space) (repeat 1 15 (not space)))))))) (org-ql-select buffers-files (org-ql--query-string-to-sexp input) + :narrow narrowp :action #'action)))) (unless (listp buffers-files) ;; Since we map across this argument, we ensure it's a list. diff --git a/org-ql-find.el b/org-ql-find.el index 820d2dd..ed6d21d 100644 --- a/org-ql-find.el +++ b/org-ql-find.el @@ -54,14 +54,18 @@ See function `display-buffer'." ;;;; Commands ;;;###autoload -(cl-defun org-ql-find (buffers-files &key query-prefix query-filter +(cl-defun org-ql-find (buffers-files &key query-prefix query-filter widen (prompt "Find entry: ")) "Go to an Org entry in BUFFERS-FILES selected by searching entries with `org-ql'. Interactively, search the buffers and files relevant to the current buffer (i.e. in `org-agenda-mode', the value of `org-ql-view-buffers-files' or `org-agenda-contributing-files'; -in `org-mode', that buffer). With universal prefix, select -multiple buffers to search with completion and PROMPT. +in `org-mode', that buffer). + +With one or more universal prefix arguments, WIDEN buffers before +searching (otherwise, respect any narrowing). With two universal +prefix arguments, select multiple buffers to search with +completion and PROMPT. QUERY-PREFIX may be a string to prepend to the query (e.g. use \"heading:\" to only search headings, easily creating a custom @@ -72,11 +76,17 @@ types is filtered before execution (e.g. it could replace spaces with commas to turn multiple tokens, which would normally be treated as multiple predicates, into multiple arguments to a single predicate)." - (interactive (list (org-ql-find--buffers))) - (let ((marker (org-ql-completing-read buffers-files - :query-prefix query-prefix - :query-filter query-filter - :prompt prompt))) + (interactive (list (org-ql-find--buffers + :read-buffer-p (equal '(16) current-prefix-arg)) + :widen current-prefix-arg)) + (let ((marker (save-restriction + (when (and widen (equal (current-buffer) buffers-files)) + (widen)) + (org-ql-completing-read buffers-files + :narrowp (not widen) + :query-prefix query-prefix + :query-filter query-filter + :prompt prompt)))) (set-buffer (or (buffer-base-buffer (marker-buffer marker)) (marker-buffer marker))) (pop-to-buffer (current-buffer) org-ql-find-display-buffer-action) @@ -195,15 +205,15 @@ multiple buffers to search with completion and PROMPT." ;;;; Functions -(defun org-ql-find--buffers () - "Return list of buffers to search in. +(cl-defun org-ql-find--buffers (&key read-buffer-p) + "Return buffer or list of buffers to search in. In a mode derived from `org-agenda-mode', return the value of `org-ql-view-buffers-files' or `org-agenda-contributing-files'. -In a mode derived from `org-mode', return the current buffer. -When `current-prefix-arg', read a list of buffers in `org-mode' -with completion. To be used in `org-ql-find' commands' -interactive forms." - (if current-prefix-arg +In a mode derived from `org-mode', return the current buffer. If +READ-BUFFER-P, read a list of buffers in `org-mode' with +completion. To be used in `org-ql-find' commands' interactive +forms." + (if read-buffer-p (mapcar #'get-buffer (completing-read-multiple "Buffers: " From cfe5300987dcec095ccbced0ae2c77a847bca681 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Mon, 26 Aug 2024 07:19:09 -0500 Subject: [PATCH 115/145] Docs: Update changelog --- README.org | 4 +++ org-ql.info | 100 ++++++++++++++++++++++++++++------------------------ 2 files changed, 58 insertions(+), 46 deletions(-) diff --git a/README.org b/README.org index 61995fb..3382496 100644 --- a/README.org +++ b/README.org @@ -556,6 +556,10 @@ Simple links may also be written manually in either sexp or non-sexp form, like: ** 0.9-pre +*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~. + *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]].) diff --git a/org-ql.info b/org-ql.info index c2641b7..edf994a 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1091,7 +1091,15 @@ File: README.info, Node: 09-pre, Next: 087, Up: Changelog 5.1 0.9-pre =========== -*Compatibility* +*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’. + + *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 @@ -2092,51 +2100,51 @@ Node: Links39023 Node: Tips39710 Node: Changelog40034 Node: 09-pre40973 -Node: helm-org-ql (1)41339 -Node: 08741480 -Node: 08642711 -Node: 08542945 -Node: 08443601 -Node: 08344053 -Node: 08244394 -Node: 08144787 -Node: 0845208 -Node: 07447932 -Node: 07348157 -Node: 07248891 -Node: 07149812 -Node: 0750623 -Node: 06353489 -Node: 06254022 -Node: 06154329 -Node: 0654899 -Node: 05257955 -Node: 05158257 -Node: 0558682 -Node: 04960213 -Node: 04860495 -Node: 04760844 -Node: 04661253 -Node: 04561661 -Node: 04462022 -Node: 04362381 -Node: 04262584 -Node: 04162745 -Node: 0462992 -Node: 03267093 -Node: 03167496 -Node: 0367693 -Node: 02370993 -Node: 02271227 -Node: 02171507 -Node: 0271712 -Node: 0175790 -Node: Development75891 -Node: Copyright assignment76124 -Node: Notes76714 -Node: Comparison with Org Agenda searches76878 -Node: org-sidebar77767 -Node: License78046 +Node: helm-org-ql (1)41757 +Node: 08741898 +Node: 08643129 +Node: 08543363 +Node: 08444019 +Node: 08344471 +Node: 08244812 +Node: 08145205 +Node: 0845626 +Node: 07448350 +Node: 07348575 +Node: 07249309 +Node: 07150230 +Node: 0751041 +Node: 06353907 +Node: 06254440 +Node: 06154747 +Node: 0655317 +Node: 05258373 +Node: 05158675 +Node: 0559100 +Node: 04960631 +Node: 04860913 +Node: 04761262 +Node: 04661671 +Node: 04562079 +Node: 04462440 +Node: 04362799 +Node: 04263002 +Node: 04163163 +Node: 0463410 +Node: 03267511 +Node: 03167914 +Node: 0368111 +Node: 02371411 +Node: 02271645 +Node: 02171925 +Node: 0272130 +Node: 0176208 +Node: Development76309 +Node: Copyright assignment76542 +Node: Notes77132 +Node: Comparison with Org Agenda searches77296 +Node: org-sidebar78185 +Node: License78464  End Tag Table From b6704c28144693fa60f8f95a5b2dfdfa535e507d Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 29 Aug 2024 14:19:10 -0500 Subject: [PATCH 116/145] Meta: v0.8.8-pre --- README.org | 4 + org-ql.el | 2 +- org-ql.info | 245 +++++++++++++++++++++++++++------------------------- 3 files changed, 133 insertions(+), 118 deletions(-) diff --git a/README.org b/README.org index 9e3bd54..a85e227 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.8-pre + +Nothing new yet. + ** 0.8.7 *Fixes* diff --git a/org-ql.el b/org-ql.el index 87d2dab..f1ad6f1 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.7 +;; Version: 0.8.8-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 a408934..2433869 100644 --- a/org-ql.info +++ b/org-ql.info @@ -72,6 +72,7 @@ Functions / Macros Changelog +* 0.8.8-pre: 088-pre. * 0.8.7: 087. * 0.8.6: 086. * 0.8.5: 085. @@ -1035,6 +1036,7 @@ releases. * Menu: +* 0.8.8-pre: 088-pre. * 0.8.7: 087. * 0.8.6: 086. * 0.8.5: 085. @@ -1075,9 +1077,17 @@ releases. * 0.1: 01.  -File: README.info, Node: 087, Next: 086, Up: Changelog +File: README.info, Node: 088-pre, Next: 087, Up: Changelog -5.1 0.8.7 +5.1 0.8.8-pre +============= + +Nothing new yet. + + +File: README.info, Node: 087, Next: 086, Prev: 088-pre, Up: Changelog + +5.2 0.8.7 ========= *Fixes* @@ -1105,7 +1115,7 @@ File: README.info, Node: 087, Next: 086, Up: Changelog  File: README.info, Node: 086, Next: 085, Prev: 087, Up: Changelog -5.2 0.8.6 +5.3 0.8.6 ========= *Fixes* @@ -1115,7 +1125,7 @@ File: README.info, Node: 086, Next: 085, Prev: 087, Up: Changelog  File: README.info, Node: 085, Next: 084, Prev: 086, Up: Changelog -5.3 0.8.5 +5.4 0.8.5 ========= *Fixes* @@ -1132,7 +1142,7 @@ File: README.info, Node: 085, Next: 084, Prev: 086, Up: Changelog  File: README.info, Node: 084, Next: 083, Prev: 085, Up: Changelog -5.4 0.8.4 +5.5 0.8.4 ========= *Fixes* @@ -1146,7 +1156,7 @@ File: README.info, Node: 084, Next: 083, Prev: 085, Up: Changelog  File: README.info, Node: 083, Next: 082, Prev: 084, Up: Changelog -5.5 0.8.3 +5.6 0.8.3 ========= *Fixes* @@ -1159,7 +1169,7 @@ File: README.info, Node: 083, Next: 082, Prev: 084, Up: Changelog  File: README.info, Node: 082, Next: 081, Prev: 083, Up: Changelog -5.6 0.8.2 +5.7 0.8.2 ========= *Fixes* @@ -1173,7 +1183,7 @@ File: README.info, Node: 082, Next: 081, Prev: 083, Up: Changelog  File: README.info, Node: 081, Next: 08, Prev: 082, Up: Changelog -5.7 0.8.1 +5.8 0.8.1 ========= *Fixes* @@ -1188,7 +1198,7 @@ File: README.info, Node: 081, Next: 08, Prev: 082, Up: Changelog  File: README.info, Node: 08, Next: 074, Prev: 081, Up: Changelog -5.8 0.8 +5.9 0.8 ======= *Additions* @@ -1244,8 +1254,8 @@ File: README.info, Node: 08, Next: 074, Prev: 081, Up: Changelog  File: README.info, Node: 074, Next: 073, Prev: 08, Up: Changelog -5.9 0.7.4 -========= +5.10 0.7.4 +========== *Fixes* • Ignore empty quoted strings in plain-string queries (#383 @@ -1254,7 +1264,7 @@ File: README.info, Node: 074, Next: 073, Prev: 08, Up: Changelog  File: README.info, Node: 073, Next: 072, Prev: 074, Up: Changelog -5.10 0.7.3 +5.11 0.7.3 ========== *Fixes* @@ -1272,7 +1282,7 @@ File: README.info, Node: 073, Next: 072, Prev: 074, Up: Changelog  File: README.info, Node: 072, Next: 071, Prev: 073, Up: Changelog -5.11 0.7.2 +5.12 0.7.2 ========== *Fixes* @@ -1293,7 +1303,7 @@ File: README.info, Node: 072, Next: 071, Prev: 073, Up: Changelog  File: README.info, Node: 071, Next: 07, Prev: 072, Up: Changelog -5.12 0.7.1 +5.13 0.7.1 ========== *Fixes* @@ -1312,7 +1322,7 @@ File: README.info, Node: 071, Next: 07, Prev: 072, Up: Changelog  File: README.info, Node: 07, Next: 063, Prev: 071, Up: Changelog -5.13 0.7 +5.14 0.7 ======== *Added* @@ -1371,7 +1381,7 @@ File: README.info, Node: 07, Next: 063, Prev: 071, Up: Changelog  File: README.info, Node: 063, Next: 062, Prev: 07, Up: Changelog -5.14 0.6.3 +5.15 0.6.3 ========== *Fixed* @@ -1387,7 +1397,7 @@ File: README.info, Node: 063, Next: 062, Prev: 07, Up: Changelog  File: README.info, Node: 062, Next: 061, Prev: 063, Up: Changelog -5.15 0.6.2 +5.16 0.6.2 ========== *Fixed* @@ -1398,7 +1408,7 @@ File: README.info, Node: 062, Next: 061, Prev: 063, Up: Changelog  File: README.info, Node: 061, Next: 06, Prev: 062, Up: Changelog -5.16 0.6.1 +5.17 0.6.1 ========== *Fixed* @@ -1416,7 +1426,7 @@ File: README.info, Node: 061, Next: 06, Prev: 062, Up: Changelog  File: README.info, Node: 06, Next: 052, Prev: 061, Up: Changelog -5.17 0.6 +5.18 0.6 ======== *Added* @@ -1483,7 +1493,7 @@ File: README.info, Node: 06, Next: 052, Prev: 061, Up: Changelog  File: README.info, Node: 052, Next: 051, Prev: 06, Up: Changelog -5.18 0.5.2 +5.19 0.5.2 ========== *Fixed* @@ -1494,7 +1504,7 @@ File: README.info, Node: 052, Next: 051, Prev: 06, Up: Changelog  File: README.info, Node: 051, Next: 05, Prev: 052, Up: Changelog -5.19 0.5.1 +5.20 0.5.1 ========== *Fixed* @@ -1507,7 +1517,7 @@ File: README.info, Node: 051, Next: 05, Prev: 052, Up: Changelog  File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog -5.20 0.5 +5.21 0.5 ======== *Added* @@ -1548,7 +1558,7 @@ File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog  File: README.info, Node: 049, Next: 048, Prev: 05, Up: Changelog -5.21 0.4.9 +5.22 0.4.9 ========== *Fixed* @@ -1559,7 +1569,7 @@ File: README.info, Node: 049, Next: 048, Prev: 05, Up: Changelog  File: README.info, Node: 048, Next: 047, Prev: 049, Up: Changelog -5.22 0.4.8 +5.23 0.4.8 ========== *Fixed* @@ -1571,7 +1581,7 @@ File: README.info, Node: 048, Next: 047, Prev: 049, Up: Changelog  File: README.info, Node: 047, Next: 046, Prev: 048, Up: Changelog -5.23 0.4.7 +5.24 0.4.7 ========== *Fixed* @@ -1584,7 +1594,7 @@ File: README.info, Node: 047, Next: 046, Prev: 048, Up: Changelog  File: README.info, Node: 046, Next: 045, Prev: 047, Up: Changelog -5.24 0.4.6 +5.25 0.4.6 ========== *Fixed* @@ -1597,7 +1607,7 @@ File: README.info, Node: 046, Next: 045, Prev: 047, Up: Changelog  File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog -5.25 0.4.5 +5.26 0.4.5 ========== *Fixed* @@ -1609,7 +1619,7 @@ File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog  File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog -5.26 0.4.4 +5.27 0.4.4 ========== *Fixed* @@ -1621,7 +1631,7 @@ File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog  File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog -5.27 0.4.3 +5.28 0.4.3 ========== *Fixed* @@ -1631,7 +1641,7 @@ File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog  File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog -5.28 0.4.2 +5.29 0.4.2 ========== *Fixed* @@ -1640,7 +1650,7 @@ File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog  File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog -5.29 0.4.1 +5.30 0.4.1 ========== *Fixed* @@ -1650,7 +1660,7 @@ File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog  File: README.info, Node: 04, Next: 032, Prev: 041, Up: Changelog -5.30 0.4 +5.31 0.4 ======== _Note:_ The next release, 0.5, may include changes which will require @@ -1731,7 +1741,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.31 0.3.2 +5.32 0.3.2 ========== *Fixed* @@ -1744,7 +1754,7 @@ File: README.info, Node: 032, Next: 031, Prev: 04, Up: Changelog  File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog -5.32 0.3.1 +5.33 0.3.1 ========== *Fixed* @@ -1754,7 +1764,7 @@ File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog  File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog -5.33 0.3 +5.34 0.3 ======== *Added* @@ -1822,7 +1832,7 @@ File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog  File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog -5.34 0.2.3 +5.35 0.2.3 ========== *Fixed* @@ -1832,7 +1842,7 @@ File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog  File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog -5.35 0.2.2 +5.36 0.2.2 ========== *Fixed* @@ -1843,7 +1853,7 @@ File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog  File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog -5.36 0.2.1 +5.37 0.2.1 ========== *Fixed* @@ -1853,7 +1863,7 @@ File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog  File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog -5.37 0.2 +5.38 0.2 ======== *Added* @@ -1936,7 +1946,7 @@ File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog  File: README.info, Node: 01, Prev: 02, Up: Changelog -5.38 0.1 +5.39 0.1 ======== First tagged release. @@ -1994,83 +2004,84 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1949 -Node: Screenshots2072 -Node: Installation2190 -Node: Quelpa2704 -Node: Helm support3232 -Node: Usage3635 -Node: Commands4033 -Node: org-ql-find4498 -Node: org-ql-open-link5406 -Node: org-ql-refile6261 -Node: org-ql-search6589 -Node: helm-org-ql8520 -Node: org-ql-view8898 -Node: org-ql-view-sidebar9428 -Node: org-ql-view-recent-items9808 -Node: org-ql-sparse-tree10304 -Node: Queries11104 -Node: Non-sexp query syntax12221 -Node: General predicates13980 -Node: Ancestor/descendant predicates20905 -Node: Date/time predicates22033 -Node: Functions / Macros25157 -Node: Agenda-like views25455 -Ref: Function org-ql-block25617 -Node: Listing / acting-on results26878 -Ref: Caching27086 -Ref: Function org-ql-select27999 -Ref: Function org-ql-query30425 -Ref: Macro org-ql (deprecated)32199 -Node: Custom predicates32514 -Ref: Macro org-ql-defpred32738 -Node: Dynamic block36179 -Node: Links38903 -Node: Tips39590 -Node: Changelog39914 -Node: 08740828 -Node: 08642044 -Node: 08542278 -Node: 08442934 -Node: 08343386 -Node: 08243727 -Node: 08144120 -Node: 0844541 -Node: 07447265 -Node: 07347488 -Node: 07248222 -Node: 07149143 -Node: 0749954 -Node: 06352820 -Node: 06253353 -Node: 06153660 -Node: 0654230 -Node: 05257286 -Node: 05157588 -Node: 0558013 -Node: 04959544 -Node: 04859826 -Node: 04760175 -Node: 04660584 -Node: 04560992 -Node: 04461353 -Node: 04361712 -Node: 04261915 -Node: 04162076 -Node: 0462323 -Node: 03266424 -Node: 03166827 -Node: 0367024 -Node: 02370324 -Node: 02270558 -Node: 02170838 -Node: 0271043 -Node: 0175121 -Node: Notes75222 -Node: Comparison with Org Agenda searches75384 -Node: org-sidebar76273 -Node: License76552 +Node: Contents1971 +Node: Screenshots2094 +Node: Installation2212 +Node: Quelpa2726 +Node: Helm support3254 +Node: Usage3657 +Node: Commands4055 +Node: org-ql-find4520 +Node: org-ql-open-link5428 +Node: org-ql-refile6283 +Node: org-ql-search6611 +Node: helm-org-ql8542 +Node: org-ql-view8920 +Node: org-ql-view-sidebar9450 +Node: org-ql-view-recent-items9830 +Node: org-ql-sparse-tree10326 +Node: Queries11126 +Node: Non-sexp query syntax12243 +Node: General predicates14002 +Node: Ancestor/descendant predicates20927 +Node: Date/time predicates22055 +Node: Functions / Macros25179 +Node: Agenda-like views25477 +Ref: Function org-ql-block25639 +Node: Listing / acting-on results26900 +Ref: Caching27108 +Ref: Function org-ql-select28021 +Ref: Function org-ql-query30447 +Ref: Macro org-ql (deprecated)32221 +Node: Custom predicates32536 +Ref: Macro org-ql-defpred32760 +Node: Dynamic block36201 +Node: Links38925 +Node: Tips39612 +Node: Changelog39936 +Node: 088-pre40872 +Node: 08740984 +Node: 08642216 +Node: 08542450 +Node: 08443106 +Node: 08343558 +Node: 08243899 +Node: 08144292 +Node: 0844713 +Node: 07447437 +Node: 07347662 +Node: 07248396 +Node: 07149317 +Node: 0750128 +Node: 06352994 +Node: 06253527 +Node: 06153834 +Node: 0654404 +Node: 05257460 +Node: 05157762 +Node: 0558187 +Node: 04959718 +Node: 04860000 +Node: 04760349 +Node: 04660758 +Node: 04561166 +Node: 04461527 +Node: 04361886 +Node: 04262089 +Node: 04162250 +Node: 0462497 +Node: 03266598 +Node: 03167001 +Node: 0367198 +Node: 02370498 +Node: 02270732 +Node: 02171012 +Node: 0271217 +Node: 0175295 +Node: Notes75396 +Node: Comparison with Org Agenda searches75558 +Node: org-sidebar76447 +Node: License76726  End Tag Table From 357d533b7546e599308423b072e425db7c854604 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 29 Aug 2024 14:21:50 -0500 Subject: [PATCH 117/145] Fix: (-view--format-element) Remove text properties from keywords Modes like org-indent-mode and org-modern can add text properties to to-do keywords in Org buffers, and those properties can "bleed over" when org-element copies those regions into strings. When those strings are then displayed in an org-ql-view buffer, they can affect how the keywords appear, e.g. having extra spaces prefixing them, which breaks alignment. We apply faces to the keywords ourselves, so we don't need any properties from the source buffer. Fixes #455. --- README.org | 3 +- org-ql-view.el | 3 +- org-ql.info | 90 ++++++++++++++++++++++++++------------------------ 3 files changed, 51 insertions(+), 45 deletions(-) diff --git a/README.org b/README.org index a85e227..593bec4 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.8-pre -Nothing new yet. +*Fixes* ++ Remove text properties from to-do keywords before displaying them in an ~org-ql-view~ buffer. (Such text properties could cause them to, e.g. display with extra leading spaces, depending on which other modes might be enabled in the source Org buffer.) ** 0.8.7 diff --git a/org-ql-view.el b/org-ql-view.el index 41ada72..b5c4bb7 100644 --- a/org-ql-view.el +++ b/org-ql-view.el @@ -872,7 +872,8 @@ return an empty string." (title (--> (org-ql-view--add-faces element) (org-element-property :raw-value it))) (todo-keyword (-some--> (org-element-property :todo-keyword element) - (org-ql-view--add-todo-face it))) + (org-ql-view--add-todo-face + (substring-no-properties it)))) (tag-list (if org-use-tag-inheritance ;; MAYBE: Use our own variable instead of `org-use-tag-inheritance'. (if-let ((marker (or (org-element-property :org-hd-marker element) diff --git a/org-ql.info b/org-ql.info index 2433869..acef674 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1082,7 +1082,11 @@ File: README.info, Node: 088-pre, Next: 087, Up: Changelog 5.1 0.8.8-pre ============= -Nothing new yet. +*Fixes* + • Remove text properties from to-do keywords before displaying them + in an ‘org-ql-view’ buffer. (Such text properties could cause them + to, e.g. display with extra leading spaces, depending on which + other modes might be enabled in the source Org buffer.)  File: README.info, Node: 087, Next: 086, Prev: 088-pre, Up: Changelog @@ -2040,48 +2044,48 @@ Node: Links38925 Node: Tips39612 Node: Changelog39936 Node: 088-pre40872 -Node: 08740984 -Node: 08642216 -Node: 08542450 -Node: 08443106 -Node: 08343558 -Node: 08243899 -Node: 08144292 -Node: 0844713 -Node: 07447437 -Node: 07347662 -Node: 07248396 -Node: 07149317 -Node: 0750128 -Node: 06352994 -Node: 06253527 -Node: 06153834 -Node: 0654404 -Node: 05257460 -Node: 05157762 -Node: 0558187 -Node: 04959718 -Node: 04860000 -Node: 04760349 -Node: 04660758 -Node: 04561166 -Node: 04461527 -Node: 04361886 -Node: 04262089 -Node: 04162250 -Node: 0462497 -Node: 03266598 -Node: 03167001 -Node: 0367198 -Node: 02370498 -Node: 02270732 -Node: 02171012 -Node: 0271217 -Node: 0175295 -Node: Notes75396 -Node: Comparison with Org Agenda searches75558 -Node: org-sidebar76447 -Node: License76726 +Node: 08741255 +Node: 08642487 +Node: 08542721 +Node: 08443377 +Node: 08343829 +Node: 08244170 +Node: 08144563 +Node: 0844984 +Node: 07447708 +Node: 07347933 +Node: 07248667 +Node: 07149588 +Node: 0750399 +Node: 06353265 +Node: 06253798 +Node: 06154105 +Node: 0654675 +Node: 05257731 +Node: 05158033 +Node: 0558458 +Node: 04959989 +Node: 04860271 +Node: 04760620 +Node: 04661029 +Node: 04561437 +Node: 04461798 +Node: 04362157 +Node: 04262360 +Node: 04162521 +Node: 0462768 +Node: 03266869 +Node: 03167272 +Node: 0367469 +Node: 02370769 +Node: 02271003 +Node: 02171283 +Node: 0271488 +Node: 0175566 +Node: Notes75667 +Node: Comparison with Org Agenda searches75829 +Node: org-sidebar76718 +Node: License76997  End Tag Table From 3c1dd3699044c0b1a812c105743a9e574274b7aa Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 29 Aug 2024 14:39:55 -0500 Subject: [PATCH 118/145] Fix: (org-ql-completing-read) Binding of completion-styles-alist Fixes #337. Thanks to Nicholas Vollmer (@progfolio), viz (@9viz), and Karthik Chikmagalur (@karthink) for reporting and suggesting fixes. --- README.org | 1 + org-ql-completing-read.el | 3 +- org-ql.info | 91 +++++++++++++++++++++------------------ 3 files changed, 52 insertions(+), 43 deletions(-) diff --git a/README.org b/README.org index 593bec4..a11f740 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* + Remove text properties from to-do keywords before displaying them in an ~org-ql-view~ buffer. (Such text properties could cause them to, e.g. display with extra leading spaces, depending on which other modes might be enabled in the source Org buffer.) ++ Binding of ~completion-styles-alist~ in ~org-ql-completing-read~. (This fixes compatibility with Helm's ~helm~ completion style, as well as default Emacs completion in recursive minibuffers. [[https://github.com/alphapapa/org-ql/issues/337][#337]]. Thanks to [[https://github.com/progfolio][Nicholas Vollmer]], [[https://github.com/9viz][viz]], and [[https://github.com/karthink][Karthik Chikmagalur]] for reporting and suggesting fixes.) ** 0.8.7 diff --git a/org-ql-completing-read.el b/org-ql-completing-read.el index 4db51e6..e118e82 100644 --- a/org-ql-completing-read.el +++ b/org-ql-completing-read.el @@ -335,7 +335,8 @@ single predicate)." ;; `completing-read'. (mapc #'org-ql--ensure-buffer buffers-files) (let* ((completion-styles '(org-ql-completing-read)) - (completion-styles-alist (list (list 'org-ql-completing-read #'try #'all "Org QL Find"))) + (completion-styles-alist (cons (list 'org-ql-completing-read #'try #'all "Org QL Find") + completion-styles-alist)) (selected (minibuffer-with-setup-hook (lambda () diff --git a/org-ql.info b/org-ql.info index acef674..5ccc6a9 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1087,6 +1087,13 @@ File: README.info, Node: 088-pre, Next: 087, Up: Changelog in an ‘org-ql-view’ buffer. (Such text properties could cause them to, e.g. display with extra leading spaces, depending on which other modes might be enabled in the source Org buffer.) + • Binding of ‘completion-styles-alist’ in ‘org-ql-completing-read’. + (This fixes compatibility with Helm’s ‘helm’ completion style, as + well as default Emacs completion in recursive minibuffers. #337 + (https://github.com/alphapapa/org-ql/issues/337). Thanks to + Nicholas Vollmer (https://github.com/progfolio), viz + (https://github.com/9viz), and Karthik Chikmagalur + (https://github.com/karthink) for reporting and suggesting fixes.)  File: README.info, Node: 087, Next: 086, Prev: 088-pre, Up: Changelog @@ -2044,48 +2051,48 @@ Node: Links38925 Node: Tips39612 Node: Changelog39936 Node: 088-pre40872 -Node: 08741255 -Node: 08642487 -Node: 08542721 -Node: 08443377 -Node: 08343829 -Node: 08244170 -Node: 08144563 -Node: 0844984 -Node: 07447708 -Node: 07347933 -Node: 07248667 -Node: 07149588 -Node: 0750399 -Node: 06353265 -Node: 06253798 -Node: 06154105 -Node: 0654675 -Node: 05257731 -Node: 05158033 -Node: 0558458 -Node: 04959989 -Node: 04860271 -Node: 04760620 -Node: 04661029 -Node: 04561437 -Node: 04461798 -Node: 04362157 -Node: 04262360 -Node: 04162521 -Node: 0462768 -Node: 03266869 -Node: 03167272 -Node: 0367469 -Node: 02370769 -Node: 02271003 -Node: 02171283 -Node: 0271488 -Node: 0175566 -Node: Notes75667 -Node: Comparison with Org Agenda searches75829 -Node: org-sidebar76718 -Node: License76997 +Node: 08741735 +Node: 08642967 +Node: 08543201 +Node: 08443857 +Node: 08344309 +Node: 08244650 +Node: 08145043 +Node: 0845464 +Node: 07448188 +Node: 07348413 +Node: 07249147 +Node: 07150068 +Node: 0750879 +Node: 06353745 +Node: 06254278 +Node: 06154585 +Node: 0655155 +Node: 05258211 +Node: 05158513 +Node: 0558938 +Node: 04960469 +Node: 04860751 +Node: 04761100 +Node: 04661509 +Node: 04561917 +Node: 04462278 +Node: 04362637 +Node: 04262840 +Node: 04163001 +Node: 0463248 +Node: 03267349 +Node: 03167752 +Node: 0367949 +Node: 02371249 +Node: 02271483 +Node: 02171763 +Node: 0271968 +Node: 0176046 +Node: Notes76147 +Node: Comparison with Org Agenda searches76309 +Node: org-sidebar77198 +Node: License77477  End Tag Table From 04b3bd26642ee7374371d1370ccd1ae6d9ca5b9e Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 29 Aug 2024 14:59:58 -0500 Subject: [PATCH 119/145] Fix: Use of org-ql-completing-read--snippet-regexp * org-ql-completing-read.el (org-ql-completing-read-snippet): Call snippet function with argument (org-ql-completing-read): Call snippet function passed in rather than hard-coded function. (org-ql-completing-read--snippet-simple): Accept optional, ignored argument. (org-ql-completing-read--snippet-regexp): Make argument optional; rename for clarity. Fixes #419. Reported-by: tpeacock19 --- README.org | 1 + org-ql-completing-read.el | 26 +++++------- org-ql.info | 87 ++++++++++++++++++++------------------- 3 files changed, 56 insertions(+), 58 deletions(-) diff --git a/README.org b/README.org index a11f740..52fda88 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: *Fixes* + Remove text properties from to-do keywords before displaying them in an ~org-ql-view~ buffer. (Such text properties could cause them to, e.g. display with extra leading spaces, depending on which other modes might be enabled in the source Org buffer.) + Binding of ~completion-styles-alist~ in ~org-ql-completing-read~. (This fixes compatibility with Helm's ~helm~ completion style, as well as default Emacs completion in recursive minibuffers. [[https://github.com/alphapapa/org-ql/issues/337][#337]]. Thanks to [[https://github.com/progfolio][Nicholas Vollmer]], [[https://github.com/9viz][viz]], and [[https://github.com/karthink][Karthik Chikmagalur]] for reporting and suggesting fixes.) ++ Use of the context snippet function for ~org-ql-completing-read~. ([[https://github.com/alphapapa/org-ql/issues/419][#419]]. Thanks to [[https://github.com/tpeacock19][tpeacock19]] for reporting.) ** 0.8.7 diff --git a/org-ql-completing-read.el b/org-ql-completing-read.el index e118e82..b61cf9e 100644 --- a/org-ql-completing-read.el +++ b/org-ql-completing-read.el @@ -106,11 +106,13 @@ value, or nil." ;; responsive as, e.g. Helm while typing, but it seems to ;; help a little when using the org-rifle-style snippets. (org-with-point-at marker - (or (funcall org-ql-completing-read-snippet-function) + (or (funcall org-ql-completing-read-snippet-function + org-ql-completing-read-input-regexp) (org-ql-completing-read--snippet-simple)))) (`t ;; Interrupted: return nil (which can be concatted). nil) - (else else))) + (else (propertize (concat " " else) + 'face 'org-ql-completing-read-snippet)))) (defun org-ql-completing-read-path (marker) "Return formatted outline path for entry at MARKER." @@ -214,15 +216,7 @@ single predicate)." ;; Using `while-no-input' here doesn't make it as responsive as, ;; e.g. Helm while typing, but it seems to help a little when using the ;; org-rifle-style snippets. - (or (snippet (get-text-property 0 'org-marker candidate)) ""))) - (snippet (marker) - (when-let - ((snippet - (org-with-point-at marker - (or (funcall org-ql-completing-read-snippet-function org-ql-completing-read-input-regexp) - (org-ql-completing-read--snippet-simple))))) - (propertize (concat " " snippet) - 'face 'org-ql-completing-read-snippet))) + (or (funcall snippet (get-text-property 0 'org-marker candidate)) ""))) (group (candidate transform) (pcase transform (`nil (buffer-name (marker-buffer (get-text-property 0 'org-marker candidate)))) @@ -368,7 +362,7 @@ single predicate)." (car (hash-table-values table)) (user-error "No results for input")))))) -(defun org-ql-completing-read--snippet-simple () +(defun org-ql-completing-read--snippet-simple (&optional _input-regexp) "Return a snippet of the current entry. Returns up to `org-ql-completing-read-snippet-length' characters." (save-excursion @@ -382,15 +376,15 @@ Returns up to `org-ql-completing-read-snippet-length' characters." t t) 50 nil nil t)))))) -(defun org-ql-completing-read--snippet-regexp (regexp) - "Return a snippet of the current entry's matches for REGEXP." +(defun org-ql-completing-read--snippet-regexp (&optional input-regexp) + "Return a snippet of the current entry's matches for INPUT-REGEXP." ;; REGEXP may be nil if there are no qualifying tokens in the query. - (when regexp + (when input-regexp (save-excursion (org-end-of-meta-data t) (unless (org-at-heading-p) (let* ((end (org-entry-end-position)) - (snippets (cl-loop while (re-search-forward regexp end t) + (snippets (cl-loop while (re-search-forward input-regexp end t) concat (match-string 0) concat "…" do (goto-char (match-end 0))))) (unless (string-empty-p snippets) diff --git a/org-ql.info b/org-ql.info index 5ccc6a9..796716e 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1094,6 +1094,9 @@ File: README.info, Node: 088-pre, Next: 087, Up: Changelog Nicholas Vollmer (https://github.com/progfolio), viz (https://github.com/9viz), and Karthik Chikmagalur (https://github.com/karthink) for reporting and suggesting fixes.) + • Use of the context snippet function for ‘org-ql-completing-read’. + (#419 (https://github.com/alphapapa/org-ql/issues/419). Thanks to + tpeacock19 (https://github.com/tpeacock19) for reporting.)  File: README.info, Node: 087, Next: 086, Prev: 088-pre, Up: Changelog @@ -2051,48 +2054,48 @@ Node: Links38925 Node: Tips39612 Node: Changelog39936 Node: 088-pre40872 -Node: 08741735 -Node: 08642967 -Node: 08543201 -Node: 08443857 -Node: 08344309 -Node: 08244650 -Node: 08145043 -Node: 0845464 -Node: 07448188 -Node: 07348413 -Node: 07249147 -Node: 07150068 -Node: 0750879 -Node: 06353745 -Node: 06254278 -Node: 06154585 -Node: 0655155 -Node: 05258211 -Node: 05158513 -Node: 0558938 -Node: 04960469 -Node: 04860751 -Node: 04761100 -Node: 04661509 -Node: 04561917 -Node: 04462278 -Node: 04362637 -Node: 04262840 -Node: 04163001 -Node: 0463248 -Node: 03267349 -Node: 03167752 -Node: 0367949 -Node: 02371249 -Node: 02271483 -Node: 02171763 -Node: 0271968 -Node: 0176046 -Node: Notes76147 -Node: Comparison with Org Agenda searches76309 -Node: org-sidebar77198 -Node: License77477 +Node: 08741948 +Node: 08643180 +Node: 08543414 +Node: 08444070 +Node: 08344522 +Node: 08244863 +Node: 08145256 +Node: 0845677 +Node: 07448401 +Node: 07348626 +Node: 07249360 +Node: 07150281 +Node: 0751092 +Node: 06353958 +Node: 06254491 +Node: 06154798 +Node: 0655368 +Node: 05258424 +Node: 05158726 +Node: 0559151 +Node: 04960682 +Node: 04860964 +Node: 04761313 +Node: 04661722 +Node: 04562130 +Node: 04462491 +Node: 04362850 +Node: 04263053 +Node: 04163214 +Node: 0463461 +Node: 03267562 +Node: 03167965 +Node: 0368162 +Node: 02371462 +Node: 02271696 +Node: 02171976 +Node: 0272181 +Node: 0176259 +Node: Notes76360 +Node: Comparison with Org Agenda searches76522 +Node: org-sidebar77411 +Node: License77690  End Tag Table From 847c066d54a5015c49b575feb3087601e0554cc2 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 29 Aug 2024 16:30:55 -0500 Subject: [PATCH 120/145] Comment: TODO --- org-ql-completing-read.el | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/org-ql-completing-read.el b/org-ql-completing-read.el index b61cf9e..c5172d8 100644 --- a/org-ql-completing-read.el +++ b/org-ql-completing-read.el @@ -47,12 +47,10 @@ :type 'boolean) (defcustom org-ql-completing-read-snippet-function #'org-ql-completing-read--snippet-simple - ;; TODO: I'd like to make the -regexp one the default, but with - ;; default Emacs completion affixation, it can sometimes be a bit - ;; slow, and I don't want that to be a user's first impression. It - ;; may be possible to further optimize the -regexp one so that it - ;; can be used by default. In the meantime, the -simple one seems - ;; fast enough for general use. + ;; TODO(v0.9): Performance of completion annotations seems to be + ;; much improved now (whether due to changes in Emacs, Vertico, or + ;; both, I don't know). It may be reasonable to make the context + ;; snippet the default now. "Function used to annotate results in `org-ql-completing-read'. Function is called at entry beginning. (When set to `org-ql-completing-read--snippet-regexp', it is called with a From fd82c83d499bfa39835a5223271b60190cf99c57 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 29 Aug 2024 16:35:57 -0500 Subject: [PATCH 121/145] Fix: (org-ql-defpred) Docstring quote escapes --- org-ql.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/org-ql.el b/org-ql.el index f1ad6f1..fd28dcd 100644 --- a/org-ql.el +++ b/org-ql.el @@ -1141,7 +1141,7 @@ defined in `org-ql-predicates' by calling `org-ql-defpred'." (byte-compile 'org-ql--query-preamble))) (cl-defmacro org-ql-defpred (name args docstring &key body preambles normalizers coalesce) - "Define an \\+`org-ql' selector predicate \\=`org-ql--predicate-NAME'. + "Define an Org QL selector predicate \\=`org-ql--predicate-NAME'. NAME may be a symbol or a list of symbols: if a list, the first is used as NAME and the rest are aliases. A function is only created for NAME, not for aliases, so a normalizer should be used @@ -1226,7 +1226,7 @@ Then if NORMALIZERS were: It would be expanded to: - ((\\=`(,(or 'heading 'h) . ,args) + ((\\=`(,(or \\='heading \\='h) . ,args) \\=`(heading ,@args)))" ;; FIXME: Update defpred tutorial to include :coalesce. From 20c0e5a9a76758e45c7d685f461461d99adf3dd8 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 29 Aug 2024 16:37:08 -0500 Subject: [PATCH 122/145] Release: v0.8.8 --- README.org | 2 +- org-ql.el | 2 +- org-ql.info | 168 ++++++++++++++++++++++++++-------------------------- 3 files changed, 86 insertions(+), 86 deletions(-) diff --git a/README.org b/README.org index 52fda88..226c951 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.8-pre +** 0.8.8 *Fixes* + Remove text properties from to-do keywords before displaying them in an ~org-ql-view~ buffer. (Such text properties could cause them to, e.g. display with extra leading spaces, depending on which other modes might be enabled in the source Org buffer.) diff --git a/org-ql.el b/org-ql.el index fd28dcd..a0dc7e8 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-pre +;; Version: 0.8.8 ;; 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 796716e..8a0a0fd 100644 --- a/org-ql.info +++ b/org-ql.info @@ -72,7 +72,7 @@ Functions / Macros Changelog -* 0.8.8-pre: 088-pre. +* 0.8.8: 088. * 0.8.7: 087. * 0.8.6: 086. * 0.8.5: 085. @@ -1036,7 +1036,7 @@ releases. * Menu: -* 0.8.8-pre: 088-pre. +* 0.8.8: 088. * 0.8.7: 087. * 0.8.6: 086. * 0.8.5: 085. @@ -1077,10 +1077,10 @@ releases. * 0.1: 01.  -File: README.info, Node: 088-pre, Next: 087, Up: Changelog +File: README.info, Node: 088, Next: 087, Up: Changelog -5.1 0.8.8-pre -============= +5.1 0.8.8 +========= *Fixes* • Remove text properties from to-do keywords before displaying them @@ -1099,7 +1099,7 @@ File: README.info, Node: 088-pre, Next: 087, Up: Changelog tpeacock19 (https://github.com/tpeacock19) for reporting.)  -File: README.info, Node: 087, Next: 086, Prev: 088-pre, Up: Changelog +File: README.info, Node: 087, Next: 086, Prev: 088, Up: Changelog 5.2 0.8.7 ========= @@ -2018,84 +2018,84 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1971 -Node: Screenshots2094 -Node: Installation2212 -Node: Quelpa2726 -Node: Helm support3254 -Node: Usage3657 -Node: Commands4055 -Node: org-ql-find4520 -Node: org-ql-open-link5428 -Node: org-ql-refile6283 -Node: org-ql-search6611 -Node: helm-org-ql8542 -Node: org-ql-view8920 -Node: org-ql-view-sidebar9450 -Node: org-ql-view-recent-items9830 -Node: org-ql-sparse-tree10326 -Node: Queries11126 -Node: Non-sexp query syntax12243 -Node: General predicates14002 -Node: Ancestor/descendant predicates20927 -Node: Date/time predicates22055 -Node: Functions / Macros25179 -Node: Agenda-like views25477 -Ref: Function org-ql-block25639 -Node: Listing / acting-on results26900 -Ref: Caching27108 -Ref: Function org-ql-select28021 -Ref: Function org-ql-query30447 -Ref: Macro org-ql (deprecated)32221 -Node: Custom predicates32536 -Ref: Macro org-ql-defpred32760 -Node: Dynamic block36201 -Node: Links38925 -Node: Tips39612 -Node: Changelog39936 -Node: 088-pre40872 -Node: 08741948 -Node: 08643180 -Node: 08543414 -Node: 08444070 -Node: 08344522 -Node: 08244863 -Node: 08145256 -Node: 0845677 -Node: 07448401 -Node: 07348626 -Node: 07249360 -Node: 07150281 -Node: 0751092 -Node: 06353958 -Node: 06254491 -Node: 06154798 -Node: 0655368 -Node: 05258424 -Node: 05158726 -Node: 0559151 -Node: 04960682 -Node: 04860964 -Node: 04761313 -Node: 04661722 -Node: 04562130 -Node: 04462491 -Node: 04362850 -Node: 04263053 -Node: 04163214 -Node: 0463461 -Node: 03267562 -Node: 03167965 -Node: 0368162 -Node: 02371462 -Node: 02271696 -Node: 02171976 -Node: 0272181 -Node: 0176259 -Node: Notes76360 -Node: Comparison with Org Agenda searches76522 -Node: org-sidebar77411 -Node: License77690 +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  End Tag Table From f72feb80184749a2f39bb769081d17b0da0e0684 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 4 Sep 2024 21:40:36 -0500 Subject: [PATCH 123/145] 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 124/145] 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 125/145] 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 126/145] 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 127/145] 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 128/145] 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 129/145] 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 130/145] 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 131/145] 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 132/145] 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 133/145] 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 134/145] 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 135/145] 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 136/145] 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 137/145] 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 138/145] 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 139/145] 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 140/145] 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 141/145] 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 142/145] 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 143/145] 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 144/145] =?UTF-8?q?Docs:=20Remove=20grammatical=20typo=20f?= =?UTF-8?q?rom=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 145/145] 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