From 46f523d94a376b168176c75bbd0e3e0d00e61170 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Fri, 18 Mar 2022 10:34:54 -0500 Subject: [PATCH 001/224] Meta: 0.7-pre --- README.org | 4 ++ org-ql.el | 2 +- org-ql.info | 167 ++++++++++++++++++++++++++++------------------------ 3 files changed, 94 insertions(+), 79 deletions(-) diff --git a/README.org b/README.org index c1a383c..c6e4daa 100644 --- a/README.org +++ b/README.org @@ -522,6 +522,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-pre + +Nothing new yet. + ** 0.6.1 *Fixed* diff --git a/org-ql.el b/org-ql.el index 6cb3ead..ffed560 100644 --- a/org-ql.el +++ b/org-ql.el @@ -2,7 +2,7 @@ ;; Author: Adam Porter ;; Url: https://github.com/alphapapa/org-ql -;; Version: 0.6.1 +;; Version: 0.7-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") (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 b970f67..84895de 100644 --- a/org-ql.info +++ b/org-ql.info @@ -69,6 +69,7 @@ Functions / Macros Changelog +* 0.7-pre: 07-pre. * 0.6.1: 061. * 0.6: 06. * 0.5.2: 052. @@ -958,6 +959,7 @@ releases. * Menu: +* 0.7-pre: 07-pre. * 0.6.1: 061. * 0.6: 06. * 0.5.2: 052. @@ -983,9 +985,17 @@ releases. * 0.1: 01.  -File: README.info, Node: 061, Next: 06, Up: Changelog +File: README.info, Node: 07-pre, Next: 061, Up: Changelog -5.1 0.6.1 +5.1 0.7-pre +=========== + +Nothing new yet. + + +File: README.info, Node: 061, Next: 06, Prev: 07-pre, Up: Changelog + +5.2 0.6.1 ========= *Fixed* @@ -1003,7 +1013,7 @@ File: README.info, Node: 061, Next: 06, Up: Changelog  File: README.info, Node: 06, Next: 052, Prev: 061, Up: Changelog -5.2 0.6 +5.3 0.6 ======= *Added* @@ -1070,7 +1080,7 @@ File: README.info, Node: 06, Next: 052, Prev: 061, Up: Changelog  File: README.info, Node: 052, Next: 051, Prev: 06, Up: Changelog -5.3 0.5.2 +5.4 0.5.2 ========= *Fixed* @@ -1081,7 +1091,7 @@ File: README.info, Node: 052, Next: 051, Prev: 06, Up: Changelog  File: README.info, Node: 051, Next: 05, Prev: 052, Up: Changelog -5.4 0.5.1 +5.5 0.5.1 ========= *Fixed* @@ -1094,7 +1104,7 @@ File: README.info, Node: 051, Next: 05, Prev: 052, Up: Changelog  File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog -5.5 0.5 +5.6 0.5 ======= *Added* @@ -1135,7 +1145,7 @@ File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog  File: README.info, Node: 049, Next: 048, Prev: 05, Up: Changelog -5.6 0.4.9 +5.7 0.4.9 ========= *Fixed* @@ -1146,7 +1156,7 @@ File: README.info, Node: 049, Next: 048, Prev: 05, Up: Changelog  File: README.info, Node: 048, Next: 047, Prev: 049, Up: Changelog -5.7 0.4.8 +5.8 0.4.8 ========= *Fixed* @@ -1158,7 +1168,7 @@ File: README.info, Node: 048, Next: 047, Prev: 049, Up: Changelog  File: README.info, Node: 047, Next: 046, Prev: 048, Up: Changelog -5.8 0.4.7 +5.9 0.4.7 ========= *Fixed* @@ -1171,8 +1181,8 @@ File: README.info, Node: 047, Next: 046, Prev: 048, Up: Changelog  File: README.info, Node: 046, Next: 045, Prev: 047, Up: Changelog -5.9 0.4.6 -========= +5.10 0.4.6 +========== *Fixed* • Compatibility with newer versions of the peg library, which removed @@ -1184,7 +1194,7 @@ File: README.info, Node: 046, Next: 045, Prev: 047, Up: Changelog  File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog -5.10 0.4.5 +5.11 0.4.5 ========== *Fixed* @@ -1196,7 +1206,7 @@ File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog  File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog -5.11 0.4.4 +5.12 0.4.4 ========== *Fixed* @@ -1208,7 +1218,7 @@ File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog  File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog -5.12 0.4.3 +5.13 0.4.3 ========== *Fixed* @@ -1218,7 +1228,7 @@ File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog  File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog -5.13 0.4.2 +5.14 0.4.2 ========== *Fixed* @@ -1227,7 +1237,7 @@ File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog  File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog -5.14 0.4.1 +5.15 0.4.1 ========== *Fixed* @@ -1237,7 +1247,7 @@ File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog  File: README.info, Node: 04, Next: 032, Prev: 041, Up: Changelog -5.15 0.4 +5.16 0.4 ======== _Note:_ The next release, 0.5, may include changes which will require @@ -1318,7 +1328,7 @@ as they will be pushed to the master branch when ready.  File: README.info, Node: 032, Next: 031, Prev: 04, Up: Changelog -5.16 0.3.2 +5.17 0.3.2 ========== *Fixed* @@ -1331,7 +1341,7 @@ File: README.info, Node: 032, Next: 031, Prev: 04, Up: Changelog  File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog -5.17 0.3.1 +5.18 0.3.1 ========== *Fixed* @@ -1341,7 +1351,7 @@ File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog  File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog -5.18 0.3 +5.19 0.3 ======== *Added* @@ -1406,7 +1416,7 @@ File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog  File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog -5.19 0.2.3 +5.20 0.2.3 ========== *Fixed* @@ -1416,7 +1426,7 @@ File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog  File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog -5.20 0.2.2 +5.21 0.2.2 ========== *Fixed* @@ -1427,7 +1437,7 @@ File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog  File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog -5.21 0.2.1 +5.22 0.2.1 ========== *Fixed* @@ -1437,7 +1447,7 @@ File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog  File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog -5.22 0.2 +5.23 0.2 ======== *Added* @@ -1520,7 +1530,7 @@ File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog  File: README.info, Node: 01, Prev: 02, Up: Changelog -5.23 0.1 +5.24 0.1 ======== First tagged release. @@ -1578,59 +1588,60 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1704 -Node: Screenshots1827 -Node: Installation1945 -Node: Quelpa2441 -Node: Helm support2969 -Node: Usage3360 -Node: Commands3758 -Node: org-ql-search4231 -Node: helm-org-ql5881 -Node: org-ql-view6241 -Node: org-ql-view-sidebar6741 -Node: org-ql-view-recent-items7097 -Node: org-ql-sparse-tree7581 -Node: Queries8381 -Node: Non-sexp query syntax9492 -Node: General predicates11216 -Node: Ancestor/descendant predicates17437 -Node: Date/time predicates18565 -Node: Functions / Macros21653 -Node: Agenda-like views21951 -Node: Listing / acting-on results23356 -Node: Custom predicates28992 -Node: Dynamic block32651 -Node: Links35363 -Node: Tips36050 -Node: Changelog36368 -Node: 06137101 -Node: 0637657 -Node: 05240668 -Node: 05140968 -Node: 0541385 -Node: 04942859 -Node: 04843133 -Node: 04743480 -Node: 04643875 -Node: 04544275 -Node: 04444636 -Node: 04344995 -Node: 04245192 -Node: 04145353 -Node: 0445594 -Node: 03249527 -Node: 03149906 -Node: 0350103 -Node: 02353078 -Node: 02253306 -Node: 02153574 -Node: 0253773 -Node: 0157808 -Node: Notes57909 -Node: Comparison with Org Agenda searches58071 -Node: org-sidebar58943 -Node: License59222 +Node: Contents1724 +Node: Screenshots1847 +Node: Installation1965 +Node: Quelpa2461 +Node: Helm support2989 +Node: Usage3380 +Node: Commands3778 +Node: org-ql-search4251 +Node: helm-org-ql5901 +Node: org-ql-view6261 +Node: org-ql-view-sidebar6761 +Node: org-ql-view-recent-items7117 +Node: org-ql-sparse-tree7601 +Node: Queries8401 +Node: Non-sexp query syntax9512 +Node: General predicates11236 +Node: Ancestor/descendant predicates17457 +Node: Date/time predicates18585 +Node: Functions / Macros21673 +Node: Agenda-like views21971 +Node: Listing / acting-on results23376 +Node: Custom predicates29012 +Node: Dynamic block32671 +Node: Links35383 +Node: Tips36070 +Node: Changelog36388 +Node: 07-pre37141 +Node: 06137248 +Node: 0637819 +Node: 05240830 +Node: 05141130 +Node: 0541547 +Node: 04943021 +Node: 04843295 +Node: 04743642 +Node: 04644037 +Node: 04544439 +Node: 04444800 +Node: 04345159 +Node: 04245356 +Node: 04145517 +Node: 0445758 +Node: 03249691 +Node: 03150070 +Node: 0350267 +Node: 02353242 +Node: 02253470 +Node: 02153738 +Node: 0253937 +Node: 0157972 +Node: Notes58073 +Node: Comparison with Org Agenda searches58235 +Node: org-sidebar59107 +Node: License59386  End Tag Table From d0acc8cbba63ef50f1c0ecffdf1770792b13592d Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Mon, 30 May 2022 09:23:46 -0500 Subject: [PATCH 002/224] Add: (org-ql-find) --- README.org | 20 +- images/org-ql-find.png | Bin 0 -> 94724 bytes org-ql-find.el | 178 +++++++++++++ org-ql.info | 563 ++++++++++++++++++++++------------------- 4 files changed, 496 insertions(+), 265 deletions(-) create mode 100644 images/org-ql-find.png create mode 100644 org-ql-find.el diff --git a/README.org b/README.org index 61fe3bd..507c328 100644 --- a/README.org +++ b/README.org @@ -94,6 +94,9 @@ Lisp code examples are in [[examples.org]]. :TOC: ignore-children :END: ++ *Jumping to an entry:* + - [[#org-ql-find][org-ql-find]] (command) + - [[#helm-org-ql][helm-org-ql]] (command) + *Showing an agenda-like view:* - [[#org-ql-search][org-ql-search]] (command) - [[#org-ql-view][org-ql-view]] (command) @@ -101,8 +104,18 @@ Lisp code examples are in [[examples.org]]. - [[#org-ql-view-recent-items][org-ql-view-recent-items]] (command) + *Showing a tree in a buffer:* - [[#org-ql-sparse-tree][org-ql-sparse-tree]] (command) -+ *Showing results with Helm*: - - [[#helm-org-ql][helm-org-ql]] (command) + +*** org-ql-find + +/Note: These commands use [[#non-sexp-query-syntax][non-sexp queries]]./ + +These commands jump to a heading selected using Emacs's built-in completion facilities with an Org QL query: + +- ~org-ql-find~ searches all entry content. +- ~org-ql-find-path~ searches only headings (using the ~outline-path:~ predicate). +- ~org-ql-find-heading~ searches only headings (using the ~heading:~ predicate). + +[[images/org-ql-find.png]] *** org-ql-search @@ -524,7 +537,8 @@ Simple links may also be written manually in either sexp or non-sexp form, like: ** 0.7-pre -Nothing new yet. +*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.). ** 0.6.2 diff --git a/images/org-ql-find.png b/images/org-ql-find.png new file mode 100644 index 0000000000000000000000000000000000000000..34359d09a48f1267c2cb29ee5d4e2b729f240427 GIT binary patch literal 94724 zcmeAS@N?(olHy`uVBq!ia0y~yU|P$-z{JGC#K6FiRg!$1fq{X!*vT`5gM;JtL;nX1 z3=EtF9+AZi417mGm~pB$pELtw;c`zG$B>F!Z|1T`h`3815BFVktnJ7&m*OlD(cY%L z&8((wmIs)Zglj4(baZH35}XjXw98|_PC$mvwOARmgm$g@4p58D&N9k(O>Q7d`Zrys_JZaI5 zjRNz}?6Hfo@4a>9+KdSk&*U0Ed2iqQ(^58I;*M7T>S;v_Vn5i4aKi?qUtWwFi!0eCtyq`1gKL*@OO93|XO@ zW{ag>XM5LM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&wI_6nKG zn*?^QKB2d7?i`7If=kYB+-ZEH>i)qag|cz&`Ry;mE{Eu|CHq&@@`ug-yENj_3B}0z z7ugZ|f|s8hj($_B?|!K);D7U)8GDP46}y&-$rTve-T%-y+dcUhjrfXtmFJ_~X0Lds`9F1OwX7BAhIj5&Cps>;n!WNo{qu*| zw!UMGvD+u{SlX%=dQKwCOZ$$6R zW|F?CtNpX0B2Ay|Y3`jbN6IbkwH<$Z;k3?WTj_%Re)E5we)M%WZ?LpLz1_XuD^o;% zl-}~UsX6_j&GURjOaa4{YJE5H|F>=K&0qd;?UC2>*ZnY%+gpF4ylGDAi}t@yiZe1k z*q>Ed$9j~Jy;-mJK40S3f<-g-yKC54Z2Ko8^Q-*Z?R~7rEA#W;LuWASrppU0v`Fa6 zK3V=%R@R#XJcs$XTCP`tgYQOK$hTgR#C@}y=bl~rH#hU1&4SLbMCsN4lU;)Z_?G1I z{QA^#T9HSpddu03o&PVad+l?1LBpemt-62zzJEQLhsUuo*^&QWuVfCvS|?ZyZA@Z=*Y(Z6`S<_!5XdBEef_PkyCoZct&6<=f8oY22J_OA-&HSv&b~tG*Ns2N zpGtp>48MFTZp)Yd86V$24*Yxg^v$J_&rhGuvii5&XV*jLDXLbYWxeNx|6hIjpTYRY Wr5k-;Dj$LNeR{h3xvX + +;; 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 +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; This library provides a way to quickly find and go to Org entries +;; selected with Emacs's built-in completions API (so it works with +;; packages that extend it, like Vertico, Marginalia, etc). It works +;; like `helm-org-ql' but does not require Helm. + +;;; Code: + +(require 'cl-lib) + +(require 'org) +(require 'org-ql) + +;;;; Customization + +(defgroup org-ql-find nil + "Options for `org-ql-find'." + :group 'org-ql) + +(defcustom org-ql-find-reverse-paths t + "Whether to reverse Org outline paths in `org-ql-find' results." + :type 'boolean) + +(defcustom org-ql-find-goto-hook '(org-show-entry) + "Functions called when selecting an entry." + :type 'hook) + +(defface org-ql-find-snippet '((t (:inherit font-lock-comment-face))) + "Snippets.") + +;;;; Functions + +;;;###autoload +(cl-defun org-ql-find (buffers-files &key query-prefix + (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. + +If QUERY-PREFIX, prepend it to the query (e.g. use \"heading:\" +to only search headings, easily creating a custom command that +saves the user from having to type it)." + (interactive + (list (if current-prefix-arg + (mapcar #'get-buffer + (completing-read-multiple + "Buffers: " + (mapcar #'buffer-name + (cl-remove-if-not (lambda (buffer) + (eq 'org-mode (buffer-local-value 'major-mode buffer))) + (buffer-list))) nil t)) + (current-buffer)))) + ;; Emacs's completion API is not always easy to understand, + ;; especially when using "programmed completion." This code was + ;; made possible by the example Clemens Radermacher shared at + ;; . + (let ((table (make-hash-table :test #'equal)) + (window-width (window-width))) + (cl-labels ((action + () (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-find-reverse-paths + (string-join (nreverse path) "\\") + (string-join path "/")))) + (puthash path (point-marker) table) + path)) + (affix (completions) + (cl-loop for completion in completions + for marker = (gethash completion table) + for todo-state = (if-let (it (org-entry-get marker "TODO")) + (concat (propertize it + 'face (org-get-todo-face it)) + " ") + "") + for snippet = (if-let (it (snippet marker)) + (propertize (concat " " it) + 'face 'org-ql-find-snippet) + "") + collect (list completion todo-state snippet))) + (annotate (candidate) + (or (snippet (gethash candidate table)) "")) + (snippet (marker) + (org-with-point-at marker + (org-end-of-meta-data t) + (unless (org-at-heading-p) + (let ((end (min (+ (point) 51) + (org-entry-end-position)))) + (truncate-string-to-width + (replace-regexp-in-string "\n" " " (buffer-substring (point) end) + t t) + 50 nil nil t))))) + (group (candidate transform) + (pcase transform + (`nil (buffer-name (marker-buffer (gethash candidate table)))) + (_ candidate))) + (try (string _table _pred point &optional _metadata) + (cons string point)) + (all (string table pred _point) + (all-completions string table pred)) + (collection (str _pred flag) + (pcase flag + ('metadata (list 'metadata + (cons 'group-function #'group) + (cons 'affixation-function #'affix) + (cons 'annotation-function #'annotate))) + (`t (unless (string-empty-p str) + (org-ql-select buffers-files (org-ql--query-string-to-sexp (concat query-prefix str)) + :action #'action)))))) + (let* ((completion-styles '(org-ql-find)) + (completion-styles-alist (list (list 'org-ql-find #'try #'all "Org QL Find"))) + (selected (completing-read prompt #'collection nil)) + (marker (gethash selected table))) + (with-current-buffer (marker-buffer marker) + (goto-char marker) + (display-buffer (current-buffer)) + (run-hook-with-args 'org-ql-find-goto-hook)))))) + +;;;###autoload +(defun org-ql-find-heading (buffers-files) + "Go to an Org entry in BUFFERS-FILES selected by searching with `org-ql'. +Only headings are searched (using the \"heading:\" predicate). +Interactively, with universal prefix, select multiple buffers to +search with completion." + (interactive + (list (if current-prefix-arg + (mapcar #'get-buffer + (completing-read-multiple + "Buffers: " + (mapcar #'buffer-name + (cl-remove-if-not (lambda (buffer) + (eq 'org-mode (buffer-local-value 'major-mode buffer))) + (buffer-list))) nil t)) + (current-buffer)))) + (org-ql-find buffers-files :prompt "Find heading: " :query-prefix "heading:")) + +;;;###autoload +(defun org-ql-find-path (buffers-files) + "Go to an Org entry in BUFFERS-FILES selected by searching with `org-ql'. +Only outline paths are searched (using the \"outline-path:\" +predicate). Interactively, with universal prefix, select +multiple buffers to search with completion." + (interactive + (list (if current-prefix-arg + (mapcar #'get-buffer + (completing-read-multiple + "Buffers: " + (mapcar #'buffer-name + (cl-remove-if-not (lambda (buffer) + (eq 'org-mode (buffer-local-value 'major-mode buffer))) + (buffer-list))) nil t)) + (current-buffer)))) + (org-ql-find buffers-files :prompt "Find outline path: " :query-prefix "outline-path:")) + +(provide 'org-ql-find) + +;;; org-ql-find.el ends here diff --git a/org-ql.info b/org-ql.info index 84895de..0576cf5 100644 --- a/org-ql.info +++ b/org-ql.info @@ -11,6 +11,14 @@ File: README.info, Node: Top, Next: Contents, Up: (dir) org-ql ****** +This package provides a query language for Org files. It offers two +syntax styles: Lisp-like sexps and search engine-like keywords. + + It includes three libraries: The ‘org-ql’ library is flexible and may +be used as a backend for other tools. The libraries ‘org-ql-search’ and +‘helm-org-ql’ (a separate package) provide interactive search commands +and saved views. + * Menu: * Contents:: @@ -23,15 +31,11 @@ org-ql — The Detailed Node Listing — - - Installation * Quelpa:: * Helm support:: - - Usage * Commands:: @@ -43,6 +47,7 @@ Usage Commands +* org-ql-find:: * org-ql-search:: * helm-org-ql:: * org-ql-view:: @@ -50,8 +55,6 @@ Commands * org-ql-view-recent-items:: * org-ql-sparse-tree:: - - Queries * Non-sexp query syntax:: @@ -59,8 +62,6 @@ Queries * Ancestor/descendant predicates:: * Date/time predicates:: - - Functions / Macros * Agenda-like views:: @@ -70,6 +71,7 @@ Functions / Macros Changelog * 0.7-pre: 07-pre. +* 0.6.2: 062. * 0.6.1: 061. * 0.6: 06. * 0.5.2: 052. @@ -94,20 +96,11 @@ Changelog * 0.2: 02. * 0.1: 01. - - Notes * Comparison with Org Agenda searches:: * org-sidebar:: -This package provides a query language for Org files. It offers two -syntax styles: Lisp-like sexps and search engine-like keywords. - - It includes three libraries: The org-ql library is flexible and may -be used as a backend for other tools. The libraries org-ql-search and -helm-org-ql (a separate package) provide interactive search commands and -saved views.  File: README.info, Node: Contents, Next: Screenshots, Prev: Top, Up: Top @@ -128,13 +121,13 @@ File: README.info, Node: Installation, Next: Usage, Prev: Screenshots, Up: T 3 Installation ************** -The package org-ql may be installed directly from MELPA +The package ‘org-ql’ may be installed directly from MELPA (https://melpa.org/#/org-ql) or with other tools like Quelpa (https://framagit.org/steckerhalter/quelpa). After installation, you can use the commands without additional configuration. To use the functions and macros in your own Elisp code, -use libraries org-ql and org-ql-view. +use libraries ‘org-ql’ and ‘org-ql-view’. * Menu: @@ -165,8 +158,8 @@ File: README.info, Node: Helm support, Prev: Quelpa, Up: Installation 3.2 Helm support ================ -The command helm-org-ql is available in the package helm-org-ql. It may -be installed from MELPA, or with Quelpa, like so: +The command ‘helm-org-ql’ is available in the package ‘helm-org-ql’. It +may be installed from MELPA, or with Quelpa, like so: (use-package helm-org-ql :quelpa (helm-org-ql :fetcher github :repo "alphapapa/org-ql" @@ -200,6 +193,9 @@ File: README.info, Node: Commands, Next: Queries, Up: Usage 4.1 Commands ============ + • *Jumping to an entry:* + • (command) + • (command) • *Showing an agenda-like view:* • (command) • (command) @@ -207,11 +203,10 @@ File: README.info, Node: Commands, Next: Queries, Up: Usage • (command) • *Showing a tree in a buffer:* • (command) - • *Showing results with Helm*: - • (command) * Menu: +* org-ql-find:: * org-ql-search:: * helm-org-ql:: * org-ql-view:: @@ -220,9 +215,26 @@ File: README.info, Node: Commands, Next: Queries, Up: Usage * org-ql-sparse-tree::  -File: README.info, Node: org-ql-search, Next: helm-org-ql, Up: Commands +File: README.info, Node: org-ql-find, Next: org-ql-search, Up: Commands -4.1.1 org-ql-search +4.1.1 org-ql-find +----------------- + +_Note: These commands use ._ + + These commands jump to a heading selected using Emacs’s built-in +completion facilities with an Org QL query: + + • ‘org-ql-find’ searches all entry content. + • ‘org-ql-find-path’ searches only headings (using the + ‘outline-path:’ predicate). + • ‘org-ql-find-heading’ searches only headings (using the ‘heading:’ + predicate). + + +File: README.info, Node: org-ql-search, Next: helm-org-ql, Prev: org-ql-find, Up: Commands + +4.1.2 org-ql-search ------------------- _Note: This command supports both sexp queries and ._ @@ -249,10 +261,10 @@ Interactively, with prefix, leave narrowed. ‘priority’. *Bindings:* Keys bound in results buffer. - • r: Refresh results. With prefix, prompt to adjust search + • ‘r’: Refresh results. With prefix, prompt to adjust search parameters. - • v: Show transient view dispatcher (like Magit’s popups). - • C-x C-s: Save query to variable ‘org-ql-views’ (accessible with + • ‘v’: Show ‘transient’ view dispatcher (like Magit’s popups). + • ‘C-x C-s’: Save query to variable ‘org-ql-views’ (accessible with command ‘org-ql-view’). *Note:* The view buffer is currently put in ‘org-agenda-mode’, which @@ -265,57 +277,57 @@ text properties are placed on each item, imitating an Agenda buffer.)  File: README.info, Node: helm-org-ql, Next: org-ql-view, Prev: org-ql-search, Up: Commands -4.1.2 helm-org-ql +4.1.3 helm-org-ql ----------------- _Note: This command uses . It is available separately in the package -helm-org-ql._ +‘helm-org-ql’._ This command displays matches with Helm. - • Press C-x C-s in the Helm session to save the results to an - org-ql-search buffer. + • Press ‘C-x C-s’ in the Helm session to save the results to an + ‘org-ql-search’ buffer.  File: README.info, Node: org-ql-view, Next: org-ql-view-sidebar, Prev: helm-org-ql, Up: Commands -4.1.3 org-ql-view +4.1.4 org-ql-view ----------------- Choose and display a view stored in ‘org-ql-views’. *Bindings:* Keys bound in view buffer. - • g, r: Refresh results. With prefix, prompt to adjust search + • ‘g’, ‘r’: Refresh results. With prefix, prompt to adjust search parameters. - • v: Show transient view dispatcher (like Magit’s popups). - • C-x C-s: Save query to variable ‘org-ql-views’ (accessible with + • ‘v’: Show ‘transient’ view dispatcher (like Magit’s popups). + • ‘C-x C-s’: Save query to variable ‘org-ql-views’ (accessible with command ‘org-ql-view’).  File: README.info, Node: org-ql-view-sidebar, Next: org-ql-view-recent-items, Prev: org-ql-view, Up: Commands -4.1.4 org-ql-view-sidebar +4.1.5 org-ql-view-sidebar ------------------------- -Show a sidebar window listing views stored in org-ql-views for easy -access. In the sidebar, press RET or mouse-1 to show the view at point, -and press c to customize the view at point. +Show a sidebar window listing views stored in ‘org-ql-views’ for easy +access. In the sidebar, press ‘RET’ or ‘mouse-1’ to show the view at +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.5 org-ql-view-recent-items +4.1.6 org-ql-view-recent-items ------------------------------ Show items in ‘FILES’ from last ‘DAYS’ days with timestamps of ‘TYPE’. ‘TYPE’ may be ‘ts’, ‘ts-active’, ‘ts-inactive’, ‘clocked’, ‘closed’, -‘deadline’, ‘planning’, or ‘scheduled’. FILES defaults to those -returned by the function org-agenda-files. +‘deadline’, ‘planning’, or ‘scheduled’. ‘FILES’ defaults to those +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.6 org-ql-sparse-tree +4.1.7 org-ql-sparse-tree ------------------------ Arguments: ‘(query &key keep-previous (buffer (current-buffer)))’ @@ -337,7 +349,7 @@ File: README.info, Node: Queries, Next: Functions / Macros, Prev: Commands, =========== • • • • - An org-ql query is a Lisp expression which may contain arbitrary + An ‘org-ql’ query is a Lisp expression which may contain arbitrary expressions, as well as calling certain built-in predicates. It is byte-compiled into a predicate function which is tested with point on each heading in an Org buffer; when it returns non-nil, the heading @@ -366,11 +378,11 @@ File: README.info, Node: Non-sexp query syntax, Next: General predicates, Up: 4.2.1 Non-sexp query syntax --------------------------- -The command org-ql-search also accepts, and the command helm-org-ql only -accepts, an alternative, non-sexp query syntax. The syntax is simple, -and a few examples of queries in both syntaxes should suffice. By -default, when multiple predicates are used, they are combined with -boolean and. +The command ‘org-ql-search’ also accepts, and the command ‘helm-org-ql’ +only accepts, an alternative, non-sexp query syntax. The syntax is +simple, and a few examples of queries in both syntaxes should suffice. +By default, when multiple predicates are used, they are combined with +boolean ‘and’. Sexp syntax Non-sexp syntax ------------------------------------------------------------------------------------------------------- @@ -386,9 +398,9 @@ Sexp syntax Non-sexp syntax ‘(and (tags "space") (not (regexp "moon")))’ ‘tags:space !moon’ ‘(priority >= B)’ ‘priority:A,B’ - Note that the effort, level, and priority predicates do not support -comparators in the non-sexp syntax, so multiple arguments should be -passed instead, as seen in the last example. + Note that the ‘effort’, ‘level’, and ‘priority’ predicates do not +support comparators in the non-sexp syntax, so multiple arguments should +be passed instead, as seen in the last example.  File: README.info, Node: General predicates, Next: Ancestor/descendant predicates, Prev: Non-sexp query syntax, Up: Queries @@ -410,14 +422,14 @@ Arguments are listed next to predicate names, where applicable. 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. + ‘DURATION’ should be an Org effort string, like ‘5’ or ‘0:05’. ‘habit’ Return non-nil if entry is a habit. ‘heading (&rest strings)’ Return non-nil if current entry’s heading matches all ‘STRINGS’. Matching is done case-insensitively. - • Aliases: h. -‘‘heading-regexp (&rest regexps)’’ + • Aliases: ‘h’. +‘heading-regexp (&rest regexps)’ Return non-nil if current entry’s heading matches all ‘REGEXPS’ (regexp strings). Matching is done case-insensitively. • Aliases: ‘h*’. @@ -437,8 +449,8 @@ Arguments are listed next to predicate names, where applicable. ‘outline-path (&rest strings)’ Return non-nil if current node’s outline path matches all of ‘STRINGS’. Each string may appear as a substring in any part of - the node’s outline path. For example, the path Food/Fruits/Grapes - would match ‘(olp "Fruit" "Grape")’. + the node’s outline path. For example, the path + ‘Food/Fruits/Grapes’ would match ‘(olp "Fruit" "Grape")’. • Aliases: ‘olp’. ‘outline-path-segment (&rest strings)’ Return non-nil if current node’s outline path matches ‘STRINGS’. @@ -470,8 +482,8 @@ Arguments are listed next to predicate names, where applicable. 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. -‘‘src (&key lang regexps)’’ + • Aliases: ‘r’. +‘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. @@ -553,10 +565,10 @@ to look forward, or negative to look backward), a string parseable by Return non-nil if current entry has a timestamp in given period. Without arguments, return non-nil if entry has a timestamp. - ‘ts-active, ts-a’ - Like ts, but only matches active timestamps. - ‘ts-inactive, ts-i’ - Like ts, but only matches inactive timestamps. + ‘ts-active’, ‘ts-a’ + Like ‘ts’, but only matches active timestamps. + ‘ts-inactive’, ‘ts-i’ + Like ‘ts’, but only matches inactive timestamps. The following predicates, in addition to the keyword arguments, can also take a single argument, a number, which looks backward or forward a @@ -584,8 +596,8 @@ searching for items planned in the next few days: • *Forward-looking* ‘deadline’ Return non-nil if current entry has deadline in given period. - If argument is auto, return non-nil if entry has deadline - within org-deadline-warning-days. Without arguments, return + If argument is ‘auto’, return non-nil if entry has deadline + within ‘org-deadline-warning-days’. Without arguments, return non-nil if entry has any deadline. ‘planning’ Return non-nil if current entry has planning timestamp (i.e. @@ -623,7 +635,7 @@ File: README.info, Node: Agenda-like views, Next: Listing / acting-on results, For use as a custom agenda block type in ‘org-agenda-custom-commands’. For example, you could define a custom series command like this, which would list all priority A - items tagged Emacs with to-do keyword SOMEDAY, followed by the + items tagged ‘Emacs’ with to-do keyword ‘SOMEDAY’, followed by the standard agenda view, in a single buffer: (setq org-agenda-custom-commands @@ -643,8 +655,8 @@ File: README.info, Node: Agenda-like views, Next: Listing / acting-on results, However, the ‘org-ql-block’ version runs in about 1/5th the time. - The variable org-ql-block-header may be bound to a string to use as - the block header, otherwise the header is formed automatically. + The variable ‘org-ql-block-header’ may be bound to a string to use + as the block header, otherwise the header is formed automatically.  File: README.info, Node: Listing / acting-on results, Next: Custom predicates, Prev: Agenda-like views, Up: Functions / Macros @@ -792,7 +804,7 @@ File: README.info, Node: Custom predicates, Prev: Listing / acting-on results, • See: Custom predicate tutorial (examples/defpred.org) - 1. Macro: org-ql-defpred + 1. Macro: ‘org-ql-defpred’ _Arguments:_ ‘(name args docstring &key body preambles normalizers)’ @@ -881,9 +893,9 @@ supported: • Each column may also be specified as a list with the second element being a header string. For example, to abbreviate the priority column: ‘(priority "P")’. - • For certain columns, like property, arguments may be passed by - specifying the column type itself as a list. For example, to - display a column showing the values of a ‘property’ named + • For certain columns, like ‘property’, arguments may be passed + by specifying the column type itself as a list. For example, + to display a column showing the values of a ‘property’ named ‘milestone’, with the header being abbreviated to ‘M’: ‘((property "milestone") "M")’. • ‘:sort’ One or a list of Org QL sorting methods (see @@ -898,7 +910,7 @@ in the following example). For example, this dynamic block shows the first seven headings that are to-do items with priority A or B, sorted by deadline then priority, -with certain columns (including the value of the agenda-group property +with certain columns (including the value of the ‘agenda-group’ property with a custom header) and timestamp format: #+BEGIN: org-ql :query "todo: priority:A,B" :columns (todo (priority "P") ((property "agenda-group") "Group") deadline heading) :sort (deadline priority) :take 7 :ts-format "%Y-%m-%d %H:%M" @@ -941,7 +953,7 @@ File: README.info, Node: Tips, Prev: Links, Up: Usage ======== • Org QL View buffers can be bookmarked with Emacs bookmark commands, - e.g. C-x r m. This also integrates with org-sidebar + e.g. ‘C-x r m’. This also integrates with org-sidebar (https://github.com/alphapapa/org-sidebar) and Burly (https://github.com/alphapapa/burly.el). @@ -960,6 +972,7 @@ releases. * Menu: * 0.7-pre: 07-pre. +* 0.6.2: 062. * 0.6.1: 061. * 0.6: 06. * 0.5.2: 052. @@ -985,17 +998,32 @@ releases. * 0.1: 01.  -File: README.info, Node: 07-pre, Next: 061, Up: Changelog +File: README.info, Node: 07-pre, Next: 062, Up: Changelog 5.1 0.7-pre =========== -Nothing new yet. +*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.).  -File: README.info, Node: 061, Next: 06, Prev: 07-pre, Up: Changelog +File: README.info, Node: 062, Next: 061, Prev: 07-pre, Up: Changelog -5.2 0.6.1 +5.2 0.6.2 +========= + +*Fixed* + • ‘link’ predicate when used in an ‘or’’ed query. (#279 + (https://github.com/alphapapa/org-ql/issues/279). Thanks to Marc + Fargas (https://github.com/telenieko) for reporting.) + + +File: README.info, Node: 061, Next: 06, Prev: 062, Up: Changelog + +5.3 0.6.1 ========= *Fixed* @@ -1013,11 +1041,11 @@ File: README.info, Node: 061, Next: 06, Prev: 07-pre, Up: Changelog  File: README.info, Node: 06, Next: 052, Prev: 061, Up: Changelog -5.3 0.6 +5.4 0.6 ======= *Added* - • Macro org-ql-defpred, used to define search predicates. (See + • Macro ‘org-ql-defpred’, used to define search predicates. (See tutorial (examples/defpred.org).) • Predicate ‘effort’. • Predicate ‘heading-regexp’, which matches regular expressions @@ -1038,21 +1066,21 @@ File: README.info, Node: 06, Next: 052, Prev: 061, Up: Changelog For example, ‘:sort '(todo priority date)’ now does what ‘:sort '(date priority todo)’ did in earlier versions. (This change is made to enable the new ‘reverse’ sorting method.) Users who have - customized org-ql-views will need to update the stored views’ + customized ‘org-ql-views’ will need to update the stored views’ sorting methods to preserve the desired sort order. - • Helm support (including the command helm-org-ql) has been moved to - a separate package, helm-org-ql. + • Helm support (including the command ‘helm-org-ql’) has been moved + to a separate package, ‘helm-org-ql’. • Predicate ‘heading’ now matches plain strings instead of regular expressions. - • Update dash dependency, and remove dependency on obsolete - dash-functional. (Fixes #179 + • Update ‘dash’ dependency, and remove dependency on obsolete + ‘dash-functional’. (Fixes #179 (https://github.com/alphapapa/org-ql/issues/179), #209 (https://github.com/alphapapa/org-ql/issues/209). Thanks to Mark Hudnall (https://github.com/landakram), Akira Komamura (https://github.com/akirak), Nathanael kinfe (https://github.com/natask), Pablo Stafforini (https://github.com/benthamite), Jason May - (https://github.com/jmay), and Basil L. Contovounesios + (https://github.com/jmay), and Basil L. Contovounesios (https://github.com/basil-conto).) *Removed* @@ -1067,7 +1095,7 @@ File: README.info, Node: 06, Next: 052, Prev: 061, Up: Changelog *Internal* • Predicates are now defined more cleanly with a macro - (org-ql-defpred) that consolidates functionality related to each + (‘org-ql-defpred’) that consolidates functionality related to each predicate. This will also allow users to more easily define custom predicates. • Version 1.0 of library ‘peg’ is now required. @@ -1080,7 +1108,7 @@ File: README.info, Node: 06, Next: 052, Prev: 061, Up: Changelog  File: README.info, Node: 052, Next: 051, Prev: 06, Up: Changelog -5.4 0.5.2 +5.5 0.5.2 ========= *Fixed* @@ -1091,12 +1119,12 @@ File: README.info, Node: 052, Next: 051, Prev: 06, Up: Changelog  File: README.info, Node: 051, Next: 05, Prev: 052, Up: Changelog -5.5 0.5.1 +5.6 0.5.1 ========= *Fixed* • Custom sorting functions could corrupt the cache, causing items to - disappear after refreshing an org-ql-search buffer. (#186 + disappear after refreshing an ‘org-ql-search’ buffer. (#186 (https://github.com/alphapapa/org-ql/issues/186), #187 (https://github.com/alphapapa/org-ql/issues/187). Thanks to Nathanael kinfe (https://github.com/natask).) @@ -1104,19 +1132,19 @@ File: README.info, Node: 051, Next: 05, Prev: 052, Up: Changelog  File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog -5.6 0.5 +5.7 0.5 ======= *Added* - • View dispatcher using transient.el (like Magit), bound to v in + • View dispatcher using ‘transient.el’ (like Magit), bound to ‘v’ in search/view buffers. - • Predicate link, which matches descriptions and targets in Org + • Predicate ‘link’, which matches descriptions and targets in Org links. • Predicate ‘tags-regexp’ (alias: ‘tags*’), which matches regexps against entry tags (e.g, helpful when a tag might end in "s"). • Emacs bookmark support: Org QL View buffers can be bookmarked with, - e.g. C-x r m and shown with, e.g. C-x r b. (This also enables - view restoration with Burly + e.g. ‘C-x r m’ and shown with, e.g. ‘C-x r b’. (This also + enables view restoration with Burly (https://github.com/alphapapa/burly.el).) • Dynamic block support. • Org link support (storing and opening links to Org QL View @@ -1124,7 +1152,7 @@ File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog • Mascot. *Changed* - • Binding to refresh search/view buffers changed to r. + • Binding to refresh search/view buffers changed to ‘r’. *Internal* • When formatting entries for Org QL View buffers, use internal @@ -1133,9 +1161,9 @@ File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog Org versions before 9.3. *Deprecated* - • Macro org-ql is marked obsolete. It will be removed in v0.7. - Functions org-ql-select and org-ql-query should be used instead. - (The macro serves only to confuse with regard to quoting + • Macro ‘org-ql’ is marked obsolete. It will be removed in v0.7. + Functions ‘org-ql-select’ and ‘org-ql-query’ should be used + instead. (The macro serves only to confuse with regard to quoting arguments.) *Acknowledgments* @@ -1145,18 +1173,18 @@ File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog  File: README.info, Node: 049, Next: 048, Prev: 05, Up: Changelog -5.7 0.4.9 +5.8 0.4.9 ========= *Fixed* - • Agenda restriction in org-ql-block. (Fixes #84 + • Agenda restriction in ‘org-ql-block’. (Fixes #84 (https://github.com/alphapapa/org-ql/issues/84). Thanks to Ihor Radchenko (https://github.com/yantar92).)  File: README.info, Node: 048, Next: 047, Prev: 049, Up: Changelog -5.8 0.4.8 +5.9 0.4.8 ========= *Fixed* @@ -1168,12 +1196,12 @@ File: README.info, Node: 048, Next: 047, Prev: 049, Up: Changelog  File: README.info, Node: 047, Next: 046, Prev: 048, Up: Changelog -5.9 0.4.7 -========= +5.10 0.4.7 +========== *Fixed* - • Give a useful error if org-ql-search-directories-files is called - without a directories argument and org-directory doesn’t exist. + • Give a useful error if ‘org-ql-search-directories-files’ is called + without a directories argument and ‘org-directory’ doesn’t exist. (Fixes #139 (https://github.com/alphapapa/org-ql/issues/139). Thanks to Matt Huszagh (https://github.com/matthuszagh) for reporting.) @@ -1181,12 +1209,12 @@ File: README.info, Node: 047, Next: 046, Prev: 048, Up: Changelog  File: README.info, Node: 046, Next: 045, Prev: 047, Up: Changelog -5.10 0.4.6 +5.11 0.4.6 ========== *Fixed* - • Compatibility with newer versions of the peg library, which removed - a macro used by this package. (Fixes #75 + • Compatibility with newer versions of the ‘peg’ library, which + removed a macro used by this package. (Fixes #75 (https://github.com/alphapapa/org-ql/issues/75). Thanks to Karl Voit (https://github.com/novoid) and @karlicoss (https://github.com/karlicoss) for reporting.) @@ -1194,7 +1222,7 @@ File: README.info, Node: 046, Next: 045, Prev: 047, Up: Changelog  File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog -5.11 0.4.5 +5.12 0.4.5 ========== *Fixed* @@ -1206,7 +1234,7 @@ File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog  File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog -5.12 0.4.4 +5.13 0.4.4 ========== *Fixed* @@ -1218,17 +1246,17 @@ File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog  File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog -5.13 0.4.3 +5.14 0.4.3 ========== *Fixed* - • When org-ql-view-refresh is called, ensure the buffer is an Org QL - View buffer. + • When ‘org-ql-view-refresh’ is called, ensure the buffer is an Org + QL View buffer.  File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog -5.14 0.4.2 +5.15 0.4.2 ========== *Fixed* @@ -1237,24 +1265,24 @@ File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog  File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog -5.15 0.4.1 +5.16 0.4.1 ========== *Fixed* - • level predicate used with arguments in plain queries. (Thanks to + • ‘level’ predicate used with arguments in plain queries. (Thanks to Akira Komamura (https://github.com/akirak) for reporting.)  File: README.info, Node: 04, Next: 032, Prev: 041, Up: Changelog -5.16 0.4 +5.17 0.4 ======== _Note:_ The next release, 0.5, may include changes which will require minor updates to written queries (e.g. a few predicates may be renamed). Users who wish to avoid those changes happening unexpectedly -in their configs should avoid upgrading org-ql beyond 0.4 automatically, -as they will be pushed to the master branch when ready. +in their configs should avoid upgrading ‘org-ql’ beyond 0.4 +automatically, as they will be pushed to the ‘master’ branch when ready. *Added* • *Commands* @@ -1268,13 +1296,13 @@ as they will be pushed to the master branch when ready. • *Queries* • Negation of terms in plain queries using ‘!’. For example, ‘tags:space !moon’ to exclude entries which contain ‘moon’. - • Predicates outline-path (alias olp) and outline-path-segment - (alias olps). + • Predicates ‘outline-path’ (alias ‘olp’) and + ‘outline-path-segment’ (alias ‘olps’). • Predicate ‘src’, which matches Org Babel source blocks. - • Predicates parent and ancestors. (Thanks to Josh Moller-Mara - (https://github.com/mm--).) - • Alias h for heading predicate. - • Alias r for regexp predicate. (Thanks to Feng Shu + • Predicates ‘parent’ and ‘ancestors’. (Thanks to Josh + Moller-Mara (https://github.com/mm--).) + • Alias ‘h’ for ‘heading’ predicate. + • Alias ‘r’ for ‘regexp’ predicate. (Thanks to Feng Shu (https://github.com/tumashu).) • Info manual. • Function ‘helm-org-ql-source’, which returns a Helm source that @@ -1282,40 +1310,40 @@ as they will be pushed to the master branch when ready. for custom Helm commands that search certain files. • Display a message when views are refreshed. (Thanks to xeijin (https://github.com/xeijin).) - • Respect Org Agenda restriction in org-ql-block. (Thanks to Ihor + • Respect Org Agenda restriction in ‘org-ql-block’. (Thanks to Ihor Radchenko (https://github.com/yantar92) for reporting.) - • Option org-ql-view-sidebar-sort-views. - • Mouseover help-echo text for org-ql-views default view names. - • "Dangling tasks" default view in org-ql-views. (Users who have - modified org-ql-views from the default will not see the new view + • Option ‘org-ql-view-sidebar-sort-views’. + • Mouseover ‘help-echo’ text for ‘org-ql-views’ default view names. + • "Dangling tasks" default view in ‘org-ql-views’. (Users who have + modified ‘org-ql-views’ from the default will not see the new view unless they copy it into their config.) *Changed* - • Some default org-ql-view views (users who have modified - org-ql-views from the default will not see the new views unless + • Some default ‘org-ql-view’ views (users who have modified + ‘org-ql-views’ from the default will not see the new views unless they copy them into their config): • Rename some views. - • "Stuck projects" view (now uses descendants instead of - children, which is more useful. + • "Stuck projects" view (now uses ‘descendants’ instead of + ‘children’, which is more useful. *Fixed* - • Inherit file tags when org-tag-inheritance is enabled. (Fixes #55 - (https://github.com/alphapapa/org-ql/issues/55). Thanks to Mikhail - Skorzhinskiy (https://github.com/mskorzhinskiy).) - • Call helm-make-source directly instead of using - helm-build-sync-source macro. (Fixes #60 + • Inherit file tags when ‘org-tag-inheritance’ is enabled. (Fixes + #55 (https://github.com/alphapapa/org-ql/issues/55). Thanks to + Mikhail Skorzhinskiy (https://github.com/mskorzhinskiy).) + • Call ‘helm-make-source’ directly instead of using + ‘helm-build-sync-source’ macro. (Fixes #60 (https://github.com/alphapapa/org-ql/issues/60). Thanks to Matt Huszagh (https://github.com/matthuszagh) for reporting.) • Search/view buffers now always end with a newline, which prevents - side-scrolling of the window when calling end-of-buffer. - • Face for done to-do keywords in org-ql-view buffers. (Thanks to + side-scrolling of the window when calling ‘end-of-buffer’. + • Face for done to-do keywords in ‘org-ql-view’ buffers. (Thanks to Yiming Chen (https://github.com/dsdshcym).) • Make view buffers read-only. (Fixes #72 (https://github.com/alphapapa/org-ql/issues/72). Thanks to xeijin (https://github.com/xeijin).) • Sorting with single sorter specified as an atom. (Thanks to Jeff Filipovits (https://github.com/legalnonsense).) - • Autoload for org-ql-block agenda block. (Fixes #53 + • Autoload for ‘org-ql-block’ agenda block. (Fixes #53 (https://github.com/alphapapa/org-ql/issues/53). Thanks to reports from Gus Cantieni (https://github.com/gcantieni), Karl Voit (https://github.com/novoid), rieje (https://github.com/rieje), and @@ -1328,20 +1356,20 @@ as they will be pushed to the master branch when ready.  File: README.info, Node: 032, Next: 031, Prev: 04, Up: Changelog -5.17 0.3.2 +5.18 0.3.2 ========== *Fixed* - • In org-ql-search, accept symbol as ‘:super-groups’ argument. - • In the This week and Next week default org-ql-views views, set - timestamps for beginning-of-week to 00:00:00 and end-of-week to + • In ‘org-ql-search’, accept symbol as ‘:super-groups’ argument. + • In the ‘This week’ and ‘Next week’ default ‘org-ql-views’ views, + set timestamps for beginning-of-week to 00:00:00 and end-of-week to 23:59:59. • Plain quoted-phrases in non-sexp queries.  File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog -5.18 0.3.1 +5.19 0.3.1 ========== *Fixed* @@ -1351,103 +1379,106 @@ File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog  File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog -5.19 0.3 +5.20 0.3 ======== *Added* - • Alternative, non-sexp query syntax for commands org-ql-search and - helm-org-ql. See . - • Command helm-org-ql. - • Command org-ql-sparse-tree, like org-sparse-tree for org-ql + • Alternative, non-sexp query syntax for commands ‘org-ql-search’ and + ‘helm-org-ql’. See . + • Command ‘helm-org-ql’. + • Command ‘org-ql-sparse-tree’, like ‘org-sparse-tree’ for ‘org-ql’ queries. (Thanks to Akira Komamura (https://github.com/akirak).) - • Command org-ql-view-sidebar. + • Command ‘org-ql-view-sidebar’. • Per-buffer, per-heading tag caching, which increases the speed of tags-related queries by 6-7x. • More tags-related predicates and aliases: - • For inherited tags: tags-inherited, inherited-tags, tags-i, - itags. - • For heading-local tags: tags-local, local-tags, tags-l, ltags. - • tags-all, tags&: Matches all given tags using boolean AND - (rather than boolean OR, which the tags predicate uses). - • Variable org-ql-block-header, which overrides the default header in - org-ql-block agenda blocks. - • Predicate (path). - • Option org-ql-views may now be customized in a guided, structured - way with the customization UI (e.g. - M-x customize-option RET org-ql-views RET, or press c in the - org-ql-view-sidebar buffer). - • Enable more Org Agenda commands in org-ql-view buffers (e.g. + • For inherited tags: ‘tags-inherited’, ‘inherited-tags’, + ‘tags-i’, ‘itags’. + • For heading-local tags: ‘tags-local’, ‘local-tags’, ‘tags-l’, + ‘ltags’. + • ‘tags-all’, ‘tags&’: Matches all given tags using boolean + ‘AND’ (rather than boolean ‘OR’, which the ‘tags’ predicate + uses). + • Variable ‘org-ql-block-header’, which overrides the default header + in ‘org-ql-block’ agenda blocks. + • Predicate ‘(path)’. + • Option ‘org-ql-views’ may now be customized in a guided, structured + way with the customization UI (e.g. ‘M-x customize-option RET + org-ql-views RET’, or press ‘c’ in the ‘org-ql-view-sidebar’ + buffer). + • Enable more Org Agenda commands in ‘org-ql-view’ buffers (e.g. setting deadlines and scheduling). (Fixes #35 (https://github.com/alphapapa/org-ql/issues/35). Thanks to Milan Zamazal (https://github.com/mz-pdm) and Mikhail Skorzhinskii (https://github.com/mskorzhinskiy).) - • Function org-ql-select’s buffers-files argument can be a function - which returns a list of buffers and/or files. + • Function ‘org-ql-select’’s ‘buffers-files’ argument can be a + function which returns a list of buffers and/or files. *Changed* - • Predicate heading now accepts multiple regexps, which are matched - with boolean AND. - • Predicate regexp now matches its regexp arguments with boolean AND. - • Package org-super-agenda is now a dependency. This removes the + • Predicate ‘heading’ now accepts multiple regexps, which are matched + with boolean ‘AND’. + • Predicate ‘regexp’ now matches its regexp arguments with boolean + ‘AND’. + • Package ‘org-super-agenda’ is now a dependency. This removes the need for awkward code to handle the case where it’s not installed, and makes grouping features always available. Of course, the - global minor mode org-super-agenda-mode is not activated by org-ql, - so no behavior is changed in Org Agenda or org-ql; it only means - that commands like org-ql-search will always provide grouping when - called with the appropriate arguments. + global minor mode ‘org-super-agenda-mode’ is not activated by + ‘org-ql’, so no behavior is changed in Org Agenda or ‘org-ql’; it + only means that commands like ‘org-ql-search’ will always provide + grouping when called with the appropriate arguments. *Removed* - • Macro org-ql-agenda. Instead, use function org-ql-search. See - also command org-ql-view, etc. + • Macro ‘org-ql-agenda’. Instead, use function ‘org-ql-search’. See + also command ‘org-ql-view’, etc. *Fixed* - • Predicate heading now matches only against heading text, i.e. not - including tags at the end of the line, to-do keyword, etc. - • Predicate todo now matches case-sensitively, avoiding - non-todo-keyword matches (e.g. a heading which begins Waiting on - will no longer match for a todo keyword WAITING). - • Interactive completion in org-ql-search. + • Predicate ‘heading’ now matches only against heading text, i.e. + not including tags at the end of the line, to-do keyword, etc. + • Predicate ‘todo’ now matches case-sensitively, avoiding + non-todo-keyword matches (e.g. a heading which begins ‘Waiting on’ + will no longer match for a todo keyword ‘WAITING’). + • Interactive completion in ‘org-ql-search’. *Internal* - • Refactored code from file org-ql-agenda.el into files - org-ql-search.el and org-ql-view.el. Function and variable names - have been changed accordingly. + • Refactored code from file ‘org-ql-agenda.el’ into files + ‘org-ql-search.el’ and ‘org-ql-view.el’. Function and variable + names have been changed accordingly.  File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog -5.20 0.2.3 +5.21 0.2.3 ========== *Fixed* • Priority queries could fail to match headings whose to-do keywords - had non-alphabetic characters, like TO-READ. + had non-alphabetic characters, like ‘TO-READ’.  File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog -5.21 0.2.2 +5.22 0.2.2 ========== *Fixed* - • (deadline auto) selector matched entries whose deadlines had a + • ‘(deadline auto)’ selector matched entries whose deadlines had a warning period that had not yet been entered - (org-deadline-warning-days too soon). + (‘org-deadline-warning-days’ too soon).  File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog -5.22 0.2.1 +5.23 0.2.1 ========== *Fixed* - • (descendants) selector matched against parent heading instead of + • ‘(descendants)’ selector matched against parent heading instead of only descendants.  File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog -5.23 0.2 +5.24 0.2 ======== *Added* @@ -1468,7 +1499,7 @@ File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog • Selectors ‘ts-a’ and ‘ts-i’, aliases for ‘ts-active’ and ‘ts-inactive’. • Selector ‘ts’ now accepts a ‘:type’ argument. - • Face org-ql-agenda-due-date. + • Face ‘org-ql-agenda-due-date’. • Selectors ‘(children)’ and ‘(descendants)’. • Function ‘org-ql-search’ and macro ‘org-ql-agenda’ accept a ‘:title’ argument, which is displayed in the header. @@ -1477,11 +1508,11 @@ File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog • Customization group ‘org-ql’. • Command ‘org-ql-view’, which displays views saved to variable ‘org-ql-views’, which can be saved from ‘org-ql-search’ buffers - with command ‘org-ql-search-save’, which is bound to C-x C-s in + with command ‘org-ql-search-save’, which is bound to ‘C-x C-s’ in view buffers. • Variable ‘org-ql-view-map’, active in view buffers displayed by ‘org-ql-search’, ‘org-ql-agenda’, and ‘org-ql-view’. - • random sort method. + • ‘random’ sort method. • Save position when refreshing search buffers. *Changed* @@ -1500,14 +1531,14 @@ File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog *Fixed* • Handle date ranges in date-based selectors. (Thanks to Cody - Goodman (https://github.com/codygman), Samuel W. Flint + Goodman (https://github.com/codygman), Samuel W. Flint (https://github.com/swflint), and Vikas Rawal (https://github.com/vikasrawal).) - • Don’t overwrite bindings in org-agenda-mode-map. + • Don’t overwrite bindings in ‘org-agenda-mode-map’. • Don’t search buffers without headings, and show a message if the user attempts it. • Don’t search hidden/special buffers. - • Properly accept arbitrary sort functions in org-ql-select, etc. + • Properly accept arbitrary sort functions in ‘org-ql-select’, etc. (Fixes #37 (https://github.com/alphapapa/org-ql/issues/37). Thanks to Milan Zamazal (https://github.com/mz-pdm).) • Planning-line-related predicates searched too far into entries. @@ -1521,7 +1552,7 @@ File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog (https://github.com/dakra).) *Internal* - • Optimizations for some query selectors, e.g. regexp and todo. + • Optimizations for some query selectors, e.g. ‘regexp’ and ‘todo’. These can provide a significant improvement for some queries. See benchmarks in notes.org (notes.org). • Library ts (https://github.com/alphapapa/ts.el) is now used for @@ -1530,7 +1561,7 @@ File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog  File: README.info, Node: 01, Prev: 02, Up: Changelog -5.24 0.1 +5.25 0.1 ======== First tagged release. @@ -1561,10 +1592,10 @@ in the advanced searching tutorial it would require using ‘org-search-view’ with a query with specific regular expression syntax, like this: -+lisp +{^\*+\s-+TO-READ\s-} + +lisp +{^\*+\s-+TO-READ\s-} - But with org-ql-search, you would write a query like -lisp todo:TO-READ, or in Lisp syntax, ‘(and "lisp" (todo "TO-READ"))’. + But with ‘org-ql-search’, you would write a query like ‘lisp +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 @@ -1588,60 +1619,68 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1724 -Node: Screenshots1847 -Node: Installation1965 -Node: Quelpa2461 -Node: Helm support2989 -Node: Usage3380 -Node: Commands3778 -Node: org-ql-search4251 -Node: helm-org-ql5901 -Node: org-ql-view6261 -Node: org-ql-view-sidebar6761 -Node: org-ql-view-recent-items7117 -Node: org-ql-sparse-tree7601 -Node: Queries8401 -Node: Non-sexp query syntax9512 -Node: General predicates11236 -Node: Ancestor/descendant predicates17457 -Node: Date/time predicates18585 -Node: Functions / Macros21673 -Node: Agenda-like views21971 -Node: Listing / acting-on results23376 -Node: Custom predicates29012 -Node: Dynamic block32671 -Node: Links35383 -Node: Tips36070 -Node: Changelog36388 -Node: 07-pre37141 -Node: 06137248 -Node: 0637819 -Node: 05240830 -Node: 05141130 -Node: 0541547 -Node: 04943021 -Node: 04843295 -Node: 04743642 -Node: 04644037 -Node: 04544439 -Node: 04444800 -Node: 04345159 -Node: 04245356 -Node: 04145517 -Node: 0445758 -Node: 03249691 -Node: 03150070 -Node: 0350267 -Node: 02353242 -Node: 02253470 -Node: 02153738 -Node: 0253937 -Node: 0157972 -Node: Notes58073 -Node: Comparison with Org Agenda searches58235 -Node: org-sidebar59107 -Node: License59386 +Node: Contents1764 +Node: Screenshots1887 +Node: Installation2005 +Node: Quelpa2519 +Node: Helm support3047 +Node: Usage3450 +Node: Commands3848 +Node: org-ql-find4353 +Node: org-ql-search4867 +Node: helm-org-ql6561 +Node: org-ql-view6939 +Node: org-ql-view-sidebar7469 +Node: org-ql-view-recent-items7849 +Node: org-ql-sparse-tree8345 +Node: Queries9145 +Node: Non-sexp query syntax10262 +Node: General predicates12021 +Node: Ancestor/descendant predicates18260 +Node: Date/time predicates19388 +Node: Functions / Macros22512 +Node: Agenda-like views22810 +Ref: Function ‘org-ql-block’22972 +Node: Listing / acting-on results24233 +Ref: Caching24441 +Ref: Function ‘org-ql-select’25354 +Ref: Function ‘org-ql-query’27780 +Ref: Macro ‘org-ql’ (deprecated)29554 +Node: Custom predicates29869 +Ref: Macro ‘org-ql-defpred’30093 +Node: Dynamic block33534 +Node: Links36258 +Node: Tips36945 +Node: Changelog37269 +Node: 07-pre38037 +Node: 06238392 +Node: 06138700 +Node: 0639268 +Node: 05242322 +Node: 05142622 +Node: 0543045 +Node: 04944574 +Node: 04844854 +Node: 04745201 +Node: 04645610 +Node: 04546018 +Node: 04446379 +Node: 04346738 +Node: 04246941 +Node: 04147102 +Node: 0447349 +Node: 03251450 +Node: 03151853 +Node: 0352050 +Node: 02355350 +Node: 02255584 +Node: 02155864 +Node: 0256069 +Node: 0160147 +Node: Notes60248 +Node: Comparison with Org Agenda searches60410 +Node: org-sidebar61299 +Node: License61578  End Tag Table From 67506a56f8e84af80af922e40797f8dc861243e4 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Tue, 31 May 2022 12:01:19 -0500 Subject: [PATCH 003/224] Change: (org-ql--byte-compile-warning) More useful error message e.g. if a predicate only accepts one argument, but the query gives two, now the error will say, "PREDICATE called with 2 arguments, but accepts only 1" (so maybe the predicate definition just needs "&rest"). --- README.org | 3 +++ org-ql.el | 4 ++-- org-ql.info | 59 ++++++++++++++++++++++++++++------------------------- 3 files changed, 36 insertions(+), 30 deletions(-) diff --git a/README.org b/README.org index 507c328..64233d0 100644 --- a/README.org +++ b/README.org @@ -540,6 +540,9 @@ Simple links may also be written manually in either sexp or non-sexp form, like: *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.). +*Changed* ++ Give more useful error message for invalid queries. + ** 0.6.2 *Fixed* diff --git a/org-ql.el b/org-ql.el index 0e6965b..d92c1f6 100644 --- a/org-ql.el +++ b/org-ql.el @@ -765,12 +765,12 @@ respectively." "#+end_src") t)) -(defun org-ql--byte-compile-warning (_string _pos _fill level) +(defun org-ql--byte-compile-warning (string _pos _fill level) "Signal an `org-ql-invalid-query' error. Arguments STRING, POS, FILL, and LEVEL are according to `byte-compile-log-warning-function'." ;; Used as the `byte-compile-log-warning-function' in `org-ql--query-preamble'. - (signal 'org-ql-invalid-query level)) + (signal 'org-ql-invalid-query (list string level))) (defun org-ql--query-predicate (query) "Return predicate function for QUERY." diff --git a/org-ql.info b/org-ql.info index 0576cf5..89eede3 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1009,6 +1009,9 @@ File: README.info, Node: 07-pre, Next: 062, Up: Changelog built-in completion facilities and Org QL queries (like ‘helm-org-ql’, but doesn’t require Helm.). + *Changed* + • Give more useful error message for invalid queries. +  File: README.info, Node: 062, Next: 061, Prev: 07-pre, Up: Changelog @@ -1653,34 +1656,34 @@ Node: Links36258 Node: Tips36945 Node: Changelog37269 Node: 07-pre38037 -Node: 06238392 -Node: 06138700 -Node: 0639268 -Node: 05242322 -Node: 05142622 -Node: 0543045 -Node: 04944574 -Node: 04844854 -Node: 04745201 -Node: 04645610 -Node: 04546018 -Node: 04446379 -Node: 04346738 -Node: 04246941 -Node: 04147102 -Node: 0447349 -Node: 03251450 -Node: 03151853 -Node: 0352050 -Node: 02355350 -Node: 02255584 -Node: 02155864 -Node: 0256069 -Node: 0160147 -Node: Notes60248 -Node: Comparison with Org Agenda searches60410 -Node: org-sidebar61299 -Node: License61578 +Node: 06238465 +Node: 06138773 +Node: 0639341 +Node: 05242395 +Node: 05142695 +Node: 0543118 +Node: 04944647 +Node: 04844927 +Node: 04745274 +Node: 04645683 +Node: 04546091 +Node: 04446452 +Node: 04346811 +Node: 04247014 +Node: 04147175 +Node: 0447422 +Node: 03251523 +Node: 03151926 +Node: 0352123 +Node: 02355423 +Node: 02255657 +Node: 02155937 +Node: 0256142 +Node: 0160220 +Node: Notes60321 +Node: Comparison with Org Agenda searches60483 +Node: org-sidebar61372 +Node: License61651  End Tag Table From 64a9234733904af20fd495861792f1d5c2b37190 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 2 Jun 2022 07:43:08 -0500 Subject: [PATCH 004/224] Add: (org-ql-find) :query-filter Also, tidy docstring. --- org-ql-find.el | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/org-ql-find.el b/org-ql-find.el index 7585f75..20b6c57 100644 --- a/org-ql-find.el +++ b/org-ql-find.el @@ -51,15 +51,21 @@ ;;;; Functions ;;;###autoload -(cl-defun org-ql-find (buffers-files &key query-prefix +(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. -If QUERY-PREFIX, prepend it to the query (e.g. use \"heading:\" -to only search headings, easily creating a custom command that -saves the user from having to type it)." +QUERY-PREFIX may be a string to prepend to the query (e.g. use +\"heading:\" to only search headings, easily creating a custom +command that saves the user from having to type it). + +QUERY-FILTER may be a function through which the query the user +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 @@ -126,6 +132,8 @@ saves the user from having to type it)." (cons 'affixation-function #'affix) (cons 'annotation-function #'annotate))) (`t (unless (string-empty-p str) + (when query-filter + (setf str (funcall query-filter str))) (org-ql-select buffers-files (org-ql--query-string-to-sexp (concat query-prefix str)) :action #'action)))))) (let* ((completion-styles '(org-ql-find)) From 36e97d51cf373d8d27ba05c1a3cb108c268d8aab Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 9 Jun 2022 18:10:39 -0500 Subject: [PATCH 005/224] Tests: Fix non-file-backed-buffer test Somehow a Unicode "RIGHT SINGLE QUOTATION MARK" replaced the ASCII apostrophe in this string, which broke the test. Weird! --- 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 0b7f2bb..95988c0 100644 --- a/tests/test-org-ql.el +++ b/tests/test-org-ql.el @@ -2105,7 +2105,7 @@ with keyword arg NOW in PLIST." (it "Refuses to link to non-file-backed buffer" (expect (var-after-link-save-open 'org-ql-view-buffers-files link-buffer query :buffer link-buffer) - :to-throw 'user-error '("Views that search non-file-backed buffers can’t be linked to")))))) + :to-throw 'user-error '("Views that search non-file-backed buffers can't be linked to")))))) ;; MAYBE: Also test `org-ql-views', although I already know it works now. ;; (describe "org-ql-views") From c7fab9dfce66602deaa8c333b5125747e5c3a5f9 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 9 Jun 2022 21:21:15 -0500 Subject: [PATCH 006/224] Tests: Wrap bare (expect) forms in (it) forms --- tests/test-org-ql.el | 72 +++++++++++++++++++++++++------------------- 1 file changed, 41 insertions(+), 31 deletions(-) diff --git a/tests/test-org-ql.el b/tests/test-org-ql.el index 95988c0..0839688 100644 --- a/tests/test-org-ql.el +++ b/tests/test-org-ql.el @@ -252,18 +252,24 @@ with keyword arg NOW in PLIST." :to-equal '(org-ql--predicate-outline-path "a\\." "b")))) (describe "(tags-inherited)" - (expect (org-ql--normalize-query '(tags-inherited)) - :to-equal '(tags-inherited)) - (expect (org-ql--normalize-query '(itags)) - :to-equal '(tags-inherited)) - (expect (org-ql--normalize-query '(tags-inherited "foo")) - :to-equal '(tags-inherited "foo")) - (expect (org-ql--normalize-query '(itags "foo")) - :to-equal '(tags-inherited "foo")) - (expect (org-ql--normalize-query '(tags-inherited "foo" "bar")) - :to-equal '(tags-inherited "foo" "bar")) - (expect (org-ql--normalize-query '(itags "foo" "bar")) - :to-equal '(tags-inherited "foo" "bar"))) + (it "handles 0 arguments" + (expect (org-ql--normalize-query '(tags-inherited)) + :to-equal '(tags-inherited))) + (it "handles 1 argument" + (expect (org-ql--normalize-query '(tags-inherited "foo")) + :to-equal '(tags-inherited "foo"))) + (it "handles 2 arguments" + (expect (org-ql--normalize-query '(tags-inherited "foo" "bar")) + :to-equal '(tags-inherited "foo" "bar"))) + (it "aliases to `itags'" + (expect (org-ql--normalize-query '(itags)) + :to-equal '(tags-inherited))) + (it "aliases to `itags' with one argument" + (expect (org-ql--normalize-query '(itags "foo")) + :to-equal '(tags-inherited "foo"))) + (it "aliases to `itags' with two arguments" + (expect (org-ql--normalize-query '(itags "foo" "bar")) + :to-equal '(tags-inherited "foo" "bar")))) (describe "timestamp predicates" ;; NOTE: (clocked) and (closed) don't accept :with-time arguments. @@ -456,25 +462,29 @@ with keyword arg NOW in PLIST." :to-equal `(ts :from ,(ts-inc 'day 1 beg-of-today-ts) :to ,(ts-inc 'day 1 end-of-today-ts))))))) - (expect (org-ql--normalize-query '(and "string1" "string2")) - :to-equal '(and (regexp "string1") (regexp "string2"))) - (expect (org-ql--normalize-query '(or "string1" "string2")) - :to-equal '(or (regexp "string1") (regexp "string2"))) - (expect (org-ql--normalize-query '(and (todo "TODO") - (or "string1" "string2"))) - :to-equal '(and (todo "TODO") (or (regexp "string1") (regexp "string2")))) - (expect (org-ql--normalize-query '(when (todo "TODO") - (or "string1" "string2"))) - :to-equal '(when (todo "TODO") (or (regexp "string1") (regexp "string2")))) - (expect (org-ql--normalize-query '(when "string-cond1" - (or "string1" "string2"))) - :to-equal '(when (regexp "string-cond1") (or (regexp "string1") (regexp "string2")))) - (expect (org-ql--normalize-query '(when (and "string-cond1" "string-cond2") - (or "string1" "string2"))) - :to-equal '(when (and (regexp "string-cond1") (regexp "string-cond2")) (or (regexp "string1") (regexp "string2")))) - (expect (org-ql--normalize-query '(unless (and "stringcondition1" "stringcond2") - (or "string1" "string2"))) - :to-equal '(unless (and (regexp "stringcondition1") (regexp "stringcond2")) (or (regexp "string1") (regexp "string2")))) + (describe "Plain strings" + (it "normalizes plain strings to the default predicate (using AND)" + (expect (org-ql--normalize-query '(and "string1" "string2")) + :to-equal '(and (regexp "string1") (regexp "string2")))) + (it "normalizes plain strings to the default predicate (using OR)" + (expect (org-ql--normalize-query '(or "string1" "string2")) + :to-equal '(or (regexp "string1") (regexp "string2")))) + (it "normalizes plain strings within sub-expressions to the default predicate" + (expect (org-ql--normalize-query '(and (todo "TODO") + (or "string1" "string2"))) + :to-equal '(and (todo "TODO") (or (regexp "string1") (regexp "string2")))) + (expect (org-ql--normalize-query '(when (todo "TODO") + (or "string1" "string2"))) + :to-equal '(when (todo "TODO") (or (regexp "string1") (regexp "string2")))) + (expect (org-ql--normalize-query '(when "string-cond1" + (or "string1" "string2"))) + :to-equal '(when (regexp "string-cond1") (or (regexp "string1") (regexp "string2")))) + (expect (org-ql--normalize-query '(when (and "string-cond1" "string-cond2") + (or "string1" "string2"))) + :to-equal '(when (and (regexp "string-cond1") (regexp "string-cond2")) (or (regexp "string1") (regexp "string2")))) + (expect (org-ql--normalize-query '(unless (and "stringcondition1" "stringcond2") + (or "string1" "string2"))) + :to-equal '(unless (and (regexp "stringcondition1") (regexp "stringcond2")) (or (regexp "string1") (regexp "string2")))))) ;; FIXME: This test fails, but only on GitHub CI; it works fine ;; locally. It seems to be something to do with Buttercup and From d4f2eb760e2404b98e4b131c4ca472a7f22703b7 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 9 Jun 2022 22:10:27 -0500 Subject: [PATCH 007/224] Fix: (src) Normalization Some argument combinations weren't normalized correctly and could cause an infinite loop. This commit doesn't update any corresponding tests, because they are being rearranged in the WIP branch where this commit originates, and teasing them out wouldn't be worth it. --- org-ql.el | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/org-ql.el b/org-ql.el index d92c1f6..ebd3f89 100644 --- a/org-ql.el +++ b/org-ql.el @@ -1668,22 +1668,24 @@ If keyword argument LANG is non-nil, the block must be in that language." :normalizers ((`(,predicate-names . ,args) ;; Rewrite to use keyword args. - (-let (regexps lang keyword-index) - (cond ((plist-get args :lang) - ;; Lang given first, or only lang given. - (setf lang (plist-get args :lang) - regexps (seq-difference args (list :lang lang)))) - ((setf keyword-index (-find-index #'keywordp args)) - ;; Regexps and lang given. - (setf lang (plist-get (cl-subseq args keyword-index) :lang) - regexps (cl-subseq args 0 keyword-index))) - (t ;; Only regexps given. - (setf regexps args))) - (when regexps - ;; This feels awkward and wrong, but we have to quote lists - ;; and avoid quoting nil. There must be a better way. - (setf regexps `(',regexps))) - `(src :lang ,lang :regexps ,@regexps)))) + (cond ((cl-every #'stringp args) + ;; No keywords, only regexps. + `(src :regexps ,args)) + ((and (stringp (car args)) (cl-some #'keywordp args)) + ;; Regexp as first arg with keyword later. + (let* ((keyword-pos (cl-position :lang args)) + (regexps (cl-subseq args 0 keyword-pos)) + ;; We assume that if :lang is given, the string argument follows. + (lang (nth (1+ (cl-position :lang args)) args))) + `(src :lang ,lang + :regexps ,regexps))) + ((keywordp (car args)) + ;; All plist args. + `(src ,@(delq nil + (append (when (plist-get args :lang) + (list :lang (plist-get args :lang))) + (when (plist-get args :regexps) + (list :regexps (plist-get args :regexps)))))))))) :preambles ((`(,predicate-names . ,args) (list :regexp (org-ql--format-src-block-regexp (plist-get args :lang)) ;; Always check contents with predicate. From c8c89be7bce2547e8ff24468680a0eb28f33449c Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 9 Jun 2022 22:24:53 -0500 Subject: [PATCH 008/224] Meta: Update makem.sh, Makefile --- Makefile | 6 +- makem.sh | 175 +++++++++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 148 insertions(+), 33 deletions(-) diff --git a/Makefile b/Makefile index 9ba1358..64c4516 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ # * makem.sh/Makefile --- Script to aid building and testing Emacs Lisp packages # URL: https://github.com/alphapapa/makem.sh -# Version: 0.3 +# Version: 0.5 # * Arguments @@ -38,7 +38,9 @@ endif verbose = $(v) -ifneq (,$(findstring vv,$(verbose))) +ifneq (,$(findstring vvv,$(verbose))) + VERBOSE = "-vvv" +else ifneq (,$(findstring vv,$(verbose))) VERBOSE = "-vv" else ifneq (,$(findstring v,$(verbose))) VERBOSE = "-v" diff --git a/makem.sh b/makem.sh index b9fc062..d06bca3 100755 --- a/makem.sh +++ b/makem.sh @@ -3,11 +3,11 @@ # * makem.sh --- Script to aid building and testing Emacs Lisp packages # URL: https://github.com/alphapapa/makem.sh -# Version: 0.3 +# Version: 0.6-pre # * Commentary: -# makem.sh is a script helps to build, lint, and test Emacs Lisp +# makem.sh is a script that helps to build, lint, and test Emacs Lisp # packages. It aims to make linting and testing as simple as possible # without requiring per-package configuration. @@ -79,7 +79,7 @@ Rules: Options: -d, --debug Print debug info. -h, --help I need somebody! - -v, --verbose Increase verbosity, up to -vv. + -v, --verbose Increase verbosity, up to -vvv. --no-color Disable color output. --debug-load-path Print load-path from inside Emacs. @@ -136,6 +136,27 @@ EOF echo $file } +function elisp-elint-file { + local file=$(mktemp) + cat >$file <"$file" </dev/null) if [[ $file_pkg ]] @@ -496,6 +570,8 @@ function sandbox { args_sandbox=( --title "makem.sh: $(basename $(pwd)) (sandbox: $sandbox_dir)" --eval "(setq user-emacs-directory (file-truename \"$sandbox_dir\"))" + --load package + --eval "(setq package-user-dir (expand-file-name \"elpa\" user-emacs-directory))" --eval "(setq user-init-file (file-truename \"$init_file\"))" ) @@ -658,7 +734,8 @@ function verbose { if [[ $verbose -ge $1 ]] then [[ $1 -eq 1 ]] && local color_name=blue - [[ $1 -ge 2 ]] && local color_name=cyan + [[ $1 -eq 2 ]] && local color_name=cyan + [[ $1 -ge 3 ]] && local color_name=white shift log_color $color_name "$@" >&2 @@ -706,9 +783,7 @@ function compile-batch { verbose 2 "Batch-compiling files..." debug "Byte-compile files: ${files_project_byte_compile[@]}" - batch-byte-compile "${files_project_byte_compile[@]}" \ - && success "Compiling finished without errors." \ - || error "Compilation failed." + batch-byte-compile "${files_project_byte_compile[@]}" } function compile-each { @@ -726,9 +801,7 @@ function compile-each { || compile_errors=t done - ! [[ $compile_errors ]] \ - && success "Compiling finished without errors." \ - || error "Compilation failed." + [[ ! $compile_errors ]] } function compile { @@ -738,6 +811,18 @@ function compile { else compile-each "$@" fi + local status=$? + + if [[ $compile_error_on_warn ]] + then + # Linting: just return status code, because lint rule will print messages. + [[ $status = 0 ]] + else + # Not linting: print messages here. + [[ $status = 0 ]] \ + && success "Compiling finished without errors." \ + || error "Compiling failed." + fi } function batch { @@ -752,12 +837,15 @@ function batch { function interactive { # Run Emacs interactively. Most useful with --sandbox and --install-deps. + local load_file_args=$(args-load-files "${files_project_feature[@]}" "${files_project_test[@]}") verbose 1 "Running Emacs interactively..." - verbose 2 "Loading files:" "${files_project_feature[@]}" "${files_project_test[@]}" + verbose 2 "Loading files: ${load_file_args//--load /}" + + [[ $compile ]] && compile unset arg_batch run_emacs \ - $(args-load-files "${files_project_feature[@]}" "${files_project_test[@]}") \ + $load_file_args \ --eval "(load user-init-file)" \ "${args_batch_interactive[@]}" arg_batch="--batch" @@ -769,6 +857,9 @@ function lint { lint-checkdoc lint-compile lint-declare + # NOTE: Elint doesn't seem very useful at the moment. See comment + # in lint-elint function. + # lint-elint lint-indent lint-package lint-regexps @@ -825,6 +916,28 @@ function lint-elsa { || error "Linting with Elsa failed." } +function lint-elint { + # NOTE: Elint gives a lot of spurious warnings, apparently because it doesn't load files + # that are `require'd, so its output isn't very useful. But in case it's improved in + # the future, and since this wrapper code already works, we might as well leave it in. + verbose 1 "Linting with Elint..." + + local errors=0 + for file in "${files_project_feature[@]}" + do + verbose 2 "Linting with Elint: $file..." + run_emacs \ + --load "$(elisp-elint-file)" \ + --eval "(makem-elint-file \"$file\")" \ + && verbose 3 "Linting with Elint found no errors." \ + || { error "Linting with Elint failed: $file"; ((errors++)) ; } + done + + [[ $errors = 0 ]] \ + && success "Linting with Elint finished without errors." \ + || error "Linting with Elint failed." +} + function lint-indent { verbose 1 "Linting indentation..." From 0057972069a39fa03f941ee63aa211db3e2177fc Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 9 Jun 2022 22:45:51 -0500 Subject: [PATCH 009/224] Add: (org-ql-default-predicate) --- README.org | 1 + org-ql.el | 12 +++++++++-- org-ql.info | 59 ++++++++++++++++++++++++++++------------------------- 3 files changed, 42 insertions(+), 30 deletions(-) diff --git a/README.org b/README.org index 64233d0..2a07b87 100644 --- a/README.org +++ b/README.org @@ -539,6 +539,7 @@ Simple links may also be written manually in either sexp or non-sexp form, like: *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.). ++ Option ~org-ql-default-predicate~, applied to plain-string query tokens (before, the ~regexp~ predicate was always used, but now it may be customized). *Changed* + Give more useful error message for invalid queries. diff --git a/org-ql.el b/org-ql.el index ebd3f89..56ab9ea 100644 --- a/org-ql.el +++ b/org-ql.el @@ -298,6 +298,14 @@ See Info node `(org-ql)Queries'." :type 'boolean :risky t) +(defcustom org-ql-default-predicate 'regexp + "Predicate used for plain-string tokens without a specified predicate." + :type '(choice (const heading) + (const heading-regexp) + (const regexp) + (const outline-path) + (const outline-path-segment))) + ;;;; Functions ;;;;; Query execution @@ -862,7 +870,7 @@ value of `org-ql-predicates')." positive-term)) (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 'regexp s))))) + (and plain-string `(s -- (list org-ql-default-predicate s))))) (plain-string (or quoted-arg unquoted-arg)) (predicate-with-args (substring predicate) ":" args) (predicate-without-args (substring predicate) ":") @@ -945,7 +953,7 @@ defined in `org-ql-predicates' by calling `org-ql-defpred'." (`(unless ,condition . ,clauses) `(unless ,(rec condition) ,@(mapcar #'rec clauses))) ;; TODO: Combine (regexp) when appropriate (i.e. inside an OR, not an AND). - ((pred stringp) `(regexp ,element)) + ((pred stringp) `(,org-ql-default-predicate ,element)) ,@normalizer-patterns diff --git a/org-ql.info b/org-ql.info index 89eede3..5205d5c 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1008,6 +1008,9 @@ File: README.info, Node: 07-pre, Next: 062, Up: Changelog ‘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.). + • Option ‘org-ql-default-predicate’, applied to plain-string query + tokens (before, the ‘regexp’ predicate was always used, but now it + may be customized). *Changed* • Give more useful error message for invalid queries. @@ -1656,34 +1659,34 @@ Node: Links36258 Node: Tips36945 Node: Changelog37269 Node: 07-pre38037 -Node: 06238465 -Node: 06138773 -Node: 0639341 -Node: 05242395 -Node: 05142695 -Node: 0543118 -Node: 04944647 -Node: 04844927 -Node: 04745274 -Node: 04645683 -Node: 04546091 -Node: 04446452 -Node: 04346811 -Node: 04247014 -Node: 04147175 -Node: 0447422 -Node: 03251523 -Node: 03151926 -Node: 0352123 -Node: 02355423 -Node: 02255657 -Node: 02155937 -Node: 0256142 -Node: 0160220 -Node: Notes60321 -Node: Comparison with Org Agenda searches60483 -Node: org-sidebar61372 -Node: License61651 +Node: 06238642 +Node: 06138950 +Node: 0639518 +Node: 05242572 +Node: 05142872 +Node: 0543295 +Node: 04944824 +Node: 04845104 +Node: 04745451 +Node: 04645860 +Node: 04546268 +Node: 04446629 +Node: 04346988 +Node: 04247191 +Node: 04147352 +Node: 0447599 +Node: 03251700 +Node: 03152103 +Node: 0352300 +Node: 02355600 +Node: 02255834 +Node: 02156114 +Node: 0256319 +Node: 0160397 +Node: Notes60498 +Node: Comparison with Org Agenda searches60660 +Node: org-sidebar61549 +Node: License61828  End Tag Table From 968a249ae36574f0f4f623363b6a7c2e27af1fc8 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 9 Jun 2022 22:54:57 -0500 Subject: [PATCH 010/224] Add: Query coalescing for AND clauses A later commit will update and add tests. --- README.org | 3 ++ org-ql.el | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++--- org-ql.info | 60 ++++++++++++++++++---------------- 3 files changed, 123 insertions(+), 32 deletions(-) diff --git a/README.org b/README.org index 2a07b87..25f3257 100644 --- a/README.org +++ b/README.org @@ -544,6 +544,9 @@ Simple links may also be written manually in either sexp or non-sexp form, like: *Changed* + Give more useful error message for invalid queries. +*Internal* ++ Certain query predicates, when called multiple times in an ~and~ sub-expression, are optimized to a single call. + ** 0.6.2 *Fixed* diff --git a/org-ql.el b/org-ql.el index 56ab9ea..1cb78ad 100644 --- a/org-ql.el +++ b/org-ql.el @@ -694,6 +694,56 @@ returns nil." ;; partially typed queries in the Helm commands. (define-error 'org-ql-invalid-query "Invalid Org QL query" 'user-error) +(defun org-ql--coalesce-ands (query) + "Return QUERY having coalesced any AND'ed clauses' predicates. +Multiple calls to the same predicate within an `and' expression +are coalesced into a single call to the predicate. + +Note that this is a relatively simple function which does not +comprehensively coalesce every call that could be. For example, +if QUERY contained four calls to the `src' predicate with two +unique language arguments, only the calls for one language would +be coalesced." + ;; TODO: Use a per-predicate alist-getting function that accounts + ;; for arguments which must be unique...maybe...someday... + + ;; NOTE: This implentation can sometimes reorder sub-expressions, + ;; like: + ;; + ;; (and (src :regexps ("foo") :lang "elisp") (src :regexps ("bar"))) + ;; + ;; becomes: + ;; + ;; (and (src :regexps ("bar")) (src :regexps ("foo") :lang "elisp")) + ;; + ;; because the first one could be coalescable, but the second one + ;; 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))) + (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-multiple-calls) + (`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." @@ -967,7 +1017,7 @@ defined in `org-ql-predicates' by calling `org-ql-defpred'." (setf query new-query) (when (eq (cl-incf count) limit) (error "Query normalization limit exceeded: QUERY:%S" query))) - finally return new-query))))))) + finally return (org-ql--coalesce-ands new-query)))))))) (defun org-ql--define-query-preamble-fn (predicates) "Define function `org-ql--query-preamble' for PREDICATES. @@ -1037,7 +1087,7 @@ defined in `org-ql-predicates' by calling `org-ql-defpred'." ;; function still works. But to avoid the warning, we byte-compile it afterward. (byte-compile 'org-ql--query-preamble))) -(cl-defmacro org-ql-defpred (name args docstring &key body preambles normalizers) +(cl-defmacro org-ql-defpred (name args docstring &key body preambles normalizers coalesce-multiple-calls) "Define an `org-ql' selector predicate named `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 @@ -1091,6 +1141,22 @@ to variables bound in the pattern: query expression with no work to do, which improves performance. +When COALESCE-MULTIPLE-CALLS is t, multiple calls to this +predicate within a query clause may be combined into a single +call to this predicate (so it is expected that this predicate +treats multiple arguments as being boolean AND'ed together). + +This value may also be a function called to do coalescing of two +predicate expressions. It is called with two arguments: the list +of already-coalesced arguments to an expression, and the list of +arguments to the call being coalesced (note that a query's +arguments are normalized before the query is coalesced). If it +returns nil, the expression is not coalesced; otherwise, it +should return a new list of arguments coalescing the given +arguments, with new arguments being first. (This is useful, +e.g. when a predicate takes keyword arguments, which means that +multiple calls to it can't be simply appended.) + For convenience, within the `pcase' patterns, the symbol `predicate-names' is a special form which is replaced with a pattern matching any of the predicate's name and aliases. For @@ -1107,6 +1173,8 @@ It would be expanded to: ((`(,(or 'heading 'h) . ,args) `(heading ,@args)))" + ;; FIXME: Update defpred tutorial to include :coalesce-multiple-calls. + ;; NOTE: The debug form works, completely! For example, use `edebug-defun' ;; on the `heading' predicate, then evaluate this form: ;; (let* ((query '(heading "HEADING")) @@ -1116,7 +1184,8 @@ It would be expanded to: ;; :normalized normalized ;; :preamble preamble)) (declare (debug ([&or symbolp listp] listp stringp - &rest [&or [":body" def-body] + &rest [&or [":coalesce-multiple-calls" form] + [":body" def-body] [":normalizers" (&rest (sexp def-body))] [":preambles" (&rest (sexp def-body))]])) (indent defun)) @@ -1137,7 +1206,8 @@ It would be expanded to: ;; SOMEDAY: Use `map-elt' here, after map 2.1 can be automatically installed in CI sandbox... (setf (alist-get ',predicate-name org-ql-predicates) `(:name ,',name :aliases ,',aliases :fn ,',fn-name :docstring ,(\, docstring) :args ,',args - :normalizers ,',normalizers :preambles ,',preambles)) + :normalizers ,',normalizers :preambles ,',preambles + :coalesce-multiple-calls ,,coalesce-multiple-calls)) (unless org-ql-defpred-defer ;; Reversing preserves the order in which predicates were defined. (org-ql--define-normalize-query-fn (reverse org-ql-predicates)) @@ -1320,6 +1390,7 @@ Org effort string, like \"5\" or \"0:05\"." (org-ql-defpred (heading h) (&rest strings) "Return non-nil if current entry's heading matches all STRINGS. Matching is done case-insensitively." + :coalesce-multiple-calls t :normalizers ((`(,predicate-names . ,args) ;; "h" alias. `(heading ,@args))) @@ -1346,6 +1417,7 @@ Matching is done case-insensitively." (org-ql-defpred (heading-regexp h*) (&rest regexps) "Return non-nil if current entry's heading matches all REGEXPS (regexp strings). Matching is done case-insensitively." + :coalesce-multiple-calls t :normalizers ((`(,predicate-names . ,args) ;; "h" alias. `(heading-regexp ,@args))) @@ -1498,6 +1570,7 @@ the following queries: (olp \"Food\" \"Fruits\") (olp \"Fruits\" \"Grapes\") (olp \"Food\" \"Grapes\")" + :coalesce-multiple-calls t :normalizers ((`(,predicate-names . ,strings) ;; Regexp quote headings. `(org-ql--predicate-outline-path ,@(mapcar #'regexp-quote strings)))) @@ -1652,6 +1725,7 @@ priority B)." (org-ql-defpred (regexp r) (&rest regexps) "Return non-nil if current entry matches all of REGEXPS (regexp strings)." + :coalesce-multiple-calls t :normalizers ((`(,predicate-names . ,args) `(regexp ,@args))) ;; MAYBE: Separate case-sensitive (Regexp) predicate. @@ -1674,6 +1748,15 @@ priority B)." "Return non-nil if current entry contains an Org source block matching all of REGEXPS. If keyword argument LANG is non-nil, the block must be in that language." + :coalesce-multiple-calls (lambda (coalesced-args current-args) + (when (or (not coalesced-args) + (equal (plist-get current-args :lang) + (plist-get coalesced-args :lang))) + (setf (plist-get coalesced-args :regexps) + (append (plist-get coalesced-args :regexps) + (plist-get current-args :regexps)) + (plist-get coalesced-args :lang) (plist-get current-args :lang)) + coalesced-args)) :normalizers ((`(,predicate-names . ,args) ;; Rewrite to use keyword args. (cond ((cl-every #'stringp args) @@ -1739,6 +1822,7 @@ Tests both inherited and local tags." (org-ql-defpred (tags-all tags&) (&rest tags) "Return non-nil if current heading has all of TAGS (a list of strings). Tests both inherited and local tags." + :coalesce-multiple-calls t ;; MAYBE: -all versions for inherited and local. :normalizers ((`(,predicate-names . ,tags) `(and ,@(--map `(tags ,it) tags)))) diff --git a/org-ql.info b/org-ql.info index 5205d5c..684a19e 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1015,6 +1015,10 @@ File: README.info, Node: 07-pre, Next: 062, Up: Changelog *Changed* • Give more useful error message for invalid queries. + *Internal* + • Certain query predicates, when called multiple times in an ‘and’ + sub-expression, are optimized to a single call. +  File: README.info, Node: 062, Next: 061, Prev: 07-pre, Up: Changelog @@ -1659,34 +1663,34 @@ Node: Links36258 Node: Tips36945 Node: Changelog37269 Node: 07-pre38037 -Node: 06238642 -Node: 06138950 -Node: 0639518 -Node: 05242572 -Node: 05142872 -Node: 0543295 -Node: 04944824 -Node: 04845104 -Node: 04745451 -Node: 04645860 -Node: 04546268 -Node: 04446629 -Node: 04346988 -Node: 04247191 -Node: 04147352 -Node: 0447599 -Node: 03251700 -Node: 03152103 -Node: 0352300 -Node: 02355600 -Node: 02255834 -Node: 02156114 -Node: 0256319 -Node: 0160397 -Node: Notes60498 -Node: Comparison with Org Agenda searches60660 -Node: org-sidebar61549 -Node: License61828 +Node: 06238786 +Node: 06139094 +Node: 0639662 +Node: 05242716 +Node: 05143016 +Node: 0543439 +Node: 04944968 +Node: 04845248 +Node: 04745595 +Node: 04646004 +Node: 04546412 +Node: 04446773 +Node: 04347132 +Node: 04247335 +Node: 04147496 +Node: 0447743 +Node: 03251844 +Node: 03152247 +Node: 0352444 +Node: 02355744 +Node: 02255978 +Node: 02156258 +Node: 0256463 +Node: 0160541 +Node: Notes60642 +Node: Comparison with Org Agenda searches60804 +Node: org-sidebar61693 +Node: License61972  End Tag Table From 4f29bcfd67aa88bf8f45b9b580e8f3ac84465700 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 9 Jun 2022 23:03:48 -0500 Subject: [PATCH 011/224] Add: (rifle/smart) Predicate --- README.org | 4 ++ org-ql.el | 26 ++++++++++++- org-ql.info | 106 ++++++++++++++++++++++++++++++---------------------- 3 files changed, 90 insertions(+), 46 deletions(-) diff --git a/README.org b/README.org index 25f3257..b89765a 100644 --- a/README.org +++ b/README.org @@ -236,6 +236,9 @@ Arguments are listed next to predicate names, where applicable. + =property (property &optional value)= :: Return non-nil if current entry has ~PROPERTY~ (a string), and optionally ~VALUE~ (a string). Note that property inheritance is currently /not/ enabled for this predicate. If you need to test with inheritance, you could use a custom predicate form, like ~(org-entry-get (point) "PROPERTY" 'inherit)~. + =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. + - 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. + =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. @@ -539,6 +542,7 @@ Simple links may also be written manually in either sexp or non-sexp form, like: *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.). ++ 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). *Changed* diff --git a/org-ql.el b/org-ql.el index 1cb78ad..3e54283 100644 --- a/org-ql.el +++ b/org-ql.el @@ -298,11 +298,13 @@ See Info node `(org-ql)Queries'." :type 'boolean :risky t) -(defcustom org-ql-default-predicate 'regexp +(defcustom org-ql-default-predicate 'rifle "Predicate used for plain-string tokens without a specified predicate." :type '(choice (const heading) (const heading-regexp) (const regexp) + (const rifle) + (const smart) (const outline-path) (const outline-path-segment))) @@ -1555,6 +1557,28 @@ any link is found." (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 string argument is found in either the entry or its outline path. +Works like `org-rifle'. This is probably the most useful, +intuitive, general-purpose predicate." + ;; NOTE: This predicate advertises that it takes strings, but they + ;; are normalized to regexps. Because of that, we must use a + ;; coalescing function. + :coalesce-multiple-calls (lambda (coalesced-args current-args) + (setf (plist-get coalesced-args :regexps) + (list 'quote (append (cadr (plist-get coalesced-args :regexps)) + (cadr (plist-get current-args :regexps))))) + coalesced-args) + :normalizers ((`(,predicate-names . ,(and rest (guard (cl-every #'stringp rest)))) + ;; If this doesn't match, it's already normalized. + `(rifle :regexps ',(mapcar #'regexp-quote rest)))) + :preambles ((`(,predicate-names :regexps ',regexps) + (list :regexp (rx-to-string `(seq bow (or ,@(mapcar (lambda (s) `(regexp ,s)) regexps)))) + :case-fold t :query query))) + :body (cl-loop for regexp in (plist-get strings :regexps) + always (or (org-ql--predicate-regexp regexp) + (org-ql--predicate-outline-path regexp)))) + ;; MAYBE: Preambles for outline-path predicates. Not sure if possible without complicated logic. ;; FIXME: These preds say they accept regexps but the strings get regexp-quoted. They should probably just take strings. diff --git a/org-ql.info b/org-ql.info index 684a19e..25ccf74 100644 --- a/org-ql.info +++ b/org-ql.info @@ -483,6 +483,15 @@ Arguments are listed next to predicate names, where applicable. 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. + • 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’ @@ -1008,6 +1017,13 @@ File: README.info, Node: 07-pre, Next: 062, Up: Changelog ‘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.). + • 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 ‘org-rifle’ (https://github.com/alphapapa/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). @@ -1646,51 +1662,51 @@ Node: org-ql-sparse-tree8345 Node: Queries9145 Node: Non-sexp query syntax10262 Node: General predicates12021 -Node: Ancestor/descendant predicates18260 -Node: Date/time predicates19388 -Node: Functions / Macros22512 -Node: Agenda-like views22810 -Ref: Function ‘org-ql-block’22972 -Node: Listing / acting-on results24233 -Ref: Caching24441 -Ref: Function ‘org-ql-select’25354 -Ref: Function ‘org-ql-query’27780 -Ref: Macro ‘org-ql’ (deprecated)29554 -Node: Custom predicates29869 -Ref: Macro ‘org-ql-defpred’30093 -Node: Dynamic block33534 -Node: Links36258 -Node: Tips36945 -Node: Changelog37269 -Node: 07-pre38037 -Node: 06238786 -Node: 06139094 -Node: 0639662 -Node: 05242716 -Node: 05143016 -Node: 0543439 -Node: 04944968 -Node: 04845248 -Node: 04745595 -Node: 04646004 -Node: 04546412 -Node: 04446773 -Node: 04347132 -Node: 04247335 -Node: 04147496 -Node: 0447743 -Node: 03251844 -Node: 03152247 -Node: 0352444 -Node: 02355744 -Node: 02255978 -Node: 02156258 -Node: 0256463 -Node: 0160541 -Node: Notes60642 -Node: Comparison with Org Agenda searches60804 -Node: org-sidebar61693 -Node: License61972 +Node: Ancestor/descendant predicates18763 +Node: Date/time predicates19891 +Node: Functions / Macros23015 +Node: Agenda-like views23313 +Ref: Function ‘org-ql-block’23475 +Node: Listing / acting-on results24736 +Ref: Caching24944 +Ref: Function ‘org-ql-select’25857 +Ref: Function ‘org-ql-query’28283 +Ref: Macro ‘org-ql’ (deprecated)30057 +Node: Custom predicates30372 +Ref: Macro ‘org-ql-defpred’30596 +Node: Dynamic block34037 +Node: Links36761 +Node: Tips37448 +Node: Changelog37772 +Node: 07-pre38540 +Node: 06239801 +Node: 06140109 +Node: 0640677 +Node: 05243731 +Node: 05144031 +Node: 0544454 +Node: 04945983 +Node: 04846263 +Node: 04746610 +Node: 04647019 +Node: 04547427 +Node: 04447788 +Node: 04348147 +Node: 04248350 +Node: 04148511 +Node: 0448758 +Node: 03252859 +Node: 03153262 +Node: 0353459 +Node: 02356759 +Node: 02256993 +Node: 02157273 +Node: 0257478 +Node: 0161556 +Node: Notes61657 +Node: Comparison with Org Agenda searches61819 +Node: org-sidebar62708 +Node: License62987  End Tag Table From 73ef71ced7cf003955ecb311441802623aa6741a Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 9 Jun 2022 22:09:46 -0500 Subject: [PATCH 012/224] Comment: Add FIXME --- org-ql.el | 1 + 1 file changed, 1 insertion(+) diff --git a/org-ql.el b/org-ql.el index 3e54283..e89108e 100644 --- a/org-ql.el +++ b/org-ql.el @@ -1628,6 +1628,7 @@ contiguous segment of the outline path: (org-ql-defpred 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." + ;; FIXME: This should AND the regexps together, not OR them. :body (when (buffer-file-name) (cl-typecase regexps (null t) From 6602f32165ae638a040b252acd3d17263b6974e0 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 9 Jun 2022 23:21:07 -0500 Subject: [PATCH 013/224] Tests: Update (add, reorganize) They all pass now (with a temporary, uncommitted workaround in makem.sh for a Buttercup bug: ). --- tests/test-org-ql.el | 999 +++++++++++++++++++++++-------------------- 1 file changed, 542 insertions(+), 457 deletions(-) diff --git a/tests/test-org-ql.el b/tests/test-org-ql.el index 0839688..41ba1f6 100644 --- a/tests/test-org-ql.el +++ b/tests/test-org-ql.el @@ -205,475 +205,556 @@ with keyword arg NOW in PLIST." (expect (org-ql--value-at (point-min) #'org-get-local-tags) :to-be nil)))) - (describe "Query functions/macros" - - (it "org-ql-select" - (expect (length (org-ql-select org-ql-test-buffer - '(category) - :sort 'deadline)) - :to-equal org-ql-test-num-headings)) - (it "org-ql-query" - (expect (length (org-ql-query :select 'element - :from org-ql-test-buffer - :where '(category) - :order-by 'date)) - :to-equal org-ql-test-num-headings))) - (describe "Query pre-processing" - (describe "(level)" - (it "with one level" - (expect (org-ql--normalize-query '(level "1")) - :to-equal '(level 1))) - (it "with two levels" - (expect (org-ql--normalize-query '(level "1" "2")) - :to-equal '(level 1 2))) - (it "with a comparator and a level" - (expect (org-ql--normalize-query '(level ">" "1")) - :to-equal '(level > 1)))) + (describe "Coalescing" + ;; NOTE: Queries are expected to be normalized before being coalesced, + ;; and `org-ql--normalize-query' calls `org-ql--coalesce-ands' as its + ;; final step, so in these tests we just call the former. + (it "coalesces a single AND clause that uses one predicate (and preserves argument order)" + (expect (org-ql--normalize-query '(and (rifle "foo") (rifle "bar"))) + :to-equal '(and (rifle :regexps '("foo" "bar"))))) + (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")))) + (it "preserves independent OR clauses" + (expect (org-ql--normalize-query '(and (or (rifle "foo") (rifle "bar")) + (or (rifle "baz") (rifle "buz")))) + :to-equal '(and (or (rifle :regexps '("foo")) (rifle :regexps '("bar"))) (or (rifle :regexps '("baz")) (rifle :regexps '("buz")))))) + (it "coalesces an AND clause within an OR clause" + (expect (org-ql--normalize-query '(or (regexp "bar") (and (rifle "foo") (rifle "bar")))) + :to-equal '(or (regexp "bar") (and (rifle :regexps '("foo" "bar")))))) + (it "coalesces multiple AND clauses within an OR clause" + (expect (org-ql--normalize-query '(or (and (rifle "foo") (rifle "bar")) + (and (rifle "baz") (rifle "buz")))) + :to-equal '(or (and (rifle :regexps '("foo" "bar"))) (and (rifle :regexps '("baz" "buz")))))) + (it "coalesces arguments to predicates which use coalescing functions and whose calls are eligible for coalescing" + (expect (org-ql--normalize-query '(and (src "foo") (src "bar"))) + :to-equal '(and (src :lang nil :regexps ("foo" "bar")))) + (expect (org-ql--normalize-query '(and (src "foo" :lang "elisp") (src "bar" :lang "elisp"))) + :to-equal '(and (src :lang "elisp" :regexps ("foo" "bar"))))) + (it "does not coalesce arguments to predicates which use coalescing functions and whose calls are ineligible for coalescing" + (expect (org-ql--normalize-query '(and (src "foo" :lang "elisp") (src "bar"))) + ;; NOTE: The current implementation of `org-ql--normalize-query' + ;; reorders clauses in this case. Fixing that would probably + ;; not be worth the effort in code or runtime. + :to-equal '(and (src :regexps ("bar")) (src :lang "elisp" :regexps ("foo")))) + (expect (org-ql--normalize-query '(and (src "foo" :lang "elisp") (src "bar" :lang "python"))) + :to-equal '(and (src :lang "python" :regexps ("bar")) (src :lang "elisp" :regexps ("foo")))))) - (describe "(link)" - (it "with one argument" - (expect (org-ql--normalize-query '(link "DESC-OR-TARGET")) - :to-equal '(link "DESC-OR-TARGET"))) - (it "with one argument and :regexp-p" - (expect (org-ql--normalize-query '(link "DESC-OR-TARGET" :regexp-p t)) - :to-equal '(link "DESC-OR-TARGET" :regexp-p t))) - (it "with keyword arguments" - (expect (org-ql--normalize-query '(link :description "DESCRIPTION" :target "TARGET" - :regexp-p t)) - :to-equal '(link :description "DESCRIPTION" :target "TARGET" - :regexp-p t)))) + (describe "Normalization" - (describe "(outline-path)" - (it "with a regexp metacharacter" - ;; Ensures that normalizer doesn't infinitely loop. - (expect (org-ql--normalize-query '(olp "a." "b")) - :to-equal '(org-ql--predicate-outline-path "a\\." "b")))) + (it "Default predicate" + (expect (org-ql--normalize-query "scheduled") + ;; No colon after keyword, so not a predicate query. + :to-equal '(rifle :regexps '("scheduled"))) + (expect (org-ql--normalize-query "\"quoted phrase\"") + :to-equal '(rifle :regexps '("\"quoted phrase\"")))) - (describe "(tags-inherited)" - (it "handles 0 arguments" - (expect (org-ql--normalize-query '(tags-inherited)) - :to-equal '(tags-inherited))) - (it "handles 1 argument" - (expect (org-ql--normalize-query '(tags-inherited "foo")) - :to-equal '(tags-inherited "foo"))) - (it "handles 2 arguments" - (expect (org-ql--normalize-query '(tags-inherited "foo" "bar")) - :to-equal '(tags-inherited "foo" "bar"))) - (it "aliases to `itags'" - (expect (org-ql--normalize-query '(itags)) - :to-equal '(tags-inherited))) - (it "aliases to `itags' with one argument" - (expect (org-ql--normalize-query '(itags "foo")) - :to-equal '(tags-inherited "foo"))) - (it "aliases to `itags' with two arguments" - (expect (org-ql--normalize-query '(itags "foo" "bar")) - :to-equal '(tags-inherited "foo" "bar")))) + (describe "Plain strings" + (it "normalizes plain strings to the default predicate (using AND)" + (expect (org-ql--normalize-query '(and "string1" "string2")) + :to-equal '(and (rifle :regexps '("string1" "string2"))))) + (it "normalizes plain strings to the default predicate (using OR)" + (expect (org-ql--normalize-query '(or "string1" "string2")) + :to-equal '(or (rifle :regexps '("string1")) (rifle :regexps '("string2"))))) + (it "normalizes plain strings within sub-expressions to the default predicate" + (expect (org-ql--normalize-query '(and (todo "TODO") + (or "string1" "string2"))) + :to-equal '(and (todo "TODO") (or (rifle :regexps '("string1")) (rifle :regexps '("string2"))))) + (expect (org-ql--normalize-query '(when (todo "TODO") + (or "string1" "string2"))) + :to-equal '(when (todo "TODO") (or (rifle :regexps '("string1")) (rifle :regexps '("string2"))))) + (expect (org-ql--normalize-query '(when "string-cond1" + (or "string1" "string2"))) + :to-equal '(when (rifle :regexps '("string-cond1")) (or (rifle :regexps '("string1")) (rifle :regexps '("string2"))))) + (expect (org-ql--normalize-query '(when (and "string-cond1" "string-cond2") + (or "string1" "string2"))) + :to-equal '(when (and (rifle :regexps '("string-cond1")) (rifle :regexps '("string-cond2"))) (or (rifle :regexps '("string1")) (rifle :regexps '("string2"))))) + (expect (org-ql--normalize-query '(unless (and "stringcondition1" "stringcond2") + (or "string1" "string2"))) + :to-equal '(unless (and (rifle :regexps '("stringcondition1")) (rifle :regexps '("stringcond2"))) (or (rifle :regexps '("string1")) (rifle :regexps '("string2"))))))) - (describe "timestamp predicates" - ;; NOTE: (clocked) and (closed) don't accept :with-time arguments. - (describe "(clocked)" - (let ((beg-of-today-ts (->> (ts-now) - (ts-apply :hour 0 :minute 0 :second 0))) - (end-of-today-ts (->> (ts-now) - (ts-apply :hour 23 :minute 59 :second 59)))) - ;; MAYBE: While it seems helpful for (clocked) and (close) to - ;; implicitly look into the past (because entries can't be - ;; clocked or closed in the future), it makes the API - ;; inconsistent. It would be better to be consistent and - ;; require the user to pass these predicates a negative number. - (it "with a number" - (expect (org-ql--normalize-query '(clocked 0)) - :to-equal `(clocked :from ,beg-of-today-ts)) - (expect (org-ql--normalize-query '(clocked 1)) - :to-equal `(clocked :from ,(ts-inc 'day -1 beg-of-today-ts)))) - (it ":from/:to/:on" - (expect (org-ql--normalize-query '(clocked :on today)) - :to-equal `(clocked :from ,beg-of-today-ts :to ,end-of-today-ts)) - (expect (org-ql--normalize-query '(clocked :on 0)) - :to-equal `(clocked :from ,beg-of-today-ts :to ,end-of-today-ts)) - (expect (org-ql--normalize-query '(clocked :on 1)) - :to-equal `(clocked :from ,(ts-inc 'day 1 beg-of-today-ts) - :to ,(ts-inc 'day 1 end-of-today-ts)))))) - (describe "(closed)" - (let ((beg-of-today-ts (->> (ts-now) - (ts-apply :hour 0 :minute 0 :second 0))) - (end-of-today-ts (->> (ts-now) - (ts-apply :hour 23 :minute 59 :second 59)))) - (it "with a number" - (expect (org-ql--normalize-query '(closed 0)) - :to-equal `(closed :from ,beg-of-today-ts)) - (expect (org-ql--normalize-query '(closed 1)) - :to-equal `(closed :from ,(ts-inc 'day -1 beg-of-today-ts)))) - (it ":from/:to/:on" - (expect (org-ql--normalize-query '(closed :on today)) - :to-equal `(closed :from ,beg-of-today-ts :to ,end-of-today-ts)) - (expect (org-ql--normalize-query '(closed :on 0)) - :to-equal `(closed :from ,beg-of-today-ts :to ,end-of-today-ts)) - (expect (org-ql--normalize-query '(closed :on 1)) - :to-equal `(closed :from ,(ts-inc 'day 1 beg-of-today-ts) - :to ,(ts-inc 'day 1 end-of-today-ts)))))) + (describe "(rifle)" + (it "with one argument" + (expect (org-ql--normalize-query '(rifle "foo.")) + :to-equal '(rifle :regexps '("foo\\.")))) + (it "with two arguments" + (expect (org-ql--normalize-query '(rifle "foo." "bar")) + :to-equal '(rifle :regexps '("foo\\." "bar"))))) - ;; NOTE: The rest of them do accept :with-time. - (describe "(deadline)" - (let ((beg-of-today-ts (->> (ts-now) - (ts-apply :hour 0 :minute 0 :second 0))) - (end-of-today-ts (->> (ts-now) - (ts-apply :hour 23 :minute 59 :second 59)))) - (it "with auto" - (let ((auto-ts (->> (ts-now) - (ts-adjust 'day org-deadline-warning-days) - (ts-apply :hour 23 :minute 59 :second 59)))) - (expect (org-ql--normalize-query '(deadline auto)) - :to-equal `(deadline-warning :to ,auto-ts)) - (expect (org-ql--normalize-query '(deadline auto :with-time t)) - :to-equal `(deadline-warning :to ,auto-ts :with-time t)) - (expect (org-ql--normalize-query '(deadline auto :with-time nil)) - :to-equal `(deadline-warning :to ,auto-ts :with-time nil)))) - (it "with a number" - (expect (org-ql--normalize-query '(deadline 0)) - :to-equal `(deadline :to ,end-of-today-ts)) - (expect (org-ql--normalize-query '(deadline 0 :with-time t)) - :to-equal `(deadline :to ,end-of-today-ts :with-time t)) - (expect (org-ql--normalize-query '(deadline 0 :with-time nil)) - :to-equal `(deadline :to ,end-of-today-ts :with-time nil)) - (expect (org-ql--normalize-query '(deadline 2)) - :to-equal `(deadline :to ,(ts-inc 'day 2 end-of-today-ts))) - (expect (org-ql--normalize-query '(deadline 2 :with-time nil)) - :to-equal `(deadline :to ,(ts-inc 'day 2 end-of-today-ts) - :with-time nil)) - (expect (org-ql--normalize-query '(deadline 2 :with-time t)) - :to-equal `(deadline :to ,(ts-inc 'day 2 end-of-today-ts) - :with-time t))) - (it ":from/:to/:on" - (expect (org-ql--normalize-query '(deadline :on today)) - :to-equal `(deadline :from ,beg-of-today-ts :to ,end-of-today-ts)) - (expect (org-ql--normalize-query '(deadline :on today :with-time t)) - :to-equal `(deadline :from ,beg-of-today-ts :to ,end-of-today-ts - :with-time t)) - (expect (org-ql--normalize-query '(deadline :on today :with-time nil)) - :to-equal `(deadline :from ,beg-of-today-ts :to ,end-of-today-ts - :with-time nil)) - (expect (org-ql--normalize-query '(deadline :on 0)) - :to-equal `(deadline :from ,beg-of-today-ts :to ,end-of-today-ts)) - (expect (org-ql--normalize-query '(deadline :on 0 :with-time t)) - :to-equal `(deadline :from ,beg-of-today-ts :to ,end-of-today-ts - :with-time t)) - (expect (org-ql--normalize-query '(deadline :on 1)) - :to-equal `(deadline :from ,(ts-inc 'day 1 beg-of-today-ts) - :to ,(ts-inc 'day 1 end-of-today-ts)))))) - (describe "(scheduled)" - (let ((beg-of-today-ts (->> (ts-now) - (ts-apply :hour 0 :minute 0 :second 0))) - (end-of-today-ts (->> (ts-now) - (ts-apply :hour 23 :minute 59 :second 59)))) - (it "with a number" - (expect (org-ql--normalize-query '(scheduled 0)) - :to-equal `(scheduled :from ,beg-of-today-ts :to ,end-of-today-ts)) - (expect (org-ql--normalize-query '(scheduled 0 :with-time t)) - :to-equal `(scheduled :from ,beg-of-today-ts :to ,end-of-today-ts - :with-time t)) - (expect (org-ql--normalize-query '(scheduled 0 :with-time nil)) - :to-equal `(scheduled :from ,beg-of-today-ts :to ,end-of-today-ts - :with-time nil)) - (expect (org-ql--normalize-query '(scheduled 1)) - :to-equal `(scheduled :from ,(ts-inc 'day 1 beg-of-today-ts) - :to ,(ts-inc 'day 1 end-of-today-ts)))) - (it ":from/:to/:on" - (expect (org-ql--normalize-query '(scheduled :on today)) - :to-equal `(scheduled :from ,beg-of-today-ts :to ,end-of-today-ts)) - (expect (org-ql--normalize-query '(scheduled :on today :with-time t)) - :to-equal `(scheduled :from ,beg-of-today-ts :to ,end-of-today-ts - :with-time t)) - (expect (org-ql--normalize-query '(scheduled :on today :with-time nil)) - :to-equal `(scheduled :from ,beg-of-today-ts :to ,end-of-today-ts - :with-time nil)) - (expect (org-ql--normalize-query '(scheduled :on 0)) - :to-equal `(scheduled :from ,beg-of-today-ts :to ,end-of-today-ts)) - (expect (org-ql--normalize-query '(scheduled :on 0 :with-time t)) - :to-equal `(scheduled :from ,beg-of-today-ts :to ,end-of-today-ts - :with-time t)) - (expect (org-ql--normalize-query '(scheduled :on 1)) - :to-equal `(scheduled :from ,(ts-inc 'day 1 beg-of-today-ts) + (describe "(level)" + (it "with one level" + (expect (org-ql--normalize-query '(level "1")) + :to-equal '(level 1))) + (it "with two levels" + (expect (org-ql--normalize-query '(level "1" "2")) + :to-equal '(level 1 2))) + (it "with a comparator and a level" + (expect (org-ql--normalize-query '(level ">" "1")) + :to-equal '(level > 1)))) + + (describe "(link)" + (it "with one argument" + (expect (org-ql--normalize-query '(link "DESC-OR-TARGET")) + :to-equal '(link "DESC-OR-TARGET"))) + (it "with one argument and :regexp-p" + (expect (org-ql--normalize-query '(link "DESC-OR-TARGET" :regexp-p t)) + :to-equal '(link "DESC-OR-TARGET" :regexp-p t))) + (it "with keyword arguments" + (expect (org-ql--normalize-query '(link :description "DESCRIPTION" :target "TARGET" + :regexp-p t)) + :to-equal '(link :description "DESCRIPTION" :target "TARGET" + :regexp-p t)))) + + (describe "(outline-path)" + (it "with a regexp metacharacter" + ;; Ensures that normalizer doesn't infinitely loop. + (expect (org-ql--normalize-query '(olp "a." "b")) + :to-equal '(org-ql--predicate-outline-path "a\\." "b")))) + + (describe "(src)" + (it "normalizes a non-keyword arg to keywords" + (expect (org-ql--normalize-query '(src "foo")) + :to-equal '(src :regexps ("foo")))) + (it "normalizes non-keyword args to keywords" + (expect (org-ql--normalize-query '(src "foo" "bar")) + :to-equal '(src :regexps ("foo" "bar")))) + (it "normalizes a non-keyword arg with a :lang keyword arg to keywords" + (expect (org-ql--normalize-query '(src "foo" :lang "bar")) + :to-equal '(src :lang "bar" :regexps ("foo")))) + (it "normalizes non-keyword args with a :lang keyword arg to keywords" + (expect (org-ql--normalize-query '(src "foo" "bar" :lang "baz")) + :to-equal '(src :lang "baz" :regexps ("foo" "bar")))) + (it "normalizes all-keyword args without looping" + (expect (org-ql--normalize-query '(src :regexps ("foo") :lang "bar")) + :to-equal '(src :lang "bar" :regexps ("foo"))) + (expect (org-ql--normalize-query '(src :regexps ("foo") :lang)) + :to-equal '(src :regexps ("foo"))))) + + (describe "(tags-inherited)" + (it "handles 0 arguments" + (expect (org-ql--normalize-query '(tags-inherited)) + :to-equal '(tags-inherited))) + (it "handles 1 argument" + (expect (org-ql--normalize-query '(tags-inherited "foo")) + :to-equal '(tags-inherited "foo"))) + (it "handles 2 arguments" + (expect (org-ql--normalize-query '(tags-inherited "foo" "bar")) + :to-equal '(tags-inherited "foo" "bar"))) + (it "aliases to `itags'" + (expect (org-ql--normalize-query '(itags)) + :to-equal '(tags-inherited))) + (it "aliases to `itags' with one argument" + (expect (org-ql--normalize-query '(itags "foo")) + :to-equal '(tags-inherited "foo"))) + (it "aliases to `itags' with two arguments" + (expect (org-ql--normalize-query '(itags "foo" "bar")) + :to-equal '(tags-inherited "foo" "bar")))) + + (describe "timestamp predicates" + ;; NOTE: (clocked) and (closed) don't accept :with-time arguments. + (describe "(clocked)" + (let ((beg-of-today-ts (->> (ts-now) + (ts-apply :hour 0 :minute 0 :second 0))) + (end-of-today-ts (->> (ts-now) + (ts-apply :hour 23 :minute 59 :second 59)))) + ;; MAYBE: While it seems helpful for (clocked) and (close) to + ;; implicitly look into the past (because entries can't be + ;; clocked or closed in the future), it makes the API + ;; inconsistent. It would be better to be consistent and + ;; require the user to pass these predicates a negative number. + (it "with a number" + (expect (org-ql--normalize-query '(clocked 0)) + :to-equal `(clocked :from ,beg-of-today-ts)) + (expect (org-ql--normalize-query '(clocked 1)) + :to-equal `(clocked :from ,(ts-inc 'day -1 beg-of-today-ts)))) + (it ":from/:to/:on" + (expect (org-ql--normalize-query '(clocked :on today)) + :to-equal `(clocked :from ,beg-of-today-ts :to ,end-of-today-ts)) + (expect (org-ql--normalize-query '(clocked :on 0)) + :to-equal `(clocked :from ,beg-of-today-ts :to ,end-of-today-ts)) + (expect (org-ql--normalize-query '(clocked :on 1)) + :to-equal `(clocked :from ,(ts-inc 'day 1 beg-of-today-ts) :to ,(ts-inc 'day 1 end-of-today-ts)))))) - (describe "(planning)" - (let ((beg-of-today-ts (->> (ts-now) - (ts-apply :hour 0 :minute 0 :second 0))) - (end-of-today-ts (->> (ts-now) - (ts-apply :hour 23 :minute 59 :second 59)))) - (it "with a number" - (expect (org-ql--normalize-query '(planning 0)) - :to-equal `(planning :to ,end-of-today-ts)) - (expect (org-ql--normalize-query '(planning 0 :with-time t)) - :to-equal `(planning :to ,end-of-today-ts :with-time t)) - (expect (org-ql--normalize-query '(planning 0 :with-time nil)) - :to-equal `(planning :to ,end-of-today-ts :with-time nil)) - (expect (org-ql--normalize-query '(planning 1)) - :to-equal `(planning :to ,(ts-inc 'day 1 end-of-today-ts)))) - (it ":from/:to/:on" - (expect (org-ql--normalize-query '(planning :on today)) - :to-equal `(planning :from ,beg-of-today-ts :to ,end-of-today-ts)) - (expect (org-ql--normalize-query '(planning :on today :with-time t)) - :to-equal `(planning :from ,beg-of-today-ts :to ,end-of-today-ts - :with-time t)) - (expect (org-ql--normalize-query '(planning :on today :with-time nil)) - :to-equal `(planning :from ,beg-of-today-ts :to ,end-of-today-ts - :with-time nil)) - (expect (org-ql--normalize-query '(planning :on 0)) - :to-equal `(planning :from ,beg-of-today-ts :to ,end-of-today-ts)) - (expect (org-ql--normalize-query '(planning :on 0 :with-time t)) - :to-equal `(planning :from ,beg-of-today-ts :to ,end-of-today-ts - :with-time t)) - (expect (org-ql--normalize-query '(planning :on 1)) - :to-equal `(planning :from ,(ts-inc 'day 1 beg-of-today-ts) + (describe "(closed)" + (let ((beg-of-today-ts (->> (ts-now) + (ts-apply :hour 0 :minute 0 :second 0))) + (end-of-today-ts (->> (ts-now) + (ts-apply :hour 23 :minute 59 :second 59)))) + (it "with a number" + (expect (org-ql--normalize-query '(closed 0)) + :to-equal `(closed :from ,beg-of-today-ts)) + (expect (org-ql--normalize-query '(closed 1)) + :to-equal `(closed :from ,(ts-inc 'day -1 beg-of-today-ts)))) + (it ":from/:to/:on" + (expect (org-ql--normalize-query '(closed :on today)) + :to-equal `(closed :from ,beg-of-today-ts :to ,end-of-today-ts)) + (expect (org-ql--normalize-query '(closed :on 0)) + :to-equal `(closed :from ,beg-of-today-ts :to ,end-of-today-ts)) + (expect (org-ql--normalize-query '(closed :on 1)) + :to-equal `(closed :from ,(ts-inc 'day 1 beg-of-today-ts) :to ,(ts-inc 'day 1 end-of-today-ts)))))) - (describe "(ts)" - (let ((beg-of-today-ts (->> (ts-now) - (ts-apply :hour 0 :minute 0 :second 0))) - (end-of-today-ts (->> (ts-now) - (ts-apply :hour 23 :minute 59 :second 59)))) - (it "with a number" - ;; NOTE: For consistency with the other ts-related predicates, a number argument means ":to NUMBER". - ;; MAYBE: Mention this in docs. Or remove this, because it's ambiguous. - (expect (org-ql--normalize-query '(ts 0)) - :to-equal `(ts :to ,end-of-today-ts)) - (expect (org-ql--normalize-query '(ts 0 :with-time t)) - :to-equal `(ts :to ,end-of-today-ts :with-time t)) - (expect (org-ql--normalize-query '(ts 0 :with-time nil)) - :to-equal `(ts :to ,end-of-today-ts :with-time nil)) - (expect (org-ql--normalize-query '(ts 1)) - :to-equal `(ts :to ,(ts-inc 'day 1 end-of-today-ts)))) - (it ":from/:to/:on" - (expect (org-ql--normalize-query '(ts :on today)) - :to-equal `(ts :from ,beg-of-today-ts :to ,end-of-today-ts)) - (expect (org-ql--normalize-query '(ts :on today :with-time t)) - :to-equal `(ts :from ,beg-of-today-ts :to ,end-of-today-ts - :with-time t)) - (expect (org-ql--normalize-query '(ts :on today :with-time nil)) - :to-equal `(ts :from ,beg-of-today-ts :to ,end-of-today-ts - :with-time nil)) - (expect (org-ql--normalize-query '(ts :on 0)) - :to-equal `(ts :from ,beg-of-today-ts :to ,end-of-today-ts)) - (expect (org-ql--normalize-query '(ts :on 0 :with-time t)) - :to-equal `(ts :from ,beg-of-today-ts :to ,end-of-today-ts - :with-time t)) - (expect (org-ql--normalize-query '(ts :on 1)) - :to-equal `(ts :from ,(ts-inc 'day 1 beg-of-today-ts) - :to ,(ts-inc 'day 1 end-of-today-ts))))))) - (describe "Plain strings" - (it "normalizes plain strings to the default predicate (using AND)" - (expect (org-ql--normalize-query '(and "string1" "string2")) - :to-equal '(and (regexp "string1") (regexp "string2")))) - (it "normalizes plain strings to the default predicate (using OR)" - (expect (org-ql--normalize-query '(or "string1" "string2")) - :to-equal '(or (regexp "string1") (regexp "string2")))) - (it "normalizes plain strings within sub-expressions to the default predicate" - (expect (org-ql--normalize-query '(and (todo "TODO") - (or "string1" "string2"))) - :to-equal '(and (todo "TODO") (or (regexp "string1") (regexp "string2")))) - (expect (org-ql--normalize-query '(when (todo "TODO") - (or "string1" "string2"))) - :to-equal '(when (todo "TODO") (or (regexp "string1") (regexp "string2")))) - (expect (org-ql--normalize-query '(when "string-cond1" - (or "string1" "string2"))) - :to-equal '(when (regexp "string-cond1") (or (regexp "string1") (regexp "string2")))) - (expect (org-ql--normalize-query '(when (and "string-cond1" "string-cond2") - (or "string1" "string2"))) - :to-equal '(when (and (regexp "string-cond1") (regexp "string-cond2")) (or (regexp "string1") (regexp "string2")))) - (expect (org-ql--normalize-query '(unless (and "stringcondition1" "stringcond2") - (or "string1" "string2"))) - :to-equal '(unless (and (regexp "stringcondition1") (regexp "stringcond2")) (or (regexp "string1") (regexp "string2")))))) + ;; NOTE: The rest of them do accept :with-time. + (describe "(deadline)" + (let ((beg-of-today-ts (->> (ts-now) + (ts-apply :hour 0 :minute 0 :second 0))) + (end-of-today-ts (->> (ts-now) + (ts-apply :hour 23 :minute 59 :second 59)))) + (it "with auto" + (let ((auto-ts (->> (ts-now) + (ts-adjust 'day org-deadline-warning-days) + (ts-apply :hour 23 :minute 59 :second 59)))) + (expect (org-ql--normalize-query '(deadline auto)) + :to-equal `(deadline-warning :to ,auto-ts)) + (expect (org-ql--normalize-query '(deadline auto :with-time t)) + :to-equal `(deadline-warning :to ,auto-ts :with-time t)) + (expect (org-ql--normalize-query '(deadline auto :with-time nil)) + :to-equal `(deadline-warning :to ,auto-ts :with-time nil)))) + (it "with a number" + (expect (org-ql--normalize-query '(deadline 0)) + :to-equal `(deadline :to ,end-of-today-ts)) + (expect (org-ql--normalize-query '(deadline 0 :with-time t)) + :to-equal `(deadline :to ,end-of-today-ts :with-time t)) + (expect (org-ql--normalize-query '(deadline 0 :with-time nil)) + :to-equal `(deadline :to ,end-of-today-ts :with-time nil)) + (expect (org-ql--normalize-query '(deadline 2)) + :to-equal `(deadline :to ,(ts-inc 'day 2 end-of-today-ts))) + (expect (org-ql--normalize-query '(deadline 2 :with-time nil)) + :to-equal `(deadline :to ,(ts-inc 'day 2 end-of-today-ts) + :with-time nil)) + (expect (org-ql--normalize-query '(deadline 2 :with-time t)) + :to-equal `(deadline :to ,(ts-inc 'day 2 end-of-today-ts) + :with-time t))) + (it ":from/:to/:on" + (expect (org-ql--normalize-query '(deadline :on today)) + :to-equal `(deadline :from ,beg-of-today-ts :to ,end-of-today-ts)) + (expect (org-ql--normalize-query '(deadline :on today :with-time t)) + :to-equal `(deadline :from ,beg-of-today-ts :to ,end-of-today-ts + :with-time t)) + (expect (org-ql--normalize-query '(deadline :on today :with-time nil)) + :to-equal `(deadline :from ,beg-of-today-ts :to ,end-of-today-ts + :with-time nil)) + (expect (org-ql--normalize-query '(deadline :on 0)) + :to-equal `(deadline :from ,beg-of-today-ts :to ,end-of-today-ts)) + (expect (org-ql--normalize-query '(deadline :on 0 :with-time t)) + :to-equal `(deadline :from ,beg-of-today-ts :to ,end-of-today-ts + :with-time t)) + (expect (org-ql--normalize-query '(deadline :on 1)) + :to-equal `(deadline :from ,(ts-inc 'day 1 beg-of-today-ts) + :to ,(ts-inc 'day 1 end-of-today-ts)))))) + (describe "(scheduled)" + (let ((beg-of-today-ts (->> (ts-now) + (ts-apply :hour 0 :minute 0 :second 0))) + (end-of-today-ts (->> (ts-now) + (ts-apply :hour 23 :minute 59 :second 59)))) + (it "with a number" + (expect (org-ql--normalize-query '(scheduled 0)) + :to-equal `(scheduled :from ,beg-of-today-ts :to ,end-of-today-ts)) + (expect (org-ql--normalize-query '(scheduled 0 :with-time t)) + :to-equal `(scheduled :from ,beg-of-today-ts :to ,end-of-today-ts + :with-time t)) + (expect (org-ql--normalize-query '(scheduled 0 :with-time nil)) + :to-equal `(scheduled :from ,beg-of-today-ts :to ,end-of-today-ts + :with-time nil)) + (expect (org-ql--normalize-query '(scheduled 1)) + :to-equal `(scheduled :from ,(ts-inc 'day 1 beg-of-today-ts) + :to ,(ts-inc 'day 1 end-of-today-ts)))) + (it ":from/:to/:on" + (expect (org-ql--normalize-query '(scheduled :on today)) + :to-equal `(scheduled :from ,beg-of-today-ts :to ,end-of-today-ts)) + (expect (org-ql--normalize-query '(scheduled :on today :with-time t)) + :to-equal `(scheduled :from ,beg-of-today-ts :to ,end-of-today-ts + :with-time t)) + (expect (org-ql--normalize-query '(scheduled :on today :with-time nil)) + :to-equal `(scheduled :from ,beg-of-today-ts :to ,end-of-today-ts + :with-time nil)) + (expect (org-ql--normalize-query '(scheduled :on 0)) + :to-equal `(scheduled :from ,beg-of-today-ts :to ,end-of-today-ts)) + (expect (org-ql--normalize-query '(scheduled :on 0 :with-time t)) + :to-equal `(scheduled :from ,beg-of-today-ts :to ,end-of-today-ts + :with-time t)) + (expect (org-ql--normalize-query '(scheduled :on 1)) + :to-equal `(scheduled :from ,(ts-inc 'day 1 beg-of-today-ts) + :to ,(ts-inc 'day 1 end-of-today-ts)))))) + (describe "(planning)" + (let ((beg-of-today-ts (->> (ts-now) + (ts-apply :hour 0 :minute 0 :second 0))) + (end-of-today-ts (->> (ts-now) + (ts-apply :hour 23 :minute 59 :second 59)))) + (it "with a number" + (expect (org-ql--normalize-query '(planning 0)) + :to-equal `(planning :to ,end-of-today-ts)) + (expect (org-ql--normalize-query '(planning 0 :with-time t)) + :to-equal `(planning :to ,end-of-today-ts :with-time t)) + (expect (org-ql--normalize-query '(planning 0 :with-time nil)) + :to-equal `(planning :to ,end-of-today-ts :with-time nil)) + (expect (org-ql--normalize-query '(planning 1)) + :to-equal `(planning :to ,(ts-inc 'day 1 end-of-today-ts)))) + (it ":from/:to/:on" + (expect (org-ql--normalize-query '(planning :on today)) + :to-equal `(planning :from ,beg-of-today-ts :to ,end-of-today-ts)) + (expect (org-ql--normalize-query '(planning :on today :with-time t)) + :to-equal `(planning :from ,beg-of-today-ts :to ,end-of-today-ts + :with-time t)) + (expect (org-ql--normalize-query '(planning :on today :with-time nil)) + :to-equal `(planning :from ,beg-of-today-ts :to ,end-of-today-ts + :with-time nil)) + (expect (org-ql--normalize-query '(planning :on 0)) + :to-equal `(planning :from ,beg-of-today-ts :to ,end-of-today-ts)) + (expect (org-ql--normalize-query '(planning :on 0 :with-time t)) + :to-equal `(planning :from ,beg-of-today-ts :to ,end-of-today-ts + :with-time t)) + (expect (org-ql--normalize-query '(planning :on 1)) + :to-equal `(planning :from ,(ts-inc 'day 1 beg-of-today-ts) + :to ,(ts-inc 'day 1 end-of-today-ts)))))) + (describe "(ts)" + (let ((beg-of-today-ts (->> (ts-now) + (ts-apply :hour 0 :minute 0 :second 0))) + (end-of-today-ts (->> (ts-now) + (ts-apply :hour 23 :minute 59 :second 59)))) + (it "with a number" + ;; NOTE: For consistency with the other ts-related predicates, a number argument means ":to NUMBER". + ;; MAYBE: Mention this in docs. Or remove this, because it's ambiguous. + (expect (org-ql--normalize-query '(ts 0)) + :to-equal `(ts :to ,end-of-today-ts)) + (expect (org-ql--normalize-query '(ts 0 :with-time t)) + :to-equal `(ts :to ,end-of-today-ts :with-time t)) + (expect (org-ql--normalize-query '(ts 0 :with-time nil)) + :to-equal `(ts :to ,end-of-today-ts :with-time nil)) + (expect (org-ql--normalize-query '(ts 1)) + :to-equal `(ts :to ,(ts-inc 'day 1 end-of-today-ts)))) + (it ":from/:to/:on" + (expect (org-ql--normalize-query '(ts :on today)) + :to-equal `(ts :from ,beg-of-today-ts :to ,end-of-today-ts)) + (expect (org-ql--normalize-query '(ts :on today :with-time t)) + :to-equal `(ts :from ,beg-of-today-ts :to ,end-of-today-ts + :with-time t)) + (expect (org-ql--normalize-query '(ts :on today :with-time nil)) + :to-equal `(ts :from ,beg-of-today-ts :to ,end-of-today-ts + :with-time nil)) + (expect (org-ql--normalize-query '(ts :on 0)) + :to-equal `(ts :from ,beg-of-today-ts :to ,end-of-today-ts)) + (expect (org-ql--normalize-query '(ts :on 0 :with-time t)) + :to-equal `(ts :from ,beg-of-today-ts :to ,end-of-today-ts + :with-time t)) + (expect (org-ql--normalize-query '(ts :on 1)) + :to-equal `(ts :from ,(ts-inc 'day 1 beg-of-today-ts) + :to ,(ts-inc 'day 1 end-of-today-ts))) - ;; FIXME: This test fails, but only on GitHub CI; it works fine - ;; locally. It seems to be something to do with Buttercup and - ;; comparing the structs. It only started happening after I moved - ;; the predicate argument processing into the newer - ;; --normalize-from-to-on macro. I can't explain why it works - ;; fine locally, even in a clean sandbox with newly installed - ;; packages, yet fails entirely on GitHub CI. The only - ;; possibility I can think of might be a difference in how the - ;; Emacs being installed into CI is built, but that seems very - ;; unlikely, so I don't know. For now, I have no alternative but - ;; to comment out the test. But it doesn't matter much, anyway, - ;; because I know it works properly. + ;; FIXME: This test fails, but only on GitHub CI; it works fine + ;; locally. It seems to be something to do with Buttercup and + ;; comparing the structs. It only started happening after I moved + ;; the predicate argument processing into the newer + ;; --normalize-from-to-on macro. I can't explain why it works + ;; fine locally, even in a clean sandbox with newly installed + ;; packages, yet fails entirely on GitHub CI. The only + ;; possibility I can think of might be a difference in how the + ;; Emacs being installed into CI is built, but that seems very + ;; unlikely, so I don't know. For now, I have no alternative but + ;; to comment out the test. But it doesn't matter much, anyway, + ;; because I know it works properly. - ;; (expect (org-ql--normalize-query '(or (ts-active :on "2019-01-01") - ;; (ts-a :on "2019-01-01") - ;; (ts-inactive :on "2019-01-01") - ;; (ts-i :on "2019-01-01"))) - ;; :to-equal `(or (ts :type active - ;; :from ,(make-ts :unix 1546322400.0) - ;; :to ,(make-ts :unix 1546408799.0)) - ;; (ts :type active - ;; :from ,(make-ts :unix 1546322400.0) - ;; :to ,(make-ts :unix 1546408799.0)) - ;; (ts :type inactive - ;; :from ,(make-ts :unix 1546322400.0) - ;; :to ,(make-ts :unix 1546408799.0)) - ;; (ts :type inactive - ;; :from ,(make-ts :unix 1546322400.0) - ;; :to ,(make-ts :unix 1546408799.0)))) - ) + ;; (expect (org-ql--normalize-query '(or (ts-active :on "2019-01-01") + ;; (ts-a :on "2019-01-01") + ;; (ts-inactive :on "2019-01-01") + ;; (ts-i :on "2019-01-01"))) + ;; :to-equal `(or (ts :type active + ;; :from ,(make-ts :unix 1546322400.0) + ;; :to ,(make-ts :unix 1546408799.0)) + ;; (ts :type active + ;; :from ,(make-ts :unix 1546322400.0) + ;; :to ,(make-ts :unix 1546408799.0)) + ;; (ts :type inactive + ;; :from ,(make-ts :unix 1546322400.0) + ;; :to ,(make-ts :unix 1546408799.0)) + ;; (ts :type inactive + ;; :from ,(make-ts :unix 1546322400.0) + ;; :to ,(make-ts :unix 1546408799.0))))) + ))))) - (describe "Query preambles" + (describe "Query preambles" - ;; TODO: Other predicates. + ;; TODO: Other predicates. - (describe "(clocked)" - (it "without arguments" - (expect (org-ql--query-preamble '(clocked)) - :to-equal (list :query t - :preamble org-ql-clock-regexp - :preamble-case-fold nil))) - (it "with a number of days" - (expect (org-ql--query-preamble '(clocked 1)) - :to-equal (list :query t - :preamble org-ql-clock-regexp - :preamble-case-fold nil))) - ;; TODO: Other arguments for (clocked). - ) + (describe "(rifle)" + (it "with one argument" + (expect (org-ql--query-preamble (org-ql--normalize-query '(rifle "foo."))) + :to-equal (list :query '(rifle :regexps '("foo\\.")) + :preamble "\\(?:\\<\\(?:foo\\.\\)\\)" + :preamble-case-fold t))) + (it "with two arguments" + (expect (org-ql--query-preamble (org-ql--normalize-query '(rifle "foo." "bar"))) + :to-equal (list :query '(rifle :regexps '("foo\\." "bar")) + :preamble "\\(?:\\<\\(?:foo\\.\\|bar\\)\\)" + :preamble-case-fold t)))) - (describe "(level)" - (it "with a number" - (expect (org-ql--query-preamble '(level 2)) - :to-equal (list :query t - :preamble (rx bol (repeat 2 "*") " ") - :preamble-case-fold t))) - (it "with two numbers" - (expect (org-ql--query-preamble '(level 2 4)) - :to-equal (list :query t - :preamble (rx bol (repeat 2 4 "*") " ") - :preamble-case-fold t))) - (it "<" - (expect (org-ql--query-preamble '(level < 3)) - :to-equal (list :query t - :preamble (rx bol (repeat 1 2 "*") " ") - :preamble-case-fold t))) - (it "<=" - (expect (org-ql--query-preamble '(level <= 2)) - :to-equal (list :query t - :preamble (rx bol (repeat 1 2 "*") " ") - :preamble-case-fold t))) - (it ">" - (expect (org-ql--query-preamble '(level > 2)) - :to-equal (list :query t - :preamble (rx bol (>= 3 "*") " ") - :preamble-case-fold t))) - (it ">=" - (expect (org-ql--query-preamble '(level >= 2)) - :to-equal (list :query t - :preamble (rx bol (>= 2 "*") " ") - :preamble-case-fold t))))) + (describe "(clocked)" + (it "without arguments" + (expect (org-ql--query-preamble '(clocked)) + :to-equal (list :query t + :preamble org-ql-clock-regexp + :preamble-case-fold nil))) + (it "with a number of days" + (expect (org-ql--query-preamble '(clocked 1)) + :to-equal (list :query t + :preamble org-ql-clock-regexp + :preamble-case-fold nil))) + ;; TODO: Other arguments for (clocked). + ) - (describe "Plain query parsing" + (describe "(level)" + (it "with a number" + (expect (org-ql--query-preamble '(level 2)) + :to-equal (list :query t + :preamble (rx bol (repeat 2 "*") " ") + :preamble-case-fold t))) + (it "with two numbers" + (expect (org-ql--query-preamble '(level 2 4)) + :to-equal (list :query t + :preamble (rx bol (repeat 2 4 "*") " ") + :preamble-case-fold t))) + (it "<" + (expect (org-ql--query-preamble '(level < 3)) + :to-equal (list :query t + :preamble (rx bol (repeat 1 2 "*") " ") + :preamble-case-fold t))) + (it "<=" + (expect (org-ql--query-preamble '(level <= 2)) + :to-equal (list :query t + :preamble (rx bol (repeat 1 2 "*") " ") + :preamble-case-fold t))) + (it ">" + (expect (org-ql--query-preamble '(level > 2)) + :to-equal (list :query t + :preamble (rx bol (>= 3 "*") " ") + :preamble-case-fold t))) + (it ">=" + (expect (org-ql--query-preamble '(level >= 2)) + :to-equal (list :query t + :preamble (rx bol (>= 2 "*") " ") + :preamble-case-fold t))))) - ;; TODO: Other predicates. + (describe "Plain query parsing" - (it "Negated terms" - (expect (org-ql--query-string-to-sexp "todo: !todo:CHECK,SOMEDAY") - :to-equal '(and (todo) (not (todo "CHECK" "SOMEDAY")))) - (expect (org-ql--query-string-to-sexp "!todo:CHECK,SOMEDAY todo:") - :to-equal '(and (not (todo "CHECK" "SOMEDAY")) (todo))) - (expect (org-ql--query-string-to-sexp "tags:universe !moon") - :to-equal '(and (tags "universe") (not (regexp "moon")))) - (expect (org-ql--query-string-to-sexp "!moon tags:universe") - :to-equal '(and (not (regexp "moon")) (tags "universe"))) - (expect (org-ql--query-string-to-sexp "mars !ts:on=today") - :to-equal '(and (regexp "mars") (not (ts :on "today")))) - (expect (org-ql--query-string-to-sexp "!\"quoted phrase\"") - :to-equal '(not (regexp "quoted phrase")))) - (it "Regexp predicates" - (expect (org-ql--query-string-to-sexp "scheduled") - ;; No colon after keyword, so not a predicate query. - :to-equal '(regexp "scheduled")) - (expect (org-ql--query-string-to-sexp "\"quoted phrase\"") - :to-equal '(regexp "quoted phrase")) - (expect (org-ql--query-string-to-sexp "regexp:word") - :to-equal '(regexp "word")) - (expect (org-ql--query-string-to-sexp "regexp:\"quoted phrase\"") - :to-equal '(regexp "quoted phrase"))) - (it "Timestamp-based predicates" - (expect (org-ql--query-string-to-sexp "scheduled:on=2017-07-07") - :to-equal '(scheduled :on "2017-07-07")) - (expect (org-ql--query-string-to-sexp "deadline:from=2017-07-07,to=2017-07-09") - :to-equal '(deadline :from "2017-07-07" :to "2017-07-09")) - (expect (org-ql--query-string-to-sexp "planning:from=2017-07-07") - :to-equal '(planning :from "2017-07-07")) - (expect (org-ql--query-string-to-sexp "closed:from=2017-07-07") - :to-equal '(closed :from "2017-07-07")) - (expect (org-ql--query-string-to-sexp "ts-active:to=2017-07-07") - :to-equal '(ts-active :to "2017-07-07")) - (expect (org-ql--query-string-to-sexp "ts-inactive:to=2017-07-07") - :to-equal '(ts-inactive :to "2017-07-07")) - (expect (org-ql--query-string-to-sexp "ts-a:to=2017-07-07") - :to-equal '(ts-a :to "2017-07-07")) - (expect (org-ql--query-string-to-sexp "ts-i:on=2017-07-07") - :to-equal '(ts-i :on "2017-07-07")) - (expect (org-ql--query-string-to-sexp "ts:") - :to-equal '(ts)) - (expect (org-ql--query-string-to-sexp "clocked:") - :to-equal '(clocked))) - (it "To-do predicates" - (expect (org-ql--query-string-to-sexp "todo:") - :to-equal '(todo)) - (expect (org-ql--query-string-to-sexp "todo:TODO") - :to-equal '(todo "TODO")) - (expect (org-ql--query-string-to-sexp "todo:TODO,SOMEDAY") - :to-equal '(todo "TODO" "SOMEDAY"))) - (it "Compound queries" - (expect (org-ql--query-string-to-sexp "todo:SOMEDAY ts-a:from=2020-01-01,to=2021-01-01") - :to-equal '(and (todo "SOMEDAY") (ts-a :from "2020-01-01" :to "2021-01-01"))) - (expect (org-ql--query-string-to-sexp "regexp:\"quoted phrase\" todo:SOMEDAY") - :to-equal '(and (regexp "quoted phrase") (todo "SOMEDAY"))))) + ;; TODO: Other predicates. - (describe "Convert sexp queries to non-sexp queries" + (it "Negated terms" + (expect (org-ql--query-string-to-sexp "todo: !todo:CHECK,SOMEDAY") + :to-equal '(and (todo) (not (todo "CHECK" "SOMEDAY")))) + (expect (org-ql--query-string-to-sexp "!todo:CHECK,SOMEDAY todo:") + :to-equal '(and (not (todo "CHECK" "SOMEDAY")) (todo))) + (expect (org-ql--query-string-to-sexp "tags:universe !moon") + :to-equal '(and (tags "universe") (not (rifle "moon")))) + (expect (org-ql--query-string-to-sexp "!moon tags:universe") + :to-equal '(and (not (rifle "moon")) (tags "universe"))) + (expect (org-ql--query-string-to-sexp "mars !ts:on=today") + :to-equal '(and (rifle "mars") (not (ts :on "today")))) + (expect (org-ql--query-string-to-sexp "!\"quoted phrase\"") + :to-equal '(not (rifle "quoted phrase")))) + (it "Regexp predicates" + (expect (org-ql--query-string-to-sexp "regexp:word") + :to-equal '(regexp "word")) + (expect (org-ql--query-string-to-sexp "regexp:\"quoted phrase\"") + :to-equal '(regexp "quoted phrase"))) + (it "Timestamp-based predicates" + (expect (org-ql--query-string-to-sexp "scheduled:on=2017-07-07") + :to-equal '(scheduled :on "2017-07-07")) + (expect (org-ql--query-string-to-sexp "deadline:from=2017-07-07,to=2017-07-09") + :to-equal '(deadline :from "2017-07-07" :to "2017-07-09")) + (expect (org-ql--query-string-to-sexp "planning:from=2017-07-07") + :to-equal '(planning :from "2017-07-07")) + (expect (org-ql--query-string-to-sexp "closed:from=2017-07-07") + :to-equal '(closed :from "2017-07-07")) + (expect (org-ql--query-string-to-sexp "ts-active:to=2017-07-07") + :to-equal '(ts-active :to "2017-07-07")) + (expect (org-ql--query-string-to-sexp "ts-inactive:to=2017-07-07") + :to-equal '(ts-inactive :to "2017-07-07")) + (expect (org-ql--query-string-to-sexp "ts-a:to=2017-07-07") + :to-equal '(ts-a :to "2017-07-07")) + (expect (org-ql--query-string-to-sexp "ts-i:on=2017-07-07") + :to-equal '(ts-i :on "2017-07-07")) + (expect (org-ql--query-string-to-sexp "ts:") + :to-equal '(ts)) + (expect (org-ql--query-string-to-sexp "clocked:") + :to-equal '(clocked))) + (it "To-do predicates" + (expect (org-ql--query-string-to-sexp "todo:") + :to-equal '(todo)) + (expect (org-ql--query-string-to-sexp "todo:TODO") + :to-equal '(todo "TODO")) + (expect (org-ql--query-string-to-sexp "todo:TODO,SOMEDAY") + :to-equal '(todo "TODO" "SOMEDAY"))) + (it "Compound queries" + (expect (org-ql--query-string-to-sexp "todo:SOMEDAY ts-a:from=2020-01-01,to=2021-01-01") + :to-equal '(and (todo "SOMEDAY") (ts-a :from "2020-01-01" :to "2021-01-01"))) + (expect (org-ql--query-string-to-sexp "regexp:\"quoted phrase\" todo:SOMEDAY") + :to-equal '(and (regexp "quoted phrase") (todo "SOMEDAY"))))) - ;; FIXME: Test (src) after converting it is implemented. - ;; (src :lang "elisp" :regexps ("defun")) + (describe "Convert sexp queries to non-sexp queries" - ;; MAYBE: Other predicates? Or should these cover the other - ;; cases, because the others use the same format? + ;; FIXME: Test (src) after converting it is implemented. + ;; (src :lang "elisp" :regexps ("defun")) - (it "(heading)" - (expect (org-ql--query-sexp-to-string '(heading "quoted phrase" "word")) - :to-equal "heading:word,\"quoted phrase\"")) - (it "(priority)" - (expect (org-ql--query-sexp-to-string '(priority >= B)) - :to-equal "priority:A,B") - (expect (org-ql--query-sexp-to-string '(priority > B)) - :to-equal "priority:A") - (expect (org-ql--query-sexp-to-string '(priority < B)) - :to-equal "priority:C") - (expect (org-ql--query-sexp-to-string '(priority < A)) - :to-equal "priority:B,C") - (expect (org-ql--query-sexp-to-string '(priority <= B)) - :to-equal "priority:B,C") - (expect (org-ql--query-sexp-to-string '(priority = A)) - :to-equal "priority:A")) - (it "(todo)" - (expect (org-ql--query-sexp-to-string '(todo)) - :to-equal "todo:") - (expect (org-ql--query-sexp-to-string '(todo "TODO")) - :to-equal "todo:TODO") - (expect (org-ql--query-sexp-to-string '(todo "TODO" "NEXT")) - :to-equal "todo:NEXT,TODO")) - (it "(ts)" - (expect (org-ql--query-sexp-to-string '(ts :from -1 :to 1)) - :to-equal "ts:from=-1,to=1") - (expect (org-ql--query-sexp-to-string '(ts :on today)) - :to-equal "ts:on=today") - (expect (org-ql--query-sexp-to-string '(ts-active :from "2017-01-01" :to "2018-01-01")) - :to-equal "ts-active:from=2017-01-01,to=2018-01-01")) - (it "(and ...)" - (expect (org-ql--query-sexp-to-string '(and (tags "book" "books") (priority "A"))) - :to-equal "tags:books,book priority:A") - (expect (org-ql--query-sexp-to-string '(and (tags "space") (not (regexp "moon")))) - :to-equal "tags:space !regexp:moon")) - (it "(or ...)" - (expect (org-ql--query-sexp-to-string '(or (tags "book" "books") (priority "A"))) - :to-equal nil))) + ;; MAYBE: Other predicates? Or should these cover the other + ;; cases, because the others use the same format? + + (it "(heading)" + (expect (org-ql--query-sexp-to-string '(heading "quoted phrase" "word")) + :to-equal "heading:word,\"quoted phrase\"")) + (it "(priority)" + (expect (org-ql--query-sexp-to-string '(priority >= B)) + :to-equal "priority:A,B") + (expect (org-ql--query-sexp-to-string '(priority > B)) + :to-equal "priority:A") + (expect (org-ql--query-sexp-to-string '(priority < B)) + :to-equal "priority:C") + (expect (org-ql--query-sexp-to-string '(priority < A)) + :to-equal "priority:B,C") + (expect (org-ql--query-sexp-to-string '(priority <= B)) + :to-equal "priority:B,C") + (expect (org-ql--query-sexp-to-string '(priority = A)) + :to-equal "priority:A")) + (it "(todo)" + (expect (org-ql--query-sexp-to-string '(todo)) + :to-equal "todo:") + (expect (org-ql--query-sexp-to-string '(todo "TODO")) + :to-equal "todo:TODO") + (expect (org-ql--query-sexp-to-string '(todo "TODO" "NEXT")) + :to-equal "todo:NEXT,TODO")) + (it "(ts)" + (expect (org-ql--query-sexp-to-string '(ts :from -1 :to 1)) + :to-equal "ts:from=-1,to=1") + (expect (org-ql--query-sexp-to-string '(ts :on today)) + :to-equal "ts:on=today") + (expect (org-ql--query-sexp-to-string '(ts-active :from "2017-01-01" :to "2018-01-01")) + :to-equal "ts-active:from=2017-01-01,to=2018-01-01")) + (it "(and ...)" + (expect (org-ql--query-sexp-to-string '(and (tags "book" "books") (priority "A"))) + :to-equal "tags:books,book priority:A") + (expect (org-ql--query-sexp-to-string '(and (tags "space") (not (regexp "moon")))) + :to-equal "tags:space !regexp:moon")) + (it "(or ...)" + (expect (org-ql--query-sexp-to-string '(or (tags "book" "books") (priority "A"))) + :to-equal nil)))) + + (describe "Query functions" + + (describe "org-ql-select" + (it "returns matching entries" + (expect (length (org-ql-select org-ql-test-buffer + '(category) + :sort 'deadline)) + :to-equal org-ql-test-num-headings))) + (describe "org-ql-query" + (it "returns matching entries" + (expect (length (org-ql-query :select 'element + :from org-ql-test-buffer + :where '(category) + :order-by 'date)) + :to-equal org-ql-test-num-headings)))) (describe "Query results" @@ -729,7 +810,7 @@ with keyword arg NOW in PLIST." (org-ql-expect ('(descendants (todo "CHECK"))) '("Recurring"))) (org-ql-it "with granddescendants query" - (org-ql-expect ('(descendants (descendants "moon"))) + (org-ql-expect ('(descendants (descendants (regexp "moon")))) '("Take over the universe"))) (org-ql-it "with query that should not match parent" ;; This test would fail if the `descendants' predicate did not properly exclude @@ -1176,6 +1257,7 @@ with keyword arg NOW in PLIST." (org-ql-it ">= a priority" (org-ql-expect ('(priority >= "B")) '("Take over the universe" "Take over the world" "Skype with president of Antarctica" "Take over Mars" "Renew membership in supervillain club" "Learn universal sign language" "Internet" "Spaceship lease" "Fix flux capacitor")))) + (describe "(property)" ;; MAYBE: Add support for (property) without arguments. @@ -1202,16 +1284,6 @@ with keyword arg NOW in PLIST." :sort 'todo) '("Take over the universe"))) - (org-ql-it "with a plain string" - (org-ql-expect ("Take over" - :sort 'todo) - '("Take over the universe" "Take over the world" "Take over Mars" "Take over the moon" "Get haircut"))) - - (org-ql-it "with two plain strings in an OR" - (org-ql-expect ('(or "Take over" "universe") - :sort 'todo) - '("Take over the universe" "Take over the world" "Take over Mars" "Take over the moon" "Get haircut"))) - (org-ql-it "case-folding predicate with non-case-folding preamble" ;; e.g. the (todo) predicate disables case-folding in its preamble, but that ;; should not prevent case-folding in this and other predicates (issue #114). @@ -1219,6 +1291,19 @@ with keyword arg NOW in PLIST." :sort 'todo) '("Take over the universe" "Take over the world" "Take over Mars" "Take over the moon" "Get haircut")))) + (describe "(rifle)" + (org-ql-it "with one argument" + (org-ql-expect ('(rifle "weekend")) + ;; In entry text. + '("Take over the world")) + (org-ql-expect ('(rifle "moon")) + ;; In outline path. + '("Take over the moon" "Visit the moon"))) + (org-ql-it "with two arguments" + (org-ql-expect ('(rifle "Take" "world")) + ;; In entry text (including tags) and/or outline path. + '("Take over the world" "Skype with president of Antarctica" "Get haircut")))) + (describe "(scheduled)" (org-ql-it "without arguments" From 1ddc5059772154c219a8890e903df6757c0afc10 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Fri, 10 Jun 2022 01:20:07 -0500 Subject: [PATCH 014/224] Change: Rename coalesce-multiple-calls to coalesce --- org-ql.el | 76 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 39 insertions(+), 37 deletions(-) diff --git a/org-ql.el b/org-ql.el index e89108e..3b832c6 100644 --- a/org-ql.el +++ b/org-ql.el @@ -735,7 +735,7 @@ be coalesced." (`(,(or 'or 'not) . ,_) (push (rec sexp) new-sexp)) (`(,predicate . ,args) - (pcase-exhaustive (plist-get (alist-get predicate org-ql-predicates) :coalesce-multiple-calls) + (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))) @@ -1089,7 +1089,7 @@ defined in `org-ql-predicates' by calling `org-ql-defpred'." ;; function still works. But to avoid the warning, we byte-compile it afterward. (byte-compile 'org-ql--query-preamble))) -(cl-defmacro org-ql-defpred (name args docstring &key body preambles normalizers coalesce-multiple-calls) +(cl-defmacro org-ql-defpred (name args docstring &key body preambles normalizers coalesce) "Define an `org-ql' selector predicate named `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 @@ -1143,21 +1143,23 @@ to variables bound in the pattern: query expression with no work to do, which improves performance. -When COALESCE-MULTIPLE-CALLS is t, multiple calls to this -predicate within a query clause may be combined into a single -call to this predicate (so it is expected that this predicate -treats multiple arguments as being boolean AND'ed together). +When COALESCE is t, multiple calls to this predicate within a +boolean AND query clause may be combined into a single call to +this predicate (so it is expected that this predicate treats +multiple arguments as being boolean AND'ed together; if it does +not, then it should not be set to coalesce). -This value may also be a function called to do coalescing of two -predicate expressions. It is called with two arguments: the list -of already-coalesced arguments to an expression, and the list of -arguments to the call being coalesced (note that a query's -arguments are normalized before the query is coalesced). If it -returns nil, the expression is not coalesced; otherwise, it +This argument may also be a function called to do coalescing of +two predicate expressions. It is called with two arguments: the +list of already-coalesced arguments to an expression, and the +list of arguments to the call being coalesced (note that a +query's arguments are normalized before the query is coalesced). +If it returns nil, the expression is not coalesced; otherwise, it should return a new list of arguments coalescing the given -arguments, with new arguments being first. (This is useful, -e.g. when a predicate takes keyword arguments, which means that -multiple calls to it can't be simply appended.) +arguments, with new arguments being first. (Using a +predicate-specific function to coalesce arguments is useful when, +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 @@ -1175,7 +1177,7 @@ It would be expanded to: ((`(,(or 'heading 'h) . ,args) `(heading ,@args)))" - ;; FIXME: Update defpred tutorial to include :coalesce-multiple-calls. + ;; FIXME: Update defpred tutorial to include :coalesce. ;; NOTE: The debug form works, completely! For example, use `edebug-defun' ;; on the `heading' predicate, then evaluate this form: @@ -1186,7 +1188,7 @@ It would be expanded to: ;; :normalized normalized ;; :preamble preamble)) (declare (debug ([&or symbolp listp] listp stringp - &rest [&or [":coalesce-multiple-calls" form] + &rest [&or [":coalesce" form] [":body" def-body] [":normalizers" (&rest (sexp def-body))] [":preambles" (&rest (sexp def-body))]])) @@ -1209,7 +1211,7 @@ It would be expanded to: (setf (alist-get ',predicate-name org-ql-predicates) `(:name ,',name :aliases ,',aliases :fn ,',fn-name :docstring ,(\, docstring) :args ,',args :normalizers ,',normalizers :preambles ,',preambles - :coalesce-multiple-calls ,,coalesce-multiple-calls)) + :coalesce ,,coalesce)) (unless org-ql-defpred-defer ;; Reversing preserves the order in which predicates were defined. (org-ql--define-normalize-query-fn (reverse org-ql-predicates)) @@ -1392,7 +1394,7 @@ Org effort string, like \"5\" or \"0:05\"." (org-ql-defpred (heading h) (&rest strings) "Return non-nil if current entry's heading matches all STRINGS. Matching is done case-insensitively." - :coalesce-multiple-calls t + :coalesce t :normalizers ((`(,predicate-names . ,args) ;; "h" alias. `(heading ,@args))) @@ -1419,7 +1421,7 @@ Matching is done case-insensitively." (org-ql-defpred (heading-regexp h*) (&rest regexps) "Return non-nil if current entry's heading matches all REGEXPS (regexp strings). Matching is done case-insensitively." - :coalesce-multiple-calls t + :coalesce t :normalizers ((`(,predicate-names . ,args) ;; "h" alias. `(heading-regexp ,@args))) @@ -1564,11 +1566,11 @@ intuitive, general-purpose predicate." ;; NOTE: This predicate advertises that it takes strings, but they ;; are normalized to regexps. Because of that, we must use a ;; coalescing function. - :coalesce-multiple-calls (lambda (coalesced-args current-args) - (setf (plist-get coalesced-args :regexps) - (list 'quote (append (cadr (plist-get coalesced-args :regexps)) - (cadr (plist-get current-args :regexps))))) - coalesced-args) + :coalesce (lambda (coalesced-args current-args) + (setf (plist-get coalesced-args :regexps) + (list 'quote (append (cadr (plist-get coalesced-args :regexps)) + (cadr (plist-get current-args :regexps))))) + coalesced-args) :normalizers ((`(,predicate-names . ,(and rest (guard (cl-every #'stringp rest)))) ;; If this doesn't match, it's already normalized. `(rifle :regexps ',(mapcar #'regexp-quote rest)))) @@ -1594,7 +1596,7 @@ the following queries: (olp \"Food\" \"Fruits\") (olp \"Fruits\" \"Grapes\") (olp \"Food\" \"Grapes\")" - :coalesce-multiple-calls t + :coalesce t :normalizers ((`(,predicate-names . ,strings) ;; Regexp quote headings. `(org-ql--predicate-outline-path ,@(mapcar #'regexp-quote strings)))) @@ -1750,7 +1752,7 @@ priority B)." (org-ql-defpred (regexp r) (&rest regexps) "Return non-nil if current entry matches all of REGEXPS (regexp strings)." - :coalesce-multiple-calls t + :coalesce t :normalizers ((`(,predicate-names . ,args) `(regexp ,@args))) ;; MAYBE: Separate case-sensitive (Regexp) predicate. @@ -1773,15 +1775,15 @@ priority B)." "Return non-nil if current entry contains an Org source block matching all of REGEXPS. If keyword argument LANG is non-nil, the block must be in that language." - :coalesce-multiple-calls (lambda (coalesced-args current-args) - (when (or (not coalesced-args) - (equal (plist-get current-args :lang) - (plist-get coalesced-args :lang))) - (setf (plist-get coalesced-args :regexps) - (append (plist-get coalesced-args :regexps) - (plist-get current-args :regexps)) - (plist-get coalesced-args :lang) (plist-get current-args :lang)) - coalesced-args)) + :coalesce (lambda (coalesced-args current-args) + (when (or (not coalesced-args) + (equal (plist-get current-args :lang) + (plist-get coalesced-args :lang))) + (setf (plist-get coalesced-args :regexps) + (append (plist-get coalesced-args :regexps) + (plist-get current-args :regexps)) + (plist-get coalesced-args :lang) (plist-get current-args :lang)) + coalesced-args)) :normalizers ((`(,predicate-names . ,args) ;; Rewrite to use keyword args. (cond ((cl-every #'stringp args) @@ -1847,7 +1849,7 @@ Tests both inherited and local tags." (org-ql-defpred (tags-all tags&) (&rest tags) "Return non-nil if current heading has all of TAGS (a list of strings). Tests both inherited and local tags." - :coalesce-multiple-calls t + :coalesce t ;; MAYBE: -all versions for inherited and local. :normalizers ((`(,predicate-names . ,tags) `(and ,@(--map `(tags ,it) tags)))) From ede1a6b10b6869d05bbe0be38017997c2a4ae48e Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sat, 11 Jun 2022 09:19:35 -0500 Subject: [PATCH 015/224] Change: Don't use (setf (plist-get ...)) That expansion is new in Emacs 28, which we don't yet target as the minimum version. --- org-ql.el | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/org-ql.el b/org-ql.el index 3b832c6..39e4215 100644 --- a/org-ql.el +++ b/org-ql.el @@ -1567,10 +1567,9 @@ intuitive, general-purpose predicate." ;; are normalized to regexps. Because of that, we must use a ;; coalescing function. :coalesce (lambda (coalesced-args current-args) - (setf (plist-get coalesced-args :regexps) - (list 'quote (append (cadr (plist-get coalesced-args :regexps)) - (cadr (plist-get current-args :regexps))))) - coalesced-args) + (plist-put coalesced-args :regexps + (list 'quote (append (cadr (plist-get coalesced-args :regexps)) + (cadr (plist-get current-args :regexps)))))) :normalizers ((`(,predicate-names . ,(and rest (guard (cl-every #'stringp rest)))) ;; If this doesn't match, it's already normalized. `(rifle :regexps ',(mapcar #'regexp-quote rest)))) @@ -1779,11 +1778,9 @@ language." (when (or (not coalesced-args) (equal (plist-get current-args :lang) (plist-get coalesced-args :lang))) - (setf (plist-get coalesced-args :regexps) - (append (plist-get coalesced-args :regexps) - (plist-get current-args :regexps)) - (plist-get coalesced-args :lang) (plist-get current-args :lang)) - coalesced-args)) + (plist-put coalesced-args :regexps (append (plist-get coalesced-args :regexps) + (plist-get current-args :regexps))) + (plist-put coalesced-args :lang (plist-get current-args :lang)))) :normalizers ((`(,predicate-names . ,args) ;; Rewrite to use keyword args. (cond ((cl-every #'stringp args) From 6e7371ce61198859b34e3b3468add59f284bf851 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sat, 11 Jun 2022 10:20:26 -0500 Subject: [PATCH 016/224] Add: (org-ql-find) Snippet functions The default is even more like org-rifle now. --- org-ql-find.el | 95 ++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 85 insertions(+), 10 deletions(-) diff --git a/org-ql-find.el b/org-ql-find.el index 20b6c57..69f0ad9 100644 --- a/org-ql-find.el +++ b/org-ql-find.el @@ -45,6 +45,40 @@ "Functions called when selecting an entry." :type 'hook) +(defcustom org-ql-find-snippet-function #'org-ql-find--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. + "Function used to annotate results in `org-ql-find'. +Function is called at entry beginning. (When set to +`org-ql-find--snippet-regexp', it is called with a regexp +matching plain query tokens.)" + :type '(choice (function-item :tag "Show context around search terms" org-ql-find--snippet-regexp) + (function-item :tag "Show first N characters" org-ql-find--snippet-simple) + (function :tag "Custom function"))) + +(defcustom org-ql-find-snippet-length 51 + "Size of snippets of entry content to include in `org-ql-find' annotations. +Only used when `org-ql-find-snippet-function' is set to +`org-ql-find--snippet-regexp'." + :type 'integer) + +(defcustom org-ql-find-snippet-minimum-token-length 3 + "Query tokens shorter than this many characters are ignored. +That is, they are not included when gathering entry snippets. +This avoids too-small tokens causing performance problems." + :type 'integer) + +(defcustom org-ql-find-snippet-prefix nil + "String prepended to snippets. +For an experience like `org-rifle', use a newline." + :type '(choice (const :tag "None (shown on same line)" nil) + (const :tag "New line (shown under heading)" "\n") + string)) + (defface org-ql-find-snippet '((t (:inherit font-lock-comment-face))) "Snippets.") @@ -81,7 +115,8 @@ single predicate)." ;; made possible by the example Clemens Radermacher shared at ;; . (let ((table (make-hash-table :test #'equal)) - (window-width (window-width))) + (window-width (window-width)) + query-tokens snippet-regexp) (cl-labels ((action () (font-lock-ensure (point-at-bol) (point-at-eol)) (let* ((path (thread-first (org-get-outline-path t t) @@ -106,17 +141,15 @@ single predicate)." "") collect (list completion todo-state snippet))) (annotate (candidate) - (or (snippet (gethash candidate table)) "")) + (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 (gethash candidate table)) ""))) (snippet (marker) (org-with-point-at marker - (org-end-of-meta-data t) - (unless (org-at-heading-p) - (let ((end (min (+ (point) 51) - (org-entry-end-position)))) - (truncate-string-to-width - (replace-regexp-in-string "\n" " " (buffer-substring (point) end) - t t) - 50 nil nil t))))) + (or (funcall org-ql-find-snippet-function snippet-regexp) + (org-ql-find--snippet-simple)))) (group (candidate transform) (pcase transform (`nil (buffer-name (marker-buffer (gethash candidate table)))) @@ -134,6 +167,21 @@ single predicate)." (`t (unless (string-empty-p str) (when query-filter (setf str (funcall query-filter str))) + (pcase org-ql-find-snippet-function + ('org-ql-find--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-find-snippet-minimum-token-length))) + (split-string str 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 (concat query-prefix str)) :action #'action)))))) (let* ((completion-styles '(org-ql-find)) @@ -181,6 +229,33 @@ multiple buffers to search with completion." (current-buffer)))) (org-ql-find buffers-files :prompt "Find outline path: " :query-prefix "outline-path:")) +(defun org-ql-find--snippet-simple (&optional _regexp) + "Return a snippet of the current entry. +Returns up to `org-ql-find-snippet-length' characters." + (org-end-of-meta-data t) + (unless (org-at-heading-p) + (let ((end (min (+ (point) org-ql-find-snippet-length) + (org-entry-end-position)))) + (concat org-ql-find-snippet-prefix + (truncate-string-to-width + (replace-regexp-in-string "\n" " " (buffer-substring (point) end) + t t) + 50 nil nil t))))) + +(defun org-ql-find--snippet-regexp (regexp) + "Return a snippet of the current entry's matches for REGEXP." + ;; REGEXP may be nil if there are no qualifying tokens in the query. + (when regexp + (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) + concat (match-string 0) concat "…" + do (goto-char (match-end 0))))) + (unless (string-empty-p snippets) + (concat org-ql-find-snippet-prefix + (replace-regexp-in-string (rx (1+ "\n")) " " snippets t t))))))) + (provide 'org-ql-find) ;;; org-ql-find.el ends here From 675d333b9162e83163b98f6b4240a5087c2e212a Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Mon, 29 Mar 2021 08:54:50 +0800 Subject: [PATCH 017/224] Use buffer-chars-modified-tick instead of buffer-modified-tick --- org-ql.el | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/org-ql.el b/org-ql.el index 39e4215..52c9b72 100644 --- a/org-ql.el +++ b/org-ql.el @@ -481,7 +481,7 @@ NARROW corresponds to the `org-ql-select' argument NARROW." (if-let* ((buffer-cache (gethash (current-buffer) org-ql-cache)) (query-cache (cadr buffer-cache)) (modified-tick (car buffer-cache)) - (buffer-unmodified-p (eq (buffer-modified-tick) modified-tick)) + (buffer-unmodified-p (eq (buffer-chars-modified-tick) modified-tick)) (cached-result (gethash query-cache-key query-cache))) (pcase cached-result ('org-ql-nil nil) @@ -490,7 +490,7 @@ NARROW corresponds to the `org-ql-select' argument NARROW." (cond ((or (not query-cache) (not buffer-unmodified-p)) (puthash (current-buffer) - (list (buffer-modified-tick) + (list (buffer-chars-modified-tick) (let ((table (make-hash-table :test 'org-ql-hash-test))) (puthash query-cache-key (or new-result 'org-ql-nil) table) table)) @@ -545,7 +545,7 @@ Returns cons (INHERITED-TAGS . LOCAL-TAGS)." (if-let* ((buffer-cache (gethash (current-buffer) org-ql-tags-cache)) (modified-tick (car buffer-cache)) (tags-cache (cdr buffer-cache)) - (buffer-unmodified-p (eq (buffer-modified-tick) modified-tick)) + (buffer-unmodified-p (eq (buffer-chars-modified-tick) modified-tick)) (cached-result (gethash position tags-cache))) ;; Found in cache: return them. ;; FIXME: Isn't `cached-result' a list of (INHERITED . LOCAL)? It @@ -586,12 +586,12 @@ Returns cons (INHERITED-TAGS . LOCAL-TAGS)." (setf buffer-cache (gethash (current-buffer) org-ql-tags-cache) modified-tick (car buffer-cache) tags-cache (cdr buffer-cache) - buffer-unmodified-p (eq (buffer-modified-tick) modified-tick)) + buffer-unmodified-p (eq (buffer-chars-modified-tick) modified-tick)) (unless (and buffer-cache buffer-unmodified-p) ;; Buffer-local tags cache empty or invalid: make new one. (setf tags-cache (make-hash-table)) (puthash (current-buffer) - (cons (buffer-modified-tick) tags-cache) + (cons (buffer-chars-modified-tick) tags-cache) org-ql-tags-cache)) (puthash position all-tags tags-cache)))) @@ -622,7 +622,7 @@ Values compared with `equal'." (pcase (if-let* ((buffer-cache (gethash (current-buffer) org-ql-node-value-cache)) (modified-tick (car buffer-cache)) (position-cache (cdr buffer-cache)) - (buffer-unmodified-p (eq (buffer-modified-tick) modified-tick)) + (buffer-unmodified-p (eq (buffer-chars-modified-tick) modified-tick)) (value-cache (gethash position position-cache)) (cached-value (alist-get fn value-cache nil nil #'equal))) ;; Found in cache: return it. @@ -637,13 +637,13 @@ Values compared with `equal'." position-cache (cdr buffer-cache) value-cache (when position-cache (gethash position position-cache)) - buffer-unmodified-p (eq (buffer-modified-tick) modified-tick)) + buffer-unmodified-p (eq (buffer-chars-modified-tick) modified-tick)) (unless (and buffer-cache buffer-unmodified-p) ;; Buffer-local node cache empty or invalid: make new one. (setf position-cache (make-hash-table) value-cache (gethash position position-cache)) (puthash (current-buffer) - (cons (buffer-modified-tick) position-cache) + (cons (buffer-chars-modified-tick) position-cache) org-ql-node-value-cache)) (setf (alist-get fn value-cache nil nil #'equal) new-value) (puthash position value-cache position-cache) From e22890ad04ea5fd43a5665835b16070b0330749d Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Mon, 13 Jun 2022 19:07:44 -0500 Subject: [PATCH 018/224] Docs: Update changelog --- README.org | 1 + org-ql.info | 58 +++++++++++++++++++++++++++-------------------------- 2 files changed, 31 insertions(+), 28 deletions(-) diff --git a/README.org b/README.org index b89765a..fe68a62 100644 --- a/README.org +++ b/README.org @@ -550,6 +550,7 @@ Simple links may also be written manually in either sexp or non-sexp form, like: *Internal* + Certain query predicates, when called multiple times in an ~and~ sub-expression, are optimized to a single call. ++ Use ~buffer-chars-modified-tick~ instead of ~buffer-modified-tick~. (Thanks to [[https://github.com/yantar92][Ihor Radchenko]].) ** 0.6.2 diff --git a/org-ql.info b/org-ql.info index 25ccf74..3a4c3c0 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1034,6 +1034,8 @@ File: README.info, Node: 07-pre, Next: 062, Up: Changelog *Internal* • Certain query predicates, when called multiple times in an ‘and’ sub-expression, are optimized to a single call. + • Use ‘buffer-chars-modified-tick’ instead of ‘buffer-modified-tick’. + (Thanks to Ihor Radchenko (https://github.com/yantar92).)  File: README.info, Node: 062, Next: 061, Prev: 07-pre, Up: Changelog @@ -1679,34 +1681,34 @@ Node: Links36761 Node: Tips37448 Node: Changelog37772 Node: 07-pre38540 -Node: 06239801 -Node: 06140109 -Node: 0640677 -Node: 05243731 -Node: 05144031 -Node: 0544454 -Node: 04945983 -Node: 04846263 -Node: 04746610 -Node: 04647019 -Node: 04547427 -Node: 04447788 -Node: 04348147 -Node: 04248350 -Node: 04148511 -Node: 0448758 -Node: 03252859 -Node: 03153262 -Node: 0353459 -Node: 02356759 -Node: 02256993 -Node: 02157273 -Node: 0257478 -Node: 0161556 -Node: Notes61657 -Node: Comparison with Org Agenda searches61819 -Node: org-sidebar62708 -Node: License62987 +Node: 06239947 +Node: 06140255 +Node: 0640823 +Node: 05243877 +Node: 05144177 +Node: 0544600 +Node: 04946129 +Node: 04846409 +Node: 04746756 +Node: 04647165 +Node: 04547573 +Node: 04447934 +Node: 04348293 +Node: 04248496 +Node: 04148657 +Node: 0448904 +Node: 03253005 +Node: 03153408 +Node: 0353605 +Node: 02356905 +Node: 02257139 +Node: 02157419 +Node: 0257624 +Node: 0161702 +Node: Notes61803 +Node: Comparison with Org Agenda searches61965 +Node: org-sidebar62854 +Node: License63133  End Tag Table From 5768c685adc7c6e85c17cfec358aa8a0e368310b Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sat, 25 Jun 2022 10:53:29 -0500 Subject: [PATCH 019/224] Remove: org-ql-find-heading, org-ql-find-path These are virtually obsolete with the introduction of the "rifle" predicate as the default one. Having them now is just confusing. --- README.org | 2 -- org-ql-find.el | 32 -------------------------------- 2 files changed, 34 deletions(-) diff --git a/README.org b/README.org index fe68a62..05b4bfc 100644 --- a/README.org +++ b/README.org @@ -112,8 +112,6 @@ 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 all entry content. -- ~org-ql-find-path~ searches only headings (using the ~outline-path:~ predicate). -- ~org-ql-find-heading~ searches only headings (using the ~heading:~ predicate). [[images/org-ql-find.png]] diff --git a/org-ql-find.el b/org-ql-find.el index 69f0ad9..bc92277 100644 --- a/org-ql-find.el +++ b/org-ql-find.el @@ -194,40 +194,8 @@ single predicate)." (run-hook-with-args 'org-ql-find-goto-hook)))))) ;;;###autoload -(defun org-ql-find-heading (buffers-files) - "Go to an Org entry in BUFFERS-FILES selected by searching with `org-ql'. -Only headings are searched (using the \"heading:\" predicate). -Interactively, with universal prefix, select multiple buffers to -search with completion." - (interactive - (list (if current-prefix-arg - (mapcar #'get-buffer - (completing-read-multiple - "Buffers: " - (mapcar #'buffer-name - (cl-remove-if-not (lambda (buffer) - (eq 'org-mode (buffer-local-value 'major-mode buffer))) - (buffer-list))) nil t)) - (current-buffer)))) - (org-ql-find buffers-files :prompt "Find heading: " :query-prefix "heading:")) ;;;###autoload -(defun org-ql-find-path (buffers-files) - "Go to an Org entry in BUFFERS-FILES selected by searching with `org-ql'. -Only outline paths are searched (using the \"outline-path:\" -predicate). Interactively, with universal prefix, select -multiple buffers to search with completion." - (interactive - (list (if current-prefix-arg - (mapcar #'get-buffer - (completing-read-multiple - "Buffers: " - (mapcar #'buffer-name - (cl-remove-if-not (lambda (buffer) - (eq 'org-mode (buffer-local-value 'major-mode buffer))) - (buffer-list))) nil t)) - (current-buffer)))) - (org-ql-find buffers-files :prompt "Find outline path: " :query-prefix "outline-path:")) (defun org-ql-find--snippet-simple (&optional _regexp) "Return a snippet of the current entry. From bbd164c6aeb7dcf2a1ae8c80fd1dc09963f60221 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sat, 25 Jun 2022 10:54:38 -0500 Subject: [PATCH 020/224] Change/Fix: (org-ql-select) Warn instead of erroring on bad files This helps prevent unexpected errors from making it impossible to search, and displaying the messages in the warnings buffer makes them more noticeable and readable for the user. --- org-ql.el | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/org-ql.el b/org-ql.el index 52c9b72..3747950 100644 --- a/org-ql.el +++ b/org-ql.el @@ -362,18 +362,18 @@ each priority the newest items would appear first." (function (funcall buffers-or-files)) (list buffers-or-files) (otherwise (list buffers-or-files))) - (--map (cl-etypecase it - ;; NOTE: This etypecase is essential to opening links safely, - ;; as it rejects, e.g. lambdas in the buffers-files argument. - (buffer it) - (string (or (find-buffer-visiting it) - (when (file-readable-p it) - ;; It feels unintuitive that `find-file-noselect' returns - ;; a buffer if the filename doesn't exist. - (find-file-noselect it)) - (user-error "Can't open file: %s" it))))) - ;; Ignore special/hidden buffers. - (--remove (string-prefix-p " " (buffer-name it))))) + (--map (cl-etypecase it + ;; NOTE: This etypecase is essential to opening links safely, + ;; as it rejects, e.g. lambdas in the buffers-files argument. + (buffer it) + (string (or (find-buffer-visiting it) + (when (file-readable-p it) + ;; It feels unintuitive that `find-file-noselect' returns + ;; a buffer if the filename doesn't exist. + (find-file-noselect it)) + (display-warning 'org-ql-select (format "Can't open file: %s" it) :error))))) + ;; Ignore special/hidden buffers. + (--remove (string-prefix-p " " (buffer-name it))))) (query (org-ql--normalize-query query)) ((&plist :query :preamble :preamble-case-fold) (org-ql--query-preamble query)) (predicate (org-ql--query-predicate query)) @@ -409,12 +409,12 @@ each priority the newest items would appear first." (fset name fn))) ;; Run query on buffers. (->> buffers - (--map (with-current-buffer it - (unless (derived-mode-p 'org-mode) - (user-error "Not an Org buffer: %s" (buffer-name))) - (org-ql--select-cached :query query :preamble preamble :preamble-case-fold preamble-case-fold - :predicate predicate :action action :narrow narrow))) - (-flatten-n 1))) + (--map (with-current-buffer it + (unless (derived-mode-p 'org-mode) + (display-warning 'org-ql-select (format "Not an Org buffer: %s" (buffer-name)) :error)) + (org-ql--select-cached :query query :preamble preamble :preamble-case-fold preamble-case-fold + :predicate predicate :action action :narrow narrow))) + (-flatten-n 1))) (--each orig-fns ;; Restore original function mappings. (-let (((&plist :name :fn) it)) From dc02c59cada45759f096eed8010449767ee49fcd Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sat, 25 Jun 2022 10:56:18 -0500 Subject: [PATCH 021/224] Add: (org-ql--ensure-buffer) And use in org-ql-find. This seems to solve a problem I've been noticing in helm-org-ql for a long time: that it can apparently interrupt Org's initialization code, which can leave buffers unprepared for Org, even stuck in fundamental-mode. This should also be used in helm-org-ql... --- org-ql-find.el | 13 +++++++++++++ org-ql.el | 14 ++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/org-ql-find.el b/org-ql-find.el index bc92277..6a4e7c1 100644 --- a/org-ql-find.el +++ b/org-ql-find.el @@ -184,6 +184,19 @@ single predicate)." (optional (repeat 1 3 (0+ space) (repeat 1 15 (not space)))))))))) (org-ql-select buffers-files (org-ql--query-string-to-sexp (concat query-prefix str)) :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'. + (mapc #'org-ql--ensure-buffer buffers-files) (let* ((completion-styles '(org-ql-find)) (completion-styles-alist (list (list 'org-ql-find #'try #'all "Org QL Find"))) (selected (completing-read prompt #'collection nil)) diff --git a/org-ql.el b/org-ql.el index 3747950..0cf6c8a 100644 --- a/org-ql.el +++ b/org-ql.el @@ -535,6 +535,20 @@ If NARROW is non-nil, buffer will not be widened." ;;;;; Helpers +(defun org-ql--ensure-buffer (file-or-buffer) + "Ensure a buffer is named or visiting FILE-OR-BUFFER. +If no such buffer exists with the name, and it is the name of a +readable file, `find-file-noselect' it into a buffer." + ;; See comment in `org-ql-find'. + ;; FIXME: Use this in `helm-org-ql' the same way it's used in + ;; `org-ql-find'. + (unless (or (get-buffer file-or-buffer) + (find-buffer-visiting file-or-buffer)) + (if (file-readable-p file-or-buffer) + (with-current-buffer (find-file-noselect file-or-buffer) + (cl-assert (eq 'org-mode major-mode) nil (format "Not an Org buffer: %S" file-or-buffer))) + (display-warning 'org-ql (format "Not a readable file: %S" file-or-buffer) :error)))) + (defun org-ql--tags-at (position) ;; FIXME: This function actually assumes that point is already at POSITION. "Return tags for POSITION in current buffer. From 5f058b9eee0ff36c33b47c25d94de7b4c5cbf0c4 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sat, 25 Jun 2022 10:58:17 -0500 Subject: [PATCH 022/224] Add: (org-ql-find-in-agenda, org-ql-find-in-org-directory) --- README.org | 18 ++++--- org-ql-find.el | 9 ++++ org-ql.info | 132 +++++++++++++++++++++++-------------------------- 3 files changed, 81 insertions(+), 78 deletions(-) diff --git a/README.org b/README.org index 05b4bfc..10d6e07 100644 --- a/README.org +++ b/README.org @@ -95,15 +95,15 @@ Lisp code examples are in [[examples.org]]. :END: + *Jumping to an entry:* - - [[#org-ql-find][org-ql-find]] (command) - - [[#helm-org-ql][helm-org-ql]] (command) + - [[#org-ql-find][org-ql-find]] and related commands + - [[#helm-org-ql][helm-org-ql]] + *Showing an agenda-like view:* - - [[#org-ql-search][org-ql-search]] (command) - - [[#org-ql-view][org-ql-view]] (command) - - [[#org-ql-view-sidebar][org-ql-view-sidebar]] (command) - - [[#org-ql-view-recent-items][org-ql-view-recent-items]] (command) + - [[#org-ql-search][org-ql-search]] + - [[#org-ql-view][org-ql-view]] + - [[#org-ql-view-sidebar][org-ql-view-sidebar]] + - [[#org-ql-view-recent-items][org-ql-view-recent-items]] + *Showing a tree in a buffer:* - - [[#org-ql-sparse-tree][org-ql-sparse-tree]] (command) + - [[#org-ql-sparse-tree][org-ql-sparse-tree]] *** org-ql-find @@ -111,7 +111,9 @@ 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 all entry content. +- ~org-ql-find~ searches in the current buffer. +- ~org-ql-find-in-agenda~ searches in ~(org-agenda-files)~. +- ~org-ql-find-in-org-directory~ searches in ~org-directory~. [[images/org-ql-find.png]] diff --git a/org-ql-find.el b/org-ql-find.el index 6a4e7c1..5c3acee 100644 --- a/org-ql-find.el +++ b/org-ql-find.el @@ -30,6 +30,7 @@ (require 'org) (require 'org-ql) +(require 'org-ql-search) ;;;; Customization @@ -207,8 +208,16 @@ single predicate)." (run-hook-with-args 'org-ql-find-goto-hook)))))) ;;;###autoload +(defun org-ql-find-in-agenda () + "Call `org-ql-find' on `org-agenda-files'." + (interactive) + (org-ql-find (org-agenda-files))) ;;;###autoload +(defun org-ql-find-in-org-directory () + "Call `org-ql-find' on files in `org-directory'." + (interactive) + (org-ql-find (org-ql-search-directories-files))) (defun org-ql-find--snippet-simple (&optional _regexp) "Return a snippet of the current entry. diff --git a/org-ql.info b/org-ql.info index 3a4c3c0..cfb9896 100644 --- a/org-ql.info +++ b/org-ql.info @@ -194,16 +194,10 @@ File: README.info, Node: Commands, Next: Queries, Up: Usage ============ • *Jumping to an entry:* - • (command) - • (command) - • *Showing an agenda-like view:* - • (command) - • (command) - • (command) - • (command) - • *Showing a tree in a buffer:* - • (command) - + • and related commands + • • *Showing an agenda-like view:* + • • • • • *Showing a tree in a buffer:* + • * Menu: * org-ql-find:: @@ -225,11 +219,9 @@ _Note: These commands use ._ These commands jump to a heading selected using Emacs’s built-in completion facilities with an Org QL query: - • ‘org-ql-find’ searches all entry content. - • ‘org-ql-find-path’ searches only headings (using the - ‘outline-path:’ predicate). - • ‘org-ql-find-heading’ searches only headings (using the ‘heading:’ - predicate). + • ‘org-ql-find’ searches in the current buffer. + • ‘org-ql-find-in-agenda’ searches in ‘(org-agenda-files)’. + • ‘org-ql-find-in-org-directory’ searches in ‘org-directory’.  File: README.info, Node: org-ql-search, Next: helm-org-ql, Prev: org-ql-find, Up: Commands @@ -1654,61 +1646,61 @@ Node: Quelpa2519 Node: Helm support3047 Node: Usage3450 Node: Commands3848 -Node: org-ql-find4353 -Node: org-ql-search4867 -Node: helm-org-ql6561 -Node: org-ql-view6939 -Node: org-ql-view-sidebar7469 -Node: org-ql-view-recent-items7849 -Node: org-ql-sparse-tree8345 -Node: Queries9145 -Node: Non-sexp query syntax10262 -Node: General predicates12021 -Node: Ancestor/descendant predicates18763 -Node: Date/time predicates19891 -Node: Functions / Macros23015 -Node: Agenda-like views23313 -Ref: Function ‘org-ql-block’23475 -Node: Listing / acting-on results24736 -Ref: Caching24944 -Ref: Function ‘org-ql-select’25857 -Ref: Function ‘org-ql-query’28283 -Ref: Macro ‘org-ql’ (deprecated)30057 -Node: Custom predicates30372 -Ref: Macro ‘org-ql-defpred’30596 -Node: Dynamic block34037 -Node: Links36761 -Node: Tips37448 -Node: Changelog37772 -Node: 07-pre38540 -Node: 06239947 -Node: 06140255 -Node: 0640823 -Node: 05243877 -Node: 05144177 -Node: 0544600 -Node: 04946129 -Node: 04846409 -Node: 04746756 -Node: 04647165 -Node: 04547573 -Node: 04447934 -Node: 04348293 -Node: 04248496 -Node: 04148657 -Node: 0448904 -Node: 03253005 -Node: 03153408 -Node: 0353605 -Node: 02356905 -Node: 02257139 -Node: 02157419 -Node: 0257624 -Node: 0161702 -Node: Notes61803 -Node: Comparison with Org Agenda searches61965 -Node: org-sidebar62854 -Node: License63133 +Node: org-ql-find4274 +Node: org-ql-search4740 +Node: helm-org-ql6434 +Node: org-ql-view6812 +Node: org-ql-view-sidebar7342 +Node: org-ql-view-recent-items7722 +Node: org-ql-sparse-tree8218 +Node: Queries9018 +Node: Non-sexp query syntax10135 +Node: General predicates11894 +Node: Ancestor/descendant predicates18636 +Node: Date/time predicates19764 +Node: Functions / Macros22888 +Node: Agenda-like views23186 +Ref: Function ‘org-ql-block’23348 +Node: Listing / acting-on results24609 +Ref: Caching24817 +Ref: Function ‘org-ql-select’25730 +Ref: Function ‘org-ql-query’28156 +Ref: Macro ‘org-ql’ (deprecated)29930 +Node: Custom predicates30245 +Ref: Macro ‘org-ql-defpred’30469 +Node: Dynamic block33910 +Node: Links36634 +Node: Tips37321 +Node: Changelog37645 +Node: 07-pre38413 +Node: 06239820 +Node: 06140128 +Node: 0640696 +Node: 05243750 +Node: 05144050 +Node: 0544473 +Node: 04946002 +Node: 04846282 +Node: 04746629 +Node: 04647038 +Node: 04547446 +Node: 04447807 +Node: 04348166 +Node: 04248369 +Node: 04148530 +Node: 0448777 +Node: 03252878 +Node: 03153281 +Node: 0353478 +Node: 02356778 +Node: 02257012 +Node: 02157292 +Node: 0257497 +Node: 0161575 +Node: Notes61676 +Node: Comparison with Org Agenda searches61838 +Node: org-sidebar62727 +Node: License63006  End Tag Table From 77916a1c4f6dd45737db66756e17ea1c6bda0368 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sat, 25 Jun 2022 10:58:33 -0500 Subject: [PATCH 023/224] Tidy: Indentation --- org-ql-find.el | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/org-ql-find.el b/org-ql-find.el index 5c3acee..bc1d492 100644 --- a/org-ql-find.el +++ b/org-ql-find.el @@ -175,14 +175,15 @@ single predicate)." (--select (not (or (string-match-p (rx bos (1+ (not (any ":"))) ":") it) (< (length it) org-ql-find-snippet-minimum-token-length))) (split-string str 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)))))))))) + 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 (concat query-prefix str)) :action #'action)))))) ;; NOTE: It seems that the `completing-read' machinery can call, From c2b8af3181c6f1048f189b4d3d0958a73de52ed7 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sun, 26 Jun 2022 22:55:20 -0500 Subject: [PATCH 024/224] Fix: (org-ql-find) Always map across a list --- org-ql-find.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/org-ql-find.el b/org-ql-find.el index bc1d492..080bb12 100644 --- a/org-ql-find.el +++ b/org-ql-find.el @@ -198,6 +198,9 @@ single predicate)." ;; 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'. + (unless (listp buffers-files) + ;; Since we map across this argument, we ensure it's a list. + (setf buffers-files (list buffers-files))) (mapc #'org-ql--ensure-buffer buffers-files) (let* ((completion-styles '(org-ql-find)) (completion-styles-alist (list (list 'org-ql-find #'try #'all "Org QL Find"))) From d46e69b0fc71566f848faf9eee5fad88bfc6fda5 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 14 Jul 2022 12:52:44 -0500 Subject: [PATCH 025/224] Fix: (org-ql-find) Always include query-prefix Thanks to Thomas Bergheim (@bergheim) for his help! --- org-ql-find.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/org-ql-find.el b/org-ql-find.el index 080bb12..69994f2 100644 --- a/org-ql-find.el +++ b/org-ql-find.el @@ -160,6 +160,8 @@ single predicate)." (all (string table pred _point) (all-completions string table pred)) (collection (str _pred flag) + (when query-prefix + (setf str (concat query-prefix str))) (pcase flag ('metadata (list 'metadata (cons 'group-function #'group) @@ -184,7 +186,7 @@ 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)))))))))) - (org-ql-select buffers-files (org-ql--query-string-to-sexp (concat query-prefix str)) + (org-ql-select buffers-files (org-ql--query-string-to-sexp str) :action #'action)))))) ;; NOTE: It seems that the `completing-read' machinery can call, ;; abort, and re-call the collection function while the user is From a986e360c336f076e4051668ecb120ddf0e06e62 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 14 Jul 2022 13:05:42 -0500 Subject: [PATCH 026/224] Fix: (org-ql-find) Select buffer Thanks again to Thomas Bergheim (@bergheim). --- org-ql-find.el | 1 + 1 file changed, 1 insertion(+) diff --git a/org-ql-find.el b/org-ql-find.el index 69994f2..04b06ad 100644 --- a/org-ql-find.el +++ b/org-ql-find.el @@ -211,6 +211,7 @@ single predicate)." (with-current-buffer (marker-buffer marker) (goto-char marker) (display-buffer (current-buffer)) + (select-window (get-buffer-window (current-buffer))) (run-hook-with-args 'org-ql-find-goto-hook)))))) ;;;###autoload From 98b6049eccc4f3b19700d27a86f22d4428013501 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Fri, 15 Jul 2022 13:49:52 -0500 Subject: [PATCH 027/224] Fix: (org-ql-find) Check major mode See https://github.com/alphapapa/org-ql/issues/284#issuecomment-1185367899. --- org-ql-find.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/org-ql-find.el b/org-ql-find.el index 04b06ad..4f8e981 100644 --- a/org-ql-find.el +++ b/org-ql-find.el @@ -110,7 +110,10 @@ single predicate)." (cl-remove-if-not (lambda (buffer) (eq 'org-mode (buffer-local-value 'major-mode buffer))) (buffer-list))) nil t)) - (current-buffer)))) + (progn + (unless (eq major-mode 'org-mode) + (user-error "This is not an Org buffer: %S" (current-buffer))) + (current-buffer))))) ;; Emacs's completion API is not always easy to understand, ;; especially when using "programmed completion." This code was ;; made possible by the example Clemens Radermacher shared at From a02ed48ac81583300747e91c0a964abbb590ef43 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Mon, 18 Jul 2022 10:57:50 -0500 Subject: [PATCH 028/224] Change: (org-ql-find) Add workaround for Ivy support See . --- org-ql-find.el | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/org-ql-find.el b/org-ql-find.el index 4f8e981..8630f72 100644 --- a/org-ql-find.el +++ b/org-ql-find.el @@ -83,6 +83,12 @@ For an experience like `org-rifle', use a newline." (defface org-ql-find-snippet '((t (:inherit font-lock-comment-face))) "Snippets.") +;;;; Variables + +;; TODO: When Ivy no longer requires this workaround, remove it. See +;; . +(defvar ivy-completing-read-dynamic-collection) + ;;;; Functions ;;;###autoload @@ -209,6 +215,10 @@ single predicate)." (mapc #'org-ql--ensure-buffer buffers-files) (let* ((completion-styles '(org-ql-find)) (completion-styles-alist (list (list 'org-ql-find #'try #'all "Org QL Find"))) + ;; TODO: When Ivy no longer requires this workaround, + ;; remove it and the corresponding defvar. See + ;; . + (ivy-completing-read-dynamic-collection t) (selected (completing-read prompt #'collection nil)) (marker (gethash selected table))) (with-current-buffer (marker-buffer marker) From 06f1e1be6ff5ef7e2c8c05dc1954bcedcbb6eb0b Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Mon, 18 Jul 2022 13:44:25 -0500 Subject: [PATCH 029/224] Revert "Change: (org-ql-find) Add workaround for Ivy support" This reverts commit a02ed48ac81583300747e91c0a964abbb590ef43. See . --- org-ql-find.el | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/org-ql-find.el b/org-ql-find.el index 8630f72..4f8e981 100644 --- a/org-ql-find.el +++ b/org-ql-find.el @@ -83,12 +83,6 @@ For an experience like `org-rifle', use a newline." (defface org-ql-find-snippet '((t (:inherit font-lock-comment-face))) "Snippets.") -;;;; Variables - -;; TODO: When Ivy no longer requires this workaround, remove it. See -;; . -(defvar ivy-completing-read-dynamic-collection) - ;;;; Functions ;;;###autoload @@ -215,10 +209,6 @@ single predicate)." (mapc #'org-ql--ensure-buffer buffers-files) (let* ((completion-styles '(org-ql-find)) (completion-styles-alist (list (list 'org-ql-find #'try #'all "Org QL Find"))) - ;; TODO: When Ivy no longer requires this workaround, - ;; remove it and the corresponding defvar. See - ;; . - (ivy-completing-read-dynamic-collection t) (selected (completing-read prompt #'collection nil)) (marker (gethash selected table))) (with-current-buffer (marker-buffer marker) From 6257ae83044aa9fcd5c2ddffbd2f73f2b235f905 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Mon, 15 Aug 2022 16:16:55 -0500 Subject: [PATCH 030/224] Fix: (org-ql-find--snippet-*) Use save-excursion --- org-ql-find.el | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/org-ql-find.el b/org-ql-find.el index 4f8e981..143a861 100644 --- a/org-ql-find.el +++ b/org-ql-find.el @@ -232,29 +232,31 @@ single predicate)." (defun org-ql-find--snippet-simple (&optional _regexp) "Return a snippet of the current entry. Returns up to `org-ql-find-snippet-length' characters." - (org-end-of-meta-data t) - (unless (org-at-heading-p) - (let ((end (min (+ (point) org-ql-find-snippet-length) - (org-entry-end-position)))) - (concat org-ql-find-snippet-prefix - (truncate-string-to-width - (replace-regexp-in-string "\n" " " (buffer-substring (point) end) - t t) - 50 nil nil t))))) + (save-excursion + (org-end-of-meta-data t) + (unless (org-at-heading-p) + (let ((end (min (+ (point) org-ql-find-snippet-length) + (org-entry-end-position)))) + (concat org-ql-find-snippet-prefix + (truncate-string-to-width + (replace-regexp-in-string "\n" " " (buffer-substring (point) end) + t t) + 50 nil nil t)))))) (defun org-ql-find--snippet-regexp (regexp) "Return a snippet of the current entry's matches for REGEXP." ;; REGEXP may be nil if there are no qualifying tokens in the query. (when regexp - (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) - concat (match-string 0) concat "…" - do (goto-char (match-end 0))))) - (unless (string-empty-p snippets) - (concat org-ql-find-snippet-prefix - (replace-regexp-in-string (rx (1+ "\n")) " " snippets t t))))))) + (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) + concat (match-string 0) concat "…" + do (goto-char (match-end 0))))) + (unless (string-empty-p snippets) + (concat org-ql-find-snippet-prefix + (replace-regexp-in-string (rx (1+ "\n")) " " snippets t t)))))))) (provide 'org-ql-find) From 18869c47fffe196621fd4c0fea7c56de1f3511c8 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Fri, 19 Aug 2022 03:14:46 -0500 Subject: [PATCH 031/224] Tidy: Headers --- org-ql.el | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/org-ql.el b/org-ql.el index 0cf6c8a..d4dbff9 100644 --- a/org-ql.el +++ b/org-ql.el @@ -1,19 +1,13 @@ ;;; org-ql.el --- Org Query Language, search command, and agenda-like view -*- lexical-binding: t; -*- +;; Copyright (C) 2017-2022 Adam Porter + ;; Author: Adam Porter ;; Url: https://github.com/alphapapa/org-ql ;; Version: 0.7-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") (s "1.12.0") (transient "0.1") (ts "0.2-pre")) ;; Keywords: hypermedia, outlines, Org, agenda -;;; Commentary: - -;; `org-ql' is a lispy query language for Org files. It allows you to -;; find Org entries matching certain criteria and return a list of -;; them or perform actions on them. Commands are also provided which -;; display a buffer with matching results, similar to an Org Agenda -;; buffer. - ;;; License: ;; This program is free software; you can redistribute it and/or modify @@ -29,6 +23,14 @@ ;; You should have received a copy of the GNU General Public License ;; along with this program. If not, see . +;;; Commentary: + +;; `org-ql' is a Lispy query language for Org files. It allows you to +;; find Org entries matching certain criteria and return a list of +;; them or perform actions on them. Commands are also provided which +;; display a buffer with matching results, similar to an Org Agenda +;; buffer. + ;;; Code: ;;;; Requirements From cfa3b307ecb9d461745882ac756ca05c3de9519e Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Fri, 19 Aug 2022 03:17:18 -0500 Subject: [PATCH 032/224] Add/Change: org-ql-completing-read, etc. --- org-ql-completing-read.el | 227 ++++++++++++++++++++++++++++++++++++++ org-ql-find.el | 190 +++---------------------------- 2 files changed, 241 insertions(+), 176 deletions(-) create mode 100644 org-ql-completing-read.el diff --git a/org-ql-completing-read.el b/org-ql-completing-read.el new file mode 100644 index 0000000..81d8557 --- /dev/null +++ b/org-ql-completing-read.el @@ -0,0 +1,227 @@ +;;; org-ql-completing-read.el --- Completing read of Org entries using org-ql -*- lexical-binding: t; -*- + +;; Copyright (C) 2022 Adam Porter + +;; Author: Adam Porter + +;; 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 +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; This library provides completing-read of Org entries using `org-ql' +;; search. + +;;; Code: + +(require 'org-ql) + +;;;; Customization + +(defgroup org-ql-completing-read nil + "Completing-read of Org entries using `org-ql' search." + :group 'org-ql) + +(defcustom org-ql-completing-read-reverse-paths t + "Whether to reverse Org outline paths in `org-ql-completing-read' results." + :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. + "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 +regexp matching plain query tokens.)" + :type '(choice (function-item :tag "Show context around search terms" org-ql-completing-read--snippet-regexp) + (function-item :tag "Show first N characters" org-ql-completing-read--snippet-simple) + (function :tag "Custom function"))) + +(defcustom org-ql-completing-read-snippet-length 51 + "Size of snippets of entry content to include in completion annotations. +Only used when `org-ql-completing-read-snippet-function' is set +to `org-ql-completing-read--snippet-regexp'." + :type 'integer) + +(defcustom org-ql-completing-read-snippet-minimum-token-length 3 + "Query tokens shorter than this many characters are ignored. +That is, they are not included when gathering entry snippets. +This avoids too-small tokens causing performance problems." + :type 'integer) + +(defcustom org-ql-completing-read-snippet-prefix nil + "String prepended to snippets. +For an experience like `org-rifle', use a newline." + :type '(choice (const :tag "None (shown on same line)" nil) + (const :tag "New line (shown under heading)" "\n") + string)) + +(defface org-ql-completing-read-snippet '((t (:inherit font-lock-comment-face))) + "Snippets.") + +;;;; Functions + +;;;;; Completing read + +;;;###autoload +(cl-defun org-ql-completing-read (buffers-files &key query-prefix query-filter + (prompt "Find entry: ")) + "Return marker at Org entry in BUFFERS-FILES selected with `org-ql'. + +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 +it). + +QUERY-FILTER may be a function through which the query the user +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)." + (declare (indent defun)) + ;; Emacs's completion API is not always easy to understand, + ;; especially when using "programmed completion." This code was + ;; made possible by the example Clemens Radermacher shared at + ;; . + (let ((table (make-hash-table :test #'equal)) + (window-width (window-width)) + query-tokens snippet-regexp) + (cl-labels ((action + () (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)) + (affix (completions) + (cl-loop for completion in completions + for marker = (gethash completion table) + for todo-state = (if-let (it (org-entry-get marker "TODO")) + (concat (propertize it + 'face (org-get-todo-face it)) + " ") + "") + for snippet = (if-let (it (snippet marker)) + (propertize (concat " " it) + 'face 'org-ql-completing-read-snippet) + "") + collect (list completion todo-state snippet))) + (annotate (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 (gethash candidate table)) ""))) + (snippet (marker) + (org-with-point-at marker + (or (funcall org-ql-completing-read-snippet-function snippet-regexp) + (org-ql-completing-read--snippet-simple)))) + (group (candidate transform) + (pcase transform + (`nil (buffer-name (marker-buffer (gethash candidate table)))) + (_ candidate))) + (try (string _table _pred point &optional _metadata) + (cons string point)) + (all (string table pred _point) + (all-completions string table pred)) + (collection (str _pred flag) + (when query-prefix + (setf str (concat query-prefix str))) + (pcase flag + ('metadata (list 'metadata + (cons 'group-function #'group) + (cons 'affixation-function #'affix) + (cons 'annotation-function #'annotate))) + (`t (unless (string-empty-p str) + (when query-filter + (setf str (funcall query-filter str))) + (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 str 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 str) + :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'. + (unless (listp buffers-files) + ;; Since we map across this argument, we ensure it's a list. + (setf buffers-files (list buffers-files))) + (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))) + (gethash selected table))))) + +(defun org-ql-completing-read--snippet-simple (&optional _regexp) + "Return a snippet of the current entry. +Returns up to `org-ql-completing-read-snippet-length' characters." + (save-excursion + (org-end-of-meta-data t) + (unless (org-at-heading-p) + (let ((end (min (+ (point) org-ql-completing-read-snippet-length) + (org-entry-end-position)))) + (concat org-ql-completing-read-snippet-prefix + (truncate-string-to-width + (replace-regexp-in-string "\n" " " (buffer-substring (point) end) + 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." + ;; REGEXP may be nil if there are no qualifying tokens in the query. + (when 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) + concat (match-string 0) concat "…" + do (goto-char (match-end 0))))) + (unless (string-empty-p snippets) + (concat org-ql-completing-read-snippet-prefix + (replace-regexp-in-string (rx (1+ "\n")) " " snippets t t)))))))) + +;;;; Footer + +(provide 'org-ql-completing-read) + +;;; org-ql-completing-read.el ends here diff --git a/org-ql-find.el b/org-ql-find.el index 143a861..a85b937 100644 --- a/org-ql-find.el +++ b/org-ql-find.el @@ -31,6 +31,7 @@ (require 'org) (require 'org-ql) (require 'org-ql-search) +(require 'org-ql-completing-read) ;;;; Customization @@ -38,51 +39,10 @@ "Options for `org-ql-find'." :group 'org-ql) -(defcustom org-ql-find-reverse-paths t - "Whether to reverse Org outline paths in `org-ql-find' results." - :type 'boolean) - (defcustom org-ql-find-goto-hook '(org-show-entry) "Functions called when selecting an entry." :type 'hook) -(defcustom org-ql-find-snippet-function #'org-ql-find--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. - "Function used to annotate results in `org-ql-find'. -Function is called at entry beginning. (When set to -`org-ql-find--snippet-regexp', it is called with a regexp -matching plain query tokens.)" - :type '(choice (function-item :tag "Show context around search terms" org-ql-find--snippet-regexp) - (function-item :tag "Show first N characters" org-ql-find--snippet-simple) - (function :tag "Custom function"))) - -(defcustom org-ql-find-snippet-length 51 - "Size of snippets of entry content to include in `org-ql-find' annotations. -Only used when `org-ql-find-snippet-function' is set to -`org-ql-find--snippet-regexp'." - :type 'integer) - -(defcustom org-ql-find-snippet-minimum-token-length 3 - "Query tokens shorter than this many characters are ignored. -That is, they are not included when gathering entry snippets. -This avoids too-small tokens causing performance problems." - :type 'integer) - -(defcustom org-ql-find-snippet-prefix nil - "String prepended to snippets. -For an experience like `org-rifle', use a newline." - :type '(choice (const :tag "None (shown on same line)" nil) - (const :tag "New line (shown under heading)" "\n") - string)) - -(defface org-ql-find-snippet '((t (:inherit font-lock-comment-face))) - "Snippets.") - ;;;; Functions ;;;###autoload @@ -106,116 +66,23 @@ single predicate)." (mapcar #'get-buffer (completing-read-multiple "Buffers: " - (mapcar #'buffer-name - (cl-remove-if-not (lambda (buffer) - (eq 'org-mode (buffer-local-value 'major-mode buffer))) - (buffer-list))) nil t)) + (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))))) - ;; Emacs's completion API is not always easy to understand, - ;; especially when using "programmed completion." This code was - ;; made possible by the example Clemens Radermacher shared at - ;; . - (let ((table (make-hash-table :test #'equal)) - (window-width (window-width)) - query-tokens snippet-regexp) - (cl-labels ((action - () (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-find-reverse-paths - (string-join (nreverse path) "\\") - (string-join path "/")))) - (puthash path (point-marker) table) - path)) - (affix (completions) - (cl-loop for completion in completions - for marker = (gethash completion table) - for todo-state = (if-let (it (org-entry-get marker "TODO")) - (concat (propertize it - 'face (org-get-todo-face it)) - " ") - "") - for snippet = (if-let (it (snippet marker)) - (propertize (concat " " it) - 'face 'org-ql-find-snippet) - "") - collect (list completion todo-state snippet))) - (annotate (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 (gethash candidate table)) ""))) - (snippet (marker) - (org-with-point-at marker - (or (funcall org-ql-find-snippet-function snippet-regexp) - (org-ql-find--snippet-simple)))) - (group (candidate transform) - (pcase transform - (`nil (buffer-name (marker-buffer (gethash candidate table)))) - (_ candidate))) - (try (string _table _pred point &optional _metadata) - (cons string point)) - (all (string table pred _point) - (all-completions string table pred)) - (collection (str _pred flag) - (when query-prefix - (setf str (concat query-prefix str))) - (pcase flag - ('metadata (list 'metadata - (cons 'group-function #'group) - (cons 'affixation-function #'affix) - (cons 'annotation-function #'annotate))) - (`t (unless (string-empty-p str) - (when query-filter - (setf str (funcall query-filter str))) - (pcase org-ql-find-snippet-function - ('org-ql-find--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-find-snippet-minimum-token-length))) - (split-string str 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 str) - :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'. - (unless (listp buffers-files) - ;; Since we map across this argument, we ensure it's a list. - (setf buffers-files (list buffers-files))) - (mapc #'org-ql--ensure-buffer buffers-files) - (let* ((completion-styles '(org-ql-find)) - (completion-styles-alist (list (list 'org-ql-find #'try #'all "Org QL Find"))) - (selected (completing-read prompt #'collection nil)) - (marker (gethash selected table))) - (with-current-buffer (marker-buffer marker) - (goto-char marker) - (display-buffer (current-buffer)) - (select-window (get-buffer-window (current-buffer))) - (run-hook-with-args 'org-ql-find-goto-hook)))))) + (let ((marker (org-ql-completing-read buffers-files + :query-prefix query-prefix + :query-filter query-filter + :prompt prompt))) + (with-current-buffer (marker-buffer marker) + (goto-char marker) + (display-buffer (current-buffer)) + (select-window (get-buffer-window (current-buffer))) + (run-hook-with-args 'org-ql-find-goto-hook)))) ;;;###autoload (defun org-ql-find-in-agenda () @@ -229,35 +96,6 @@ single predicate)." (interactive) (org-ql-find (org-ql-search-directories-files))) -(defun org-ql-find--snippet-simple (&optional _regexp) - "Return a snippet of the current entry. -Returns up to `org-ql-find-snippet-length' characters." - (save-excursion - (org-end-of-meta-data t) - (unless (org-at-heading-p) - (let ((end (min (+ (point) org-ql-find-snippet-length) - (org-entry-end-position)))) - (concat org-ql-find-snippet-prefix - (truncate-string-to-width - (replace-regexp-in-string "\n" " " (buffer-substring (point) end) - t t) - 50 nil nil t)))))) - -(defun org-ql-find--snippet-regexp (regexp) - "Return a snippet of the current entry's matches for REGEXP." - ;; REGEXP may be nil if there are no qualifying tokens in the query. - (when 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) - concat (match-string 0) concat "…" - do (goto-char (match-end 0))))) - (unless (string-empty-p snippets) - (concat org-ql-find-snippet-prefix - (replace-regexp-in-string (rx (1+ "\n")) " " snippets t t)))))))) - (provide 'org-ql-find) ;;; org-ql-find.el ends here From 7f4faff27bf68d05262a92607cca58f27ebb258d Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Fri, 19 Aug 2022 03:18:14 -0500 Subject: [PATCH 033/224] Add: (org-ql-refile) --- README.org | 5 ++ org-ql-find.el | 29 +++++++++ org-ql.info | 155 +++++++++++++++++++++++++++---------------------- 3 files changed, 119 insertions(+), 70 deletions(-) diff --git a/README.org b/README.org index 10d6e07..9c9d734 100644 --- a/README.org +++ b/README.org @@ -117,6 +117,10 @@ These commands jump to a heading selected using Emacs's built-in completion faci [[images/org-ql-find.png]] +*** 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. + *** org-ql-search /Note: This command supports both sexp queries and [[#non-sexp-query-syntax][non-sexp queries]]./ @@ -542,6 +546,7 @@ Simple links may also be written manually in either sexp or non-sexp form, like: *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-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). diff --git a/org-ql-find.el b/org-ql-find.el index a85b937..5a482f7 100644 --- a/org-ql-find.el +++ b/org-ql-find.el @@ -84,6 +84,35 @@ single predicate)." (select-window (get-buffer-window (current-buffer))) (run-hook-with-args 'org-ql-find-goto-hook)))) +;;;###autoload +(defun org-ql-refile (marker) + "Refile current entry to MARKER (interactively, one selected with `org-ql'). +Interactive completion uses files listed in `org-refile-targets', +which see (but only the files are used)." + (interactive (let ((buffers-files (delete-dups + ;; Always include the current buffer. + (cons (current-buffer) + (cl-loop for (files-spec . _candidate-spec) in org-refile-targets + append (cl-typecase files-spec + (null (list (current-buffer))) + (symbol (pcase (funcall files-spec) + ((and (pred stringp) file) (list file)) + ((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))) + ;;;###autoload (defun org-ql-find-in-agenda () "Call `org-ql-find' on `org-agenda-files'." diff --git a/org-ql.info b/org-ql.info index cfb9896..96fb8e4 100644 --- a/org-ql.info +++ b/org-ql.info @@ -48,6 +48,7 @@ Usage Commands * org-ql-find:: +* org-ql-refile:: * org-ql-search:: * helm-org-ql:: * org-ql-view:: @@ -201,6 +202,7 @@ File: README.info, Node: Commands, Next: Queries, Up: Usage * Menu: * org-ql-find:: +* org-ql-refile:: * org-ql-search:: * helm-org-ql:: * org-ql-view:: @@ -209,7 +211,7 @@ File: README.info, Node: Commands, Next: Queries, Up: Usage * org-ql-sparse-tree::  -File: README.info, Node: org-ql-find, Next: org-ql-search, Up: Commands +File: README.info, Node: org-ql-find, Next: org-ql-refile, Up: Commands 4.1.1 org-ql-find ----------------- @@ -224,9 +226,19 @@ completion facilities with an Org QL query: • ‘org-ql-find-in-org-directory’ searches in ‘org-directory’.  -File: README.info, Node: org-ql-search, Next: helm-org-ql, Prev: org-ql-find, Up: Commands +File: README.info, Node: org-ql-refile, Next: org-ql-search, Prev: org-ql-find, Up: Commands -4.1.2 org-ql-search +4.1.2 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. + + +File: README.info, Node: org-ql-search, Next: helm-org-ql, Prev: org-ql-refile, Up: Commands + +4.1.3 org-ql-search ------------------- _Note: This command supports both sexp queries and ._ @@ -269,7 +281,7 @@ text properties are placed on each item, imitating an Agenda buffer.)  File: README.info, Node: helm-org-ql, Next: org-ql-view, Prev: org-ql-search, Up: Commands -4.1.3 helm-org-ql +4.1.4 helm-org-ql ----------------- _Note: This command uses . It is available separately in the package @@ -283,7 +295,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.4 org-ql-view +4.1.5 org-ql-view ----------------- Choose and display a view stored in ‘org-ql-views’. @@ -298,7 +310,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.5 org-ql-view-sidebar +4.1.6 org-ql-view-sidebar ------------------------- Show a sidebar window listing views stored in ‘org-ql-views’ for easy @@ -308,7 +320,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.6 org-ql-view-recent-items +4.1.7 org-ql-view-recent-items ------------------------------ Show items in ‘FILES’ from last ‘DAYS’ days with timestamps of ‘TYPE’. @@ -319,7 +331,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.7 org-ql-sparse-tree +4.1.8 org-ql-sparse-tree ------------------------ Arguments: ‘(query &key keep-previous (buffer (current-buffer)))’ @@ -1009,6 +1021,8 @@ File: README.info, Node: 07-pre, Next: 062, Up: Changelog ‘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-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 @@ -1639,68 +1653,69 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1764 -Node: Screenshots1887 -Node: Installation2005 -Node: Quelpa2519 -Node: Helm support3047 -Node: Usage3450 -Node: Commands3848 -Node: org-ql-find4274 -Node: org-ql-search4740 -Node: helm-org-ql6434 -Node: org-ql-view6812 -Node: org-ql-view-sidebar7342 -Node: org-ql-view-recent-items7722 -Node: org-ql-sparse-tree8218 -Node: Queries9018 -Node: Non-sexp query syntax10135 -Node: General predicates11894 -Node: Ancestor/descendant predicates18636 -Node: Date/time predicates19764 -Node: Functions / Macros22888 -Node: Agenda-like views23186 -Ref: Function ‘org-ql-block’23348 -Node: Listing / acting-on results24609 -Ref: Caching24817 -Ref: Function ‘org-ql-select’25730 -Ref: Function ‘org-ql-query’28156 -Ref: Macro ‘org-ql’ (deprecated)29930 -Node: Custom predicates30245 -Ref: Macro ‘org-ql-defpred’30469 -Node: Dynamic block33910 -Node: Links36634 -Node: Tips37321 -Node: Changelog37645 -Node: 07-pre38413 -Node: 06239820 -Node: 06140128 -Node: 0640696 -Node: 05243750 -Node: 05144050 -Node: 0544473 -Node: 04946002 -Node: 04846282 -Node: 04746629 -Node: 04647038 -Node: 04547446 -Node: 04447807 -Node: 04348166 -Node: 04248369 -Node: 04148530 -Node: 0448777 -Node: 03252878 -Node: 03153281 -Node: 0353478 -Node: 02356778 -Node: 02257012 -Node: 02157292 -Node: 0257497 -Node: 0161575 -Node: Notes61676 -Node: Comparison with Org Agenda searches61838 -Node: org-sidebar62727 -Node: License63006 +Node: Contents1782 +Node: Screenshots1905 +Node: Installation2023 +Node: Quelpa2537 +Node: Helm support3065 +Node: Usage3468 +Node: Commands3866 +Node: org-ql-find4310 +Node: org-ql-refile4776 +Node: org-ql-search5099 +Node: helm-org-ql6795 +Node: org-ql-view7173 +Node: org-ql-view-sidebar7703 +Node: org-ql-view-recent-items8083 +Node: org-ql-sparse-tree8579 +Node: Queries9379 +Node: Non-sexp query syntax10496 +Node: General predicates12255 +Node: Ancestor/descendant predicates18997 +Node: Date/time predicates20125 +Node: Functions / Macros23249 +Node: Agenda-like views23547 +Ref: Function ‘org-ql-block’23709 +Node: Listing / acting-on results24970 +Ref: Caching25178 +Ref: Function ‘org-ql-select’26091 +Ref: Function ‘org-ql-query’28517 +Ref: Macro ‘org-ql’ (deprecated)30291 +Node: Custom predicates30606 +Ref: Macro ‘org-ql-defpred’30830 +Node: Dynamic block34271 +Node: Links36995 +Node: Tips37682 +Node: Changelog38006 +Node: 07-pre38774 +Node: 06240296 +Node: 06140604 +Node: 0641172 +Node: 05244226 +Node: 05144526 +Node: 0544949 +Node: 04946478 +Node: 04846758 +Node: 04747105 +Node: 04647514 +Node: 04547922 +Node: 04448283 +Node: 04348642 +Node: 04248845 +Node: 04149006 +Node: 0449253 +Node: 03253354 +Node: 03153757 +Node: 0353954 +Node: 02357254 +Node: 02257488 +Node: 02157768 +Node: 0257973 +Node: 0162051 +Node: Notes62152 +Node: Comparison with Org Agenda searches62314 +Node: org-sidebar63203 +Node: License63482  End Tag Table From d7ada532c7d06e91d6e07800ca22d5fbdb970e3e Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Fri, 19 Aug 2022 03:38:43 -0500 Subject: [PATCH 034/224] Add: Alias "c" to (category) --- README.org | 1 + org-ql.el | 2 +- org-ql.info | 57 +++++++++++++++++++++++++++-------------------------- 3 files changed, 31 insertions(+), 29 deletions(-) diff --git a/README.org b/README.org index 9c9d734..3ee3c48 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: + 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). ++ Alias ~c~ for predicate ~category~. *Changed* + Give more useful error message for invalid queries. diff --git a/org-ql.el b/org-ql.el index d4dbff9..5b804ba 100644 --- a/org-ql.el +++ b/org-ql.el @@ -1318,7 +1318,7 @@ result form." ;; redefinitions until all of the predicates have been defined. (setf org-ql-defpred-defer t) -(org-ql-defpred category (&rest categories) +(org-ql-defpred (category c) (&rest categories) "Return non-nil if current heading is in one or more of CATEGORIES (a list of strings)." :body (when-let ((category (org-get-category (point)))) (cl-typecase categories diff --git a/org-ql.info b/org-ql.info index 96fb8e4..e191c28 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1033,6 +1033,7 @@ File: README.info, Node: 07-pre, Next: 062, Up: Changelog • Option ‘org-ql-default-predicate’, applied to plain-string query tokens (before, the ‘regexp’ predicate was always used, but now it may be customized). + • Alias ‘c’ for predicate ‘category’. *Changed* • Give more useful error message for invalid queries. @@ -1688,34 +1689,34 @@ Node: Links36995 Node: Tips37682 Node: Changelog38006 Node: 07-pre38774 -Node: 06240296 -Node: 06140604 -Node: 0641172 -Node: 05244226 -Node: 05144526 -Node: 0544949 -Node: 04946478 -Node: 04846758 -Node: 04747105 -Node: 04647514 -Node: 04547922 -Node: 04448283 -Node: 04348642 -Node: 04248845 -Node: 04149006 -Node: 0449253 -Node: 03253354 -Node: 03153757 -Node: 0353954 -Node: 02357254 -Node: 02257488 -Node: 02157768 -Node: 0257973 -Node: 0162051 -Node: Notes62152 -Node: Comparison with Org Agenda searches62314 -Node: org-sidebar63203 -Node: License63482 +Node: 06240347 +Node: 06140655 +Node: 0641223 +Node: 05244277 +Node: 05144577 +Node: 0545000 +Node: 04946529 +Node: 04846809 +Node: 04747156 +Node: 04647565 +Node: 04547973 +Node: 04448334 +Node: 04348693 +Node: 04248896 +Node: 04149057 +Node: 0449304 +Node: 03253405 +Node: 03153808 +Node: 0354005 +Node: 02357305 +Node: 02257539 +Node: 02157819 +Node: 0258024 +Node: 0162102 +Node: Notes62203 +Node: Comparison with Org Agenda searches62365 +Node: org-sidebar63254 +Node: License63533  End Tag Table From e41cdb45912f1731b5b060f9e05d011096663655 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 25 Aug 2022 16:55:58 -0500 Subject: [PATCH 035/224] Change: (org-ql-find-goto-hook) Add org-reveal Showing the context is much better for the user. --- org-ql-find.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org-ql-find.el b/org-ql-find.el index 5a482f7..0208a45 100644 --- a/org-ql-find.el +++ b/org-ql-find.el @@ -39,7 +39,7 @@ "Options for `org-ql-find'." :group 'org-ql) -(defcustom org-ql-find-goto-hook '(org-show-entry) +(defcustom org-ql-find-goto-hook '(org-show-entry org-reveal) "Functions called when selecting an entry." :type 'hook) From e54ba0102c69273183a5ffafafe878f820ab9e5f Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Fri, 7 Oct 2022 18:33:35 -0500 Subject: [PATCH 036/224] Add: (property) :inherit argument --- README.org | 3 +- org-ql.el | 50 ++++++++++++++++++------- org-ql.info | 105 +++++++++++++++++++++++++++------------------------- 3 files changed, 94 insertions(+), 64 deletions(-) diff --git a/README.org b/README.org index 3ee3c48..7ccf544 100644 --- a/README.org +++ b/README.org @@ -237,7 +237,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)= :: Return non-nil if current entry has ~PROPERTY~ (a string), and optionally ~VALUE~ (a string). Note that property inheritance is currently /not/ enabled for this predicate. If you need to test with inheritance, you could use a custom predicate form, like ~(org-entry-get (point) "PROPERTY" 'inherit)~. ++ =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). + =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. @@ -550,6 +550,7 @@ Simple links may also be written manually in either sexp or non-sexp form, like: + 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). + Alias ~c~ for predicate ~category~. ++ Predicate ~property~ now accepts the argument ~:inherit~ to match entries with property inheritance, and when unspecified, the option ~org-use-property-inheritance~ controls whether inheritance is used. *Changed* + Give more useful error message for invalid queries. diff --git a/org-ql.el b/org-ql.el index 5b804ba..c4c1eaf 100644 --- a/org-ql.el +++ b/org-ql.el @@ -1729,30 +1729,43 @@ priority B)." (cl-loop for priority-arg in args thereis (= item-priority (* 1000 (- org-lowest-priority (string-to-char priority-arg))))))))) -(org-ql-defpred property (property &optional value) - "Return non-nil if current entry has PROPERTY (a string), and optionally VALUE (a string)." - :normalizers ((`(,predicate-names ,property . ,value) +(org-ql-defpred 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)." + :normalizers ((`(,predicate-names ,property ,value . ,plist) ;; 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))) - (cons 'property (cons property value)))) + (list 'property property value + :inherit (if (plist-member plist :inherit) + (plist-get plist :inherit) + org-use-property-inheritance)))) ;; MAYBE: Should case folding be disabled for properties? What about values? ;; MAYBE: Support (property) without args. - :preambles ((`(,predicate-names ,property ,value) + + ;; NOTE: When inheritance is enabled, the preamble can't be used, + ;; which will make the search slower. + :preambles ((`(,predicate-names ,property ,value . ,(map :inherit)) ;; 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 (rx-to-string `(seq bol (0+ space) ":" ,property ":" - (1+ space) ,value (0+ space) eol)) + (list :regexp (unless inherit + (rx-to-string `(seq bol (0+ space) ":" ,property ":" + (1+ space) ,value (0+ space) eol))) :query query)) - (`(,predicate-names ,property) + (`(,predicate-names ,property . ,(map :inherit)) ;; 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 (rx-to-string `(seq bol (0+ space) ":" ,property ":" (1+ space) - (minimal-match (1+ not-newline)) eol)) + (list :regexp (unless inherit + (rx-to-string `(seq bol (0+ space) ":" ,property ":" (1+ space) + (minimal-match (1+ not-newline)) eol))) :query query))) :body (pcase property @@ -1760,10 +1773,21 @@ priority B)." (_ (pcase value ('nil ;; Check that PROPERTY exists - (org-entry-get (point) property)) + (org-ql--value-at + (point) (lambda () + (org-entry-get (point) property)))) (_ - ;; Check that PROPERTY has VALUE - (string-equal value (org-entry-get (point) property 'selective))))))) + ;; Check that PROPERTY has VALUE. + + ;; TODO: Since --value-at doesn't account for inheritance, + ;; we should generalize --tags-at to also work for property + ;; inheritance and use it here, which should be much faster. + (string-equal value (org-ql--value-at + (point) (lambda () + (org-entry-get (point) property inherit))))))))) + +;; TODO: Add property-local, property-inherit, etc. to match tags predicates. +;; TODO: Add tests for property inheritance. (org-ql-defpred (regexp r) (&rest regexps) "Return non-nil if current entry matches all of REGEXPS (regexp strings)." diff --git a/org-ql.info b/org-ql.info index e191c28..18064c0 100644 --- a/org-ql.info +++ b/org-ql.info @@ -476,12 +476,13 @@ Arguments are listed next to predicate names, where applicable. 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)’ +‘property (property &optional value &key inherit)’ Return non-nil if current entry has ‘PROPERTY’ (a string), and - optionally ‘VALUE’ (a string). Note that property inheritance is - currently _not_ enabled for this predicate. If you need to test - with inheritance, you could use a custom predicate form, like - ‘(org-entry-get (point) "PROPERTY" 'inherit)’. + 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). ‘regexp (&rest regexps)’ Return non-nil if current entry matches all of ‘REGEXPS’ (regexp strings). Matches against entire entry, from beginning of its @@ -1034,6 +1035,10 @@ File: README.info, Node: 07-pre, Next: 062, Up: Changelog tokens (before, the ‘regexp’ predicate was always used, but now it may be customized). • Alias ‘c’ for predicate ‘category’. + • Predicate ‘property’ now accepts the argument ‘:inherit’ to match + entries with property inheritance, and when unspecified, the option + ‘org-use-property-inheritance’ controls whether inheritance is + used. *Changed* • Give more useful error message for invalid queries. @@ -1672,51 +1677,51 @@ Node: org-ql-sparse-tree8579 Node: Queries9379 Node: Non-sexp query syntax10496 Node: General predicates12255 -Node: Ancestor/descendant predicates18997 -Node: Date/time predicates20125 -Node: Functions / Macros23249 -Node: Agenda-like views23547 -Ref: Function ‘org-ql-block’23709 -Node: Listing / acting-on results24970 -Ref: Caching25178 -Ref: Function ‘org-ql-select’26091 -Ref: Function ‘org-ql-query’28517 -Ref: Macro ‘org-ql’ (deprecated)30291 -Node: Custom predicates30606 -Ref: Macro ‘org-ql-defpred’30830 -Node: Dynamic block34271 -Node: Links36995 -Node: Tips37682 -Node: Changelog38006 -Node: 07-pre38774 -Node: 06240347 -Node: 06140655 -Node: 0641223 -Node: 05244277 -Node: 05144577 -Node: 0545000 -Node: 04946529 -Node: 04846809 -Node: 04747156 -Node: 04647565 -Node: 04547973 -Node: 04448334 -Node: 04348693 -Node: 04248896 -Node: 04149057 -Node: 0449304 -Node: 03253405 -Node: 03153808 -Node: 0354005 -Node: 02357305 -Node: 02257539 -Node: 02157819 -Node: 0258024 -Node: 0162102 -Node: Notes62203 -Node: Comparison with Org Agenda searches62365 -Node: org-sidebar63254 -Node: License63533 +Node: Ancestor/descendant predicates19085 +Node: Date/time predicates20213 +Node: Functions / Macros23337 +Node: Agenda-like views23635 +Ref: Function ‘org-ql-block’23797 +Node: Listing / acting-on results25058 +Ref: Caching25266 +Ref: Function ‘org-ql-select’26179 +Ref: Function ‘org-ql-query’28605 +Ref: Macro ‘org-ql’ (deprecated)30379 +Node: Custom predicates30694 +Ref: Macro ‘org-ql-defpred’30918 +Node: Dynamic block34359 +Node: Links37083 +Node: Tips37770 +Node: Changelog38094 +Node: 07-pre38862 +Node: 06240672 +Node: 06140980 +Node: 0641548 +Node: 05244602 +Node: 05144902 +Node: 0545325 +Node: 04946854 +Node: 04847134 +Node: 04747481 +Node: 04647890 +Node: 04548298 +Node: 04448659 +Node: 04349018 +Node: 04249221 +Node: 04149382 +Node: 0449629 +Node: 03253730 +Node: 03154133 +Node: 0354330 +Node: 02357630 +Node: 02257864 +Node: 02158144 +Node: 0258349 +Node: 0162427 +Node: Notes62528 +Node: Comparison with Org Agenda searches62690 +Node: org-sidebar63579 +Node: License63858  End Tag Table From 5f70636556bffca92d8ef8297ba3002a4ab5b52d Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Fri, 7 Oct 2022 18:34:55 -0500 Subject: [PATCH 037/224] Add: (org-ql-find-display-buffer-action) --- org-ql-find.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/org-ql-find.el b/org-ql-find.el index 0208a45..d9ccad9 100644 --- a/org-ql-find.el +++ b/org-ql-find.el @@ -43,6 +43,11 @@ "Functions called when selecting an entry." :type 'hook) +(defcustom org-ql-find-display-buffer-action '(display-buffer-same-window) + "Display buffer action list for `org-ql-find'. +See function `display-buffer'." + :type 'sexp) + ;;;; Functions ;;;###autoload @@ -80,7 +85,7 @@ single predicate)." :prompt prompt))) (with-current-buffer (marker-buffer marker) (goto-char marker) - (display-buffer (current-buffer)) + (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)))) From f22fdd457b129398a3b98cf21c621180bd3d977d Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 8 Dec 2022 19:48:40 -0600 Subject: [PATCH 038/224] Meta: v0.6.3-pre --- README.org | 4 ++ org-ql.el | 2 +- org-ql.info | 183 ++++++++++++++++++++++++++++------------------------ 3 files changed, 102 insertions(+), 87 deletions(-) diff --git a/README.org b/README.org index a31d224..a72773e 100644 --- a/README.org +++ b/README.org @@ -522,6 +522,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.6.3-pre + +Nothing yet. + ** 0.6.2 *Fixed* diff --git a/org-ql.el b/org-ql.el index 18ccf74..8f35ede 100644 --- a/org-ql.el +++ b/org-ql.el @@ -2,7 +2,7 @@ ;; Author: Adam Porter ;; Url: https://github.com/alphapapa/org-ql -;; Version: 0.6.2 +;; Version: 0.6.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") (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 6f2db2b..77ea789 100644 --- a/org-ql.info +++ b/org-ql.info @@ -69,6 +69,7 @@ Functions / Macros Changelog +* 0.6.3-pre: 063-pre. * 0.6.2: 062. * 0.6.1: 061. * 0.6: 06. @@ -950,6 +951,7 @@ releases. * Menu: +* 0.6.3-pre: 063-pre. * 0.6.2: 062. * 0.6.1: 061. * 0.6: 06. @@ -976,9 +978,17 @@ releases. * 0.1: 01.  -File: README.info, Node: 062, Next: 061, Up: Changelog +File: README.info, Node: 063-pre, Next: 062, Up: Changelog -5.1 0.6.2 +5.1 0.6.3-pre +============= + +Nothing yet. + + +File: README.info, Node: 062, Next: 061, Prev: 063-pre, Up: Changelog + +5.2 0.6.2 ========= *Fixed* @@ -989,7 +999,7 @@ File: README.info, Node: 062, Next: 061, Up: Changelog  File: README.info, Node: 061, Next: 06, Prev: 062, Up: Changelog -5.2 0.6.1 +5.3 0.6.1 ========= *Fixed* @@ -1007,7 +1017,7 @@ File: README.info, Node: 061, Next: 06, Prev: 062, Up: Changelog  File: README.info, Node: 06, Next: 052, Prev: 061, Up: Changelog -5.3 0.6 +5.4 0.6 ======= *Added* @@ -1074,7 +1084,7 @@ File: README.info, Node: 06, Next: 052, Prev: 061, Up: Changelog  File: README.info, Node: 052, Next: 051, Prev: 06, Up: Changelog -5.4 0.5.2 +5.5 0.5.2 ========= *Fixed* @@ -1085,7 +1095,7 @@ File: README.info, Node: 052, Next: 051, Prev: 06, Up: Changelog  File: README.info, Node: 051, Next: 05, Prev: 052, Up: Changelog -5.5 0.5.1 +5.6 0.5.1 ========= *Fixed* @@ -1098,7 +1108,7 @@ File: README.info, Node: 051, Next: 05, Prev: 052, Up: Changelog  File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog -5.6 0.5 +5.7 0.5 ======= *Added* @@ -1139,7 +1149,7 @@ File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog  File: README.info, Node: 049, Next: 048, Prev: 05, Up: Changelog -5.7 0.4.9 +5.8 0.4.9 ========= *Fixed* @@ -1150,7 +1160,7 @@ File: README.info, Node: 049, Next: 048, Prev: 05, Up: Changelog  File: README.info, Node: 048, Next: 047, Prev: 049, Up: Changelog -5.8 0.4.8 +5.9 0.4.8 ========= *Fixed* @@ -1162,8 +1172,8 @@ File: README.info, Node: 048, Next: 047, Prev: 049, Up: Changelog  File: README.info, Node: 047, Next: 046, Prev: 048, Up: Changelog -5.9 0.4.7 -========= +5.10 0.4.7 +========== *Fixed* • Give a useful error if ‘org-ql-search-directories-files’ is called @@ -1175,7 +1185,7 @@ File: README.info, Node: 047, Next: 046, Prev: 048, Up: Changelog  File: README.info, Node: 046, Next: 045, Prev: 047, Up: Changelog -5.10 0.4.6 +5.11 0.4.6 ========== *Fixed* @@ -1188,7 +1198,7 @@ File: README.info, Node: 046, Next: 045, Prev: 047, Up: Changelog  File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog -5.11 0.4.5 +5.12 0.4.5 ========== *Fixed* @@ -1200,7 +1210,7 @@ File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog  File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog -5.12 0.4.4 +5.13 0.4.4 ========== *Fixed* @@ -1212,7 +1222,7 @@ File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog  File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog -5.13 0.4.3 +5.14 0.4.3 ========== *Fixed* @@ -1222,7 +1232,7 @@ File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog  File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog -5.14 0.4.2 +5.15 0.4.2 ========== *Fixed* @@ -1231,7 +1241,7 @@ File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog  File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog -5.15 0.4.1 +5.16 0.4.1 ========== *Fixed* @@ -1241,7 +1251,7 @@ File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog  File: README.info, Node: 04, Next: 032, Prev: 041, Up: Changelog -5.16 0.4 +5.17 0.4 ======== _Note:_ The next release, 0.5, may include changes which will require @@ -1322,7 +1332,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.17 0.3.2 +5.18 0.3.2 ========== *Fixed* @@ -1335,7 +1345,7 @@ File: README.info, Node: 032, Next: 031, Prev: 04, Up: Changelog  File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog -5.18 0.3.1 +5.19 0.3.1 ========== *Fixed* @@ -1345,7 +1355,7 @@ File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog  File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog -5.19 0.3 +5.20 0.3 ======== *Added* @@ -1413,7 +1423,7 @@ File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog  File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog -5.20 0.2.3 +5.21 0.2.3 ========== *Fixed* @@ -1423,7 +1433,7 @@ File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog  File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog -5.21 0.2.2 +5.22 0.2.2 ========== *Fixed* @@ -1434,7 +1444,7 @@ File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog  File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog -5.22 0.2.1 +5.23 0.2.1 ========== *Fixed* @@ -1444,7 +1454,7 @@ File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog  File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog -5.23 0.2 +5.24 0.2 ======== *Added* @@ -1527,7 +1537,7 @@ File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog  File: README.info, Node: 01, Prev: 02, Up: Changelog -5.24 0.1 +5.25 0.1 ======== First tagged release. @@ -1585,66 +1595,67 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1728 -Node: Screenshots1851 -Node: Installation1969 -Node: Quelpa2483 -Node: Helm support3011 -Node: Usage3414 -Node: Commands3812 -Node: org-ql-search4285 -Node: helm-org-ql5959 -Node: org-ql-view6337 -Node: org-ql-view-sidebar6867 -Node: org-ql-view-recent-items7247 -Node: org-ql-sparse-tree7743 -Node: Queries8543 -Node: Non-sexp query syntax9660 -Node: General predicates11419 -Node: Ancestor/descendant predicates17658 -Node: Date/time predicates18786 -Node: Functions / Macros21910 -Node: Agenda-like views22208 -Ref: Function ‘org-ql-block’22370 -Node: Listing / acting-on results23631 -Ref: Caching23839 -Ref: Function ‘org-ql-select’24752 -Ref: Function ‘org-ql-query’27178 -Ref: Macro ‘org-ql’ (deprecated)28952 -Node: Custom predicates29267 -Ref: Macro ‘org-ql-defpred’29491 -Node: Dynamic block32932 -Node: Links35656 -Node: Tips36343 -Node: Changelog36667 -Node: 06237415 -Node: 06137708 -Node: 0638276 -Node: 05241330 -Node: 05141630 -Node: 0542053 -Node: 04943582 -Node: 04843862 -Node: 04744209 -Node: 04644616 -Node: 04545024 -Node: 04445385 -Node: 04345744 -Node: 04245947 -Node: 04146108 -Node: 0446355 -Node: 03250456 -Node: 03150859 -Node: 0351056 -Node: 02354356 -Node: 02254590 -Node: 02154870 -Node: 0255075 -Node: 0159153 -Node: Notes59254 -Node: Comparison with Org Agenda searches59416 -Node: org-sidebar60305 -Node: License60584 +Node: Contents1751 +Node: Screenshots1874 +Node: Installation1992 +Node: Quelpa2506 +Node: Helm support3034 +Node: Usage3437 +Node: Commands3835 +Node: org-ql-search4308 +Node: helm-org-ql5982 +Node: org-ql-view6360 +Node: org-ql-view-sidebar6890 +Node: org-ql-view-recent-items7270 +Node: org-ql-sparse-tree7766 +Node: Queries8566 +Node: Non-sexp query syntax9683 +Node: General predicates11442 +Node: Ancestor/descendant predicates17681 +Node: Date/time predicates18809 +Node: Functions / Macros21933 +Node: Agenda-like views22231 +Ref: Function ‘org-ql-block’22393 +Node: Listing / acting-on results23654 +Ref: Caching23862 +Ref: Function ‘org-ql-select’24775 +Ref: Function ‘org-ql-query’27201 +Ref: Macro ‘org-ql’ (deprecated)28975 +Node: Custom predicates29290 +Ref: Macro ‘org-ql-defpred’29514 +Node: Dynamic block32955 +Node: Links35679 +Node: Tips36366 +Node: Changelog36690 +Node: 063-pre37461 +Node: 06237569 +Node: 06137878 +Node: 0638446 +Node: 05241500 +Node: 05141800 +Node: 0542223 +Node: 04943752 +Node: 04844032 +Node: 04744379 +Node: 04644788 +Node: 04545196 +Node: 04445557 +Node: 04345916 +Node: 04246119 +Node: 04146280 +Node: 0446527 +Node: 03250628 +Node: 03151031 +Node: 0351228 +Node: 02354528 +Node: 02254762 +Node: 02155042 +Node: 0255247 +Node: 0159325 +Node: Notes59426 +Node: Comparison with Org Agenda searches59588 +Node: org-sidebar60477 +Node: License60756  End Tag Table From 85aee42fae23cc407f37dc1ab3b6459527c6b2be Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 8 Dec 2022 20:37:45 -0600 Subject: [PATCH 039/224] Meta: Update makem.sh to v0.6-pre Needed for testing on Emacs 28+. --- makem.sh | 178 +++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 146 insertions(+), 32 deletions(-) diff --git a/makem.sh b/makem.sh index b9fc062..82a2db0 100755 --- a/makem.sh +++ b/makem.sh @@ -3,11 +3,11 @@ # * makem.sh --- Script to aid building and testing Emacs Lisp packages # URL: https://github.com/alphapapa/makem.sh -# Version: 0.3 +# Version: 0.6-pre # * Commentary: -# makem.sh is a script helps to build, lint, and test Emacs Lisp +# makem.sh is a script that helps to build, lint, and test Emacs Lisp # packages. It aims to make linting and testing as simple as possible # without requiring per-package configuration. @@ -79,7 +79,7 @@ Rules: Options: -d, --debug Print debug info. -h, --help I need somebody! - -v, --verbose Increase verbosity, up to -vv. + -v, --verbose Increase verbosity, up to -vvv. --no-color Disable color output. --debug-load-path Print load-path from inside Emacs. @@ -136,6 +136,27 @@ EOF echo $file } +function elisp-elint-file { + local file=$(mktemp) + cat >$file <"$file" </dev/null) if [[ $file_pkg ]] @@ -496,6 +570,8 @@ function sandbox { args_sandbox=( --title "makem.sh: $(basename $(pwd)) (sandbox: $sandbox_dir)" --eval "(setq user-emacs-directory (file-truename \"$sandbox_dir\"))" + --load package + --eval "(setq package-user-dir (expand-file-name \"elpa\" user-emacs-directory))" --eval "(setq user-init-file (file-truename \"$init_file\"))" ) @@ -658,7 +734,8 @@ function verbose { if [[ $verbose -ge $1 ]] then [[ $1 -eq 1 ]] && local color_name=blue - [[ $1 -ge 2 ]] && local color_name=cyan + [[ $1 -eq 2 ]] && local color_name=cyan + [[ $1 -ge 3 ]] && local color_name=white shift log_color $color_name "$@" >&2 @@ -706,9 +783,7 @@ function compile-batch { verbose 2 "Batch-compiling files..." debug "Byte-compile files: ${files_project_byte_compile[@]}" - batch-byte-compile "${files_project_byte_compile[@]}" \ - && success "Compiling finished without errors." \ - || error "Compilation failed." + batch-byte-compile "${files_project_byte_compile[@]}" } function compile-each { @@ -726,9 +801,7 @@ function compile-each { || compile_errors=t done - ! [[ $compile_errors ]] \ - && success "Compiling finished without errors." \ - || error "Compilation failed." + [[ ! $compile_errors ]] } function compile { @@ -738,6 +811,18 @@ function compile { else compile-each "$@" fi + local status=$? + + if [[ $compile_error_on_warn ]] + then + # Linting: just return status code, because lint rule will print messages. + [[ $status = 0 ]] + else + # Not linting: print messages here. + [[ $status = 0 ]] \ + && success "Compiling finished without errors." \ + || error "Compiling failed." + fi } function batch { @@ -752,12 +837,15 @@ function batch { function interactive { # Run Emacs interactively. Most useful with --sandbox and --install-deps. + local load_file_args=$(args-load-files "${files_project_feature[@]}" "${files_project_test[@]}") verbose 1 "Running Emacs interactively..." - verbose 2 "Loading files:" "${files_project_feature[@]}" "${files_project_test[@]}" + verbose 2 "Loading files: ${load_file_args//--load /}" + + [[ $compile ]] && compile unset arg_batch run_emacs \ - $(args-load-files "${files_project_feature[@]}" "${files_project_test[@]}") \ + $load_file_args \ --eval "(load user-init-file)" \ "${args_batch_interactive[@]}" arg_batch="--batch" @@ -769,6 +857,9 @@ function lint { lint-checkdoc lint-compile lint-declare + # NOTE: Elint doesn't seem very useful at the moment. See comment + # in lint-elint function. + # lint-elint lint-indent lint-package lint-regexps @@ -825,6 +916,28 @@ function lint-elsa { || error "Linting with Elsa failed." } +function lint-elint { + # NOTE: Elint gives a lot of spurious warnings, apparently because it doesn't load files + # that are `require'd, so its output isn't very useful. But in case it's improved in + # the future, and since this wrapper code already works, we might as well leave it in. + verbose 1 "Linting with Elint..." + + local errors=0 + for file in "${files_project_feature[@]}" + do + verbose 2 "Linting with Elint: $file..." + run_emacs \ + --load "$(elisp-elint-file)" \ + --eval "(makem-elint-file \"$file\")" \ + && verbose 3 "Linting with Elint found no errors." \ + || { error "Linting with Elint failed: $file"; ((errors++)) ; } + done + + [[ $errors = 0 ]] \ + && success "Linting with Elint finished without errors." \ + || error "Linting with Elint failed." +} + function lint-indent { verbose 1 "Linting indentation..." @@ -896,7 +1009,8 @@ function test-buttercup { run_emacs \ $(args-load-files "${files_project_test[@]}") \ - -f buttercup-run \ + --load "$buttercup_file" \ + --eval "(progn (setq backtrace-on-error-noninteractive nil) (buttercup-run))" \ && success "Buttercup tests finished without errors." \ || error "Buttercup tests failed." } From 9f00fa38907c31ce36b6e8e83383a7129f85f79f Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 8 Dec 2022 19:50:37 -0600 Subject: [PATCH 040/224] Fix: (org-ql--def-query-string-to-sexp-fn) Updated for peg v1.0.1 Fixes #314, fixes #316. Thanks to Akira Komamura (@akirak) and Joon Ro (@joonro) for reporting. Instead of `[blank]` in this PEX, it used to be `(syntax-class whitespace)`, which worked fine with peg v1.0. Then was filed and resulted in the release of peg v1.0.1, after which that no longer worked. As best I can tell from reading the discussion, `[blank]` and `(syntax-class whitespace)` should behave the same way, yet here they do not: with peg v1.0.1, only `[blank]` works. Why, I do not know; I only tried it because I could find no explanation for the broken behavior, and luckily, it works. Maybe it's due to the use of `(syntax-class whitespace)` later in the `pexs`; but since it finally works again, let's take the victory as-is. --- README.org | 3 ++- org-ql.el | 5 ++--- org-ql.info | 64 +++++++++++++++++++++++++++++------------------------ 3 files changed, 39 insertions(+), 33 deletions(-) diff --git a/README.org b/README.org index a72773e..caf9b67 100644 --- a/README.org +++ b/README.org @@ -524,7 +524,8 @@ Simple links may also be written manually in either sexp or non-sexp form, like: ** 0.6.3-pre -Nothing yet. +*Fixed* ++ Non-sexp query parsing with updated version 1.0.1 of the ~peg~ package. (Fixes [[https://github.com/alphapapa/org-ql/issues/314][#314]], [[https://github.com/alphapapa/org-ql/issues/316][#316]]. Thanks to [[https://github.com/akirak][Akira Komamura]] and [[https://github.com/joonro][Joon Ro]] for reporting.) ** 0.6.2 diff --git a/org-ql.el b/org-ql.el index 8f35ede..07bc664 100644 --- a/org-ql.el +++ b/org-ql.el @@ -3,7 +3,7 @@ ;; Author: Adam Porter ;; Url: https://github.com/alphapapa/org-ql ;; Version: 0.6.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") (s "1.12.0") (transient "0.1") (ts "0.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 ;;; Commentary: @@ -854,8 +854,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 (+ term - (opt (+ (syntax-class whitespace) (any))))) + (pexs `((query (+ (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 77ea789..4f99a54 100644 --- a/org-ql.info +++ b/org-ql.info @@ -983,7 +983,13 @@ File: README.info, Node: 063-pre, Next: 062, Up: Changelog 5.1 0.6.3-pre ============= -Nothing yet. +*Fixed* + • Non-sexp query parsing with updated version 1.0.1 of the ‘peg’ + package. (Fixes #314 + (https://github.com/alphapapa/org-ql/issues/314), #316 + (https://github.com/alphapapa/org-ql/issues/316). Thanks to Akira + Komamura (https://github.com/akirak) and Joon Ro + (https://github.com/joonro) for reporting.)  File: README.info, Node: 062, Next: 061, Prev: 063-pre, Up: Changelog @@ -1628,34 +1634,34 @@ Node: Links35679 Node: Tips36366 Node: Changelog36690 Node: 063-pre37461 -Node: 06237569 -Node: 06137878 -Node: 0638446 -Node: 05241500 -Node: 05141800 -Node: 0542223 -Node: 04943752 -Node: 04844032 -Node: 04744379 -Node: 04644788 -Node: 04545196 -Node: 04445557 -Node: 04345916 -Node: 04246119 -Node: 04146280 -Node: 0446527 -Node: 03250628 -Node: 03151031 -Node: 0351228 -Node: 02354528 -Node: 02254762 -Node: 02155042 -Node: 0255247 -Node: 0159325 -Node: Notes59426 -Node: Comparison with Org Agenda searches59588 -Node: org-sidebar60477 -Node: License60756 +Node: 06237900 +Node: 06138209 +Node: 0638777 +Node: 05241831 +Node: 05142131 +Node: 0542554 +Node: 04944083 +Node: 04844363 +Node: 04744710 +Node: 04645119 +Node: 04545527 +Node: 04445888 +Node: 04346247 +Node: 04246450 +Node: 04146611 +Node: 0446858 +Node: 03250959 +Node: 03151362 +Node: 0351559 +Node: 02354859 +Node: 02255093 +Node: 02155373 +Node: 0255578 +Node: 0159656 +Node: Notes59757 +Node: Comparison with Org Agenda searches59919 +Node: org-sidebar60808 +Node: License61087  End Tag Table From 2ddfb7c231d42211ecace54320f454c4a8ace4de Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 8 Dec 2022 20:41:50 -0600 Subject: [PATCH 041/224] Fix: Require org-duration This appears to be necessary on newer Org versions, but I don't know exactly when. --- README.org | 1 + org-ql.el | 1 + org-ql.info | 58 +++++++++++++++++++++++++++-------------------------- 3 files changed, 32 insertions(+), 28 deletions(-) diff --git a/README.org b/README.org index caf9b67..bb1c549 100644 --- a/README.org +++ b/README.org @@ -526,6 +526,7 @@ Simple links may also be written manually in either sexp or non-sexp form, like: *Fixed* + Non-sexp query parsing with updated version 1.0.1 of the ~peg~ package. (Fixes [[https://github.com/alphapapa/org-ql/issues/314][#314]], [[https://github.com/alphapapa/org-ql/issues/316][#316]]. Thanks to [[https://github.com/akirak][Akira Komamura]] and [[https://github.com/joonro][Joon Ro]] for reporting.) ++ Require library ~org-duration~ (apparently necessary in newer Org versions). ** 0.6.2 diff --git a/org-ql.el b/org-ql.el index 07bc664..e44a4aa 100644 --- a/org-ql.el +++ b/org-ql.el @@ -35,6 +35,7 @@ (require 'cl-lib) (require 'org) +(require 'org-duration) (require 'org-element) (require 'org-habit) (require 'seq) diff --git a/org-ql.info b/org-ql.info index 4f99a54..933c981 100644 --- a/org-ql.info +++ b/org-ql.info @@ -990,6 +990,8 @@ File: README.info, Node: 063-pre, Next: 062, Up: Changelog (https://github.com/alphapapa/org-ql/issues/316). Thanks to Akira Komamura (https://github.com/akirak) and Joon Ro (https://github.com/joonro) for reporting.) + • Require library ‘org-duration’ (apparently necessary in newer Org + versions).  File: README.info, Node: 062, Next: 061, Prev: 063-pre, Up: Changelog @@ -1634,34 +1636,34 @@ Node: Links35679 Node: Tips36366 Node: Changelog36690 Node: 063-pre37461 -Node: 06237900 -Node: 06138209 -Node: 0638777 -Node: 05241831 -Node: 05142131 -Node: 0542554 -Node: 04944083 -Node: 04844363 -Node: 04744710 -Node: 04645119 -Node: 04545527 -Node: 04445888 -Node: 04346247 -Node: 04246450 -Node: 04146611 -Node: 0446858 -Node: 03250959 -Node: 03151362 -Node: 0351559 -Node: 02354859 -Node: 02255093 -Node: 02155373 -Node: 0255578 -Node: 0159656 -Node: Notes59757 -Node: Comparison with Org Agenda searches59919 -Node: org-sidebar60808 -Node: License61087 +Node: 06237993 +Node: 06138302 +Node: 0638870 +Node: 05241924 +Node: 05142224 +Node: 0542647 +Node: 04944176 +Node: 04844456 +Node: 04744803 +Node: 04645212 +Node: 04545620 +Node: 04445981 +Node: 04346340 +Node: 04246543 +Node: 04146704 +Node: 0446951 +Node: 03251052 +Node: 03151455 +Node: 0351652 +Node: 02354952 +Node: 02255186 +Node: 02155466 +Node: 0255671 +Node: 0159749 +Node: Notes59850 +Node: Comparison with Org Agenda searches60012 +Node: org-sidebar60901 +Node: License61180  End Tag Table From 80b334c269b121c21b9a5a5a4b84f0f38bf9269e Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 8 Dec 2022 19:51:09 -0600 Subject: [PATCH 042/224] Release: v0.6.3 --- README.org | 2 +- org-ql.el | 2 +- org-ql.info | 134 ++++++++++++++++++++++++++-------------------------- 3 files changed, 69 insertions(+), 69 deletions(-) diff --git a/README.org b/README.org index bb1c549..23da3a9 100644 --- a/README.org +++ b/README.org @@ -522,7 +522,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.6.3-pre +** 0.6.3 *Fixed* + Non-sexp query parsing with updated version 1.0.1 of the ~peg~ package. (Fixes [[https://github.com/alphapapa/org-ql/issues/314][#314]], [[https://github.com/alphapapa/org-ql/issues/316][#316]]. Thanks to [[https://github.com/akirak][Akira Komamura]] and [[https://github.com/joonro][Joon Ro]] for reporting.) diff --git a/org-ql.el b/org-ql.el index e44a4aa..c5a1275 100644 --- a/org-ql.el +++ b/org-ql.el @@ -2,7 +2,7 @@ ;; Author: Adam Porter ;; Url: https://github.com/alphapapa/org-ql -;; Version: 0.6.3-pre +;; Version: 0.6.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 933c981..32be3ab 100644 --- a/org-ql.info +++ b/org-ql.info @@ -69,7 +69,7 @@ Functions / Macros Changelog -* 0.6.3-pre: 063-pre. +* 0.6.3: 063. * 0.6.2: 062. * 0.6.1: 061. * 0.6: 06. @@ -951,7 +951,7 @@ releases. * Menu: -* 0.6.3-pre: 063-pre. +* 0.6.3: 063. * 0.6.2: 062. * 0.6.1: 061. * 0.6: 06. @@ -978,10 +978,10 @@ releases. * 0.1: 01.  -File: README.info, Node: 063-pre, Next: 062, Up: Changelog +File: README.info, Node: 063, Next: 062, Up: Changelog -5.1 0.6.3-pre -============= +5.1 0.6.3 +========= *Fixed* • Non-sexp query parsing with updated version 1.0.1 of the ‘peg’ @@ -994,7 +994,7 @@ File: README.info, Node: 063-pre, Next: 062, Up: Changelog versions).  -File: README.info, Node: 062, Next: 061, Prev: 063-pre, Up: Changelog +File: README.info, Node: 062, Next: 061, Prev: 063, Up: Changelog 5.2 0.6.2 ========= @@ -1603,67 +1603,67 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1751 -Node: Screenshots1874 -Node: Installation1992 -Node: Quelpa2506 -Node: Helm support3034 -Node: Usage3437 -Node: Commands3835 -Node: org-ql-search4308 -Node: helm-org-ql5982 -Node: org-ql-view6360 -Node: org-ql-view-sidebar6890 -Node: org-ql-view-recent-items7270 -Node: org-ql-sparse-tree7766 -Node: Queries8566 -Node: Non-sexp query syntax9683 -Node: General predicates11442 -Node: Ancestor/descendant predicates17681 -Node: Date/time predicates18809 -Node: Functions / Macros21933 -Node: Agenda-like views22231 -Ref: Function ‘org-ql-block’22393 -Node: Listing / acting-on results23654 -Ref: Caching23862 -Ref: Function ‘org-ql-select’24775 -Ref: Function ‘org-ql-query’27201 -Ref: Macro ‘org-ql’ (deprecated)28975 -Node: Custom predicates29290 -Ref: Macro ‘org-ql-defpred’29514 -Node: Dynamic block32955 -Node: Links35679 -Node: Tips36366 -Node: Changelog36690 -Node: 063-pre37461 -Node: 06237993 -Node: 06138302 -Node: 0638870 -Node: 05241924 -Node: 05142224 -Node: 0542647 -Node: 04944176 -Node: 04844456 -Node: 04744803 -Node: 04645212 -Node: 04545620 -Node: 04445981 -Node: 04346340 -Node: 04246543 -Node: 04146704 -Node: 0446951 -Node: 03251052 -Node: 03151455 -Node: 0351652 -Node: 02354952 -Node: 02255186 -Node: 02155466 -Node: 0255671 -Node: 0159749 -Node: Notes59850 -Node: Comparison with Org Agenda searches60012 -Node: org-sidebar60901 -Node: License61180 +Node: Contents1743 +Node: Screenshots1866 +Node: Installation1984 +Node: Quelpa2498 +Node: Helm support3026 +Node: Usage3429 +Node: Commands3827 +Node: org-ql-search4300 +Node: helm-org-ql5974 +Node: org-ql-view6352 +Node: org-ql-view-sidebar6882 +Node: org-ql-view-recent-items7262 +Node: org-ql-sparse-tree7758 +Node: Queries8558 +Node: Non-sexp query syntax9675 +Node: General predicates11434 +Node: Ancestor/descendant predicates17673 +Node: Date/time predicates18801 +Node: Functions / Macros21925 +Node: Agenda-like views22223 +Ref: Function ‘org-ql-block’22385 +Node: Listing / acting-on results23646 +Ref: Caching23854 +Ref: Function ‘org-ql-select’24767 +Ref: Function ‘org-ql-query’27193 +Ref: Macro ‘org-ql’ (deprecated)28967 +Node: Custom predicates29282 +Ref: Macro ‘org-ql-defpred’29506 +Node: Dynamic block32947 +Node: Links35671 +Node: Tips36358 +Node: Changelog36682 +Node: 06337445 +Node: 06237965 +Node: 06138270 +Node: 0638838 +Node: 05241892 +Node: 05142192 +Node: 0542615 +Node: 04944144 +Node: 04844424 +Node: 04744771 +Node: 04645180 +Node: 04545588 +Node: 04445949 +Node: 04346308 +Node: 04246511 +Node: 04146672 +Node: 0446919 +Node: 03251020 +Node: 03151423 +Node: 0351620 +Node: 02354920 +Node: 02255154 +Node: 02155434 +Node: 0255639 +Node: 0159717 +Node: Notes59818 +Node: Comparison with Org Agenda searches59980 +Node: org-sidebar60869 +Node: License61148  End Tag Table From 6e3a5eebe718b3e5e5f035f5e21cbf5504c0cbd4 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 8 Dec 2022 21:22:40 -0600 Subject: [PATCH 043/224] Fix: (src) Coalesce function --- org-ql.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/org-ql.el b/org-ql.el index 3f5d973..a36250f 100644 --- a/org-ql.el +++ b/org-ql.el @@ -1818,9 +1818,11 @@ language." (when (or (not coalesced-args) (equal (plist-get current-args :lang) (plist-get coalesced-args :lang))) - (plist-put coalesced-args :regexps (append (plist-get coalesced-args :regexps) - (plist-get current-args :regexps))) - (plist-put coalesced-args :lang (plist-get current-args :lang)))) + (setf coalesced-args + (plist-put coalesced-args :lang (plist-get current-args :lang))) + (setf coalesced-args + (plist-put coalesced-args :regexps (append (plist-get coalesced-args :regexps) + (plist-get current-args :regexps)))))) :normalizers ((`(,predicate-names . ,args) ;; Rewrite to use keyword args. (cond ((cl-every #'stringp args) From ecde3a0420c305bb971ad3ae7f7ab39c33370d00 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Fri, 9 Dec 2022 19:38:34 -0600 Subject: [PATCH 044/224] Change/Fix: (src) Normalization, case-insensitivity --- README.org | 6 ++- org-ql.el | 50 ++++++++++++++++++---- org-ql.info | 98 +++++++++++++++++++++++--------------------- tests/test-org-ql.el | 20 ++++----- 4 files changed, 108 insertions(+), 66 deletions(-) diff --git a/README.org b/README.org index 4680d74..aa0fa6f 100644 --- a/README.org +++ b/README.org @@ -243,7 +243,7 @@ Arguments are listed next to predicate names, where applicable. + =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. - 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. ++ ~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. - Aliases: ~inherited-tags~, ~tags-i~, ~itags~. @@ -554,6 +554,10 @@ Simple links may also be written manually in either sexp or non-sexp form, like: *Changed* + Give more useful error message for invalid queries. ++ Predicate ~src~ now matches case-insensitively. + +*Fixed* ++ Predicate ~src~'s matching of begin/end block lines, normalization of arguments, and handling in non-sexp queries. *Internal* + Certain query predicates, when called multiple times in an ~and~ sub-expression, are optimized to a single call. diff --git a/org-ql.el b/org-ql.el index a36250f..5020d4c 100644 --- a/org-ql.el +++ b/org-ql.el @@ -1813,7 +1813,7 @@ interpreted as nil or non-nil)." (org-ql-defpred src (&key regexps lang) "Return non-nil if current entry contains an Org source block matching all of REGEXPS. If keyword argument LANG is non-nil, the block must be in that -language." +language. Matching is done case-insensitively." :coalesce (lambda (coalesced-args current-args) (when (or (not coalesced-args) (equal (plist-get current-args :lang) @@ -1821,13 +1821,28 @@ language." (setf coalesced-args (plist-put coalesced-args :lang (plist-get current-args :lang))) (setf coalesced-args - (plist-put coalesced-args :regexps (append (plist-get coalesced-args :regexps) - (plist-get current-args :regexps)))))) - :normalizers ((`(,predicate-names . ,args) + (plist-put coalesced-args + :regexps (list 'quote + (append (car (delq 'quote (plist-get coalesced-args :regexps))) + ;; A bit awkward, but necessary. + (car (delq 'quote (plist-get current-args :regexps))))))))) + :normalizers ((`(,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 "src:" while the user is typing. + (list 'src)) + ;; NOTE: The :regexps argument is a quoted list, + ;; because we call the byte-compiler at runtime, and + ;; without quoting, it would interpret it as a + ;; function call. This requires some awkwardness in + ;; other places to deal with the quoting. + (`(,predicate-names . ,args) ;; Rewrite to use keyword args. (cond ((cl-every #'stringp args) ;; No keywords, only regexps. - `(src :regexps ,args)) + `(src :regexps ',args)) ((and (stringp (car args)) (cl-some #'keywordp args)) ;; Regexp as first arg with keyword later. (let* ((keyword-pos (cl-position :lang args)) @@ -1835,16 +1850,33 @@ language." ;; We assume that if :lang is given, the string argument follows. (lang (nth (1+ (cl-position :lang args)) args))) `(src :lang ,lang - :regexps ,regexps))) + :regexps ',regexps))) ((keywordp (car args)) ;; All plist args. `(src ,@(delq nil (append (when (plist-get args :lang) (list :lang (plist-get args :lang))) - (when (plist-get args :regexps) - (list :regexps (plist-get args :regexps)))))))))) - :preambles ((`(,predicate-names . ,args) + (pcase (plist-get args :regexps) + (`(quote . ,_) + ;; Already quoted: return as-is to stop further normalization. + (list :regexps (plist-get args :regexps))) + (_ (list :regexps `(quote ,(plist-get args :regexps)))))))))))) + ;; NOTE: We match case-insensitively since the + ;; "#+BEGIN_SRC/#+END_SRC" lines could be either upper- or + ;; lowercase, as well as the language name. + :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 "src:" while the user is typing. + (list :regexp (org-ql--format-src-block-regexp) + :case-fold t + ;; Always check contents with predicate. + :query query)) + (`(,predicate-names . ,args) (list :regexp (org-ql--format-src-block-regexp (plist-get args :lang)) + :case-fold t ;; Always check contents with predicate. :query query))) :body diff --git a/org-ql.info b/org-ql.info index 8d20584..811d918 100644 --- a/org-ql.info +++ b/org-ql.info @@ -502,6 +502,7 @@ Arguments are listed next to predicate names, where applicable. 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. @@ -1044,6 +1045,11 @@ File: README.info, Node: 07-pre, Next: 063, Up: Changelog *Changed* • Give more useful error message for invalid queries. + • Predicate ‘src’ now matches case-insensitively. + + *Fixed* + • Predicate ‘src’’s matching of begin/end block lines, normalization + of arguments, and handling in non-sexp queries. *Internal* • Certain query predicates, when called multiple times in an ‘and’ @@ -1695,52 +1701,52 @@ Node: org-ql-sparse-tree8594 Node: Queries9394 Node: Non-sexp query syntax10511 Node: General predicates12270 -Node: Ancestor/descendant predicates19100 -Node: Date/time predicates20228 -Node: Functions / Macros23352 -Node: Agenda-like views23650 -Ref: Function ‘org-ql-block’23812 -Node: Listing / acting-on results25073 -Ref: Caching25281 -Ref: Function ‘org-ql-select’26194 -Ref: Function ‘org-ql-query’28620 -Ref: Macro ‘org-ql’ (deprecated)30394 -Node: Custom predicates30709 -Ref: Macro ‘org-ql-defpred’30933 -Node: Dynamic block34374 -Node: Links37098 -Node: Tips37785 -Node: Changelog38109 -Node: 07-pre38892 -Node: 06340702 -Node: 06241237 -Node: 06141542 -Node: 0642110 -Node: 05245164 -Node: 05145464 -Node: 0545887 -Node: 04947416 -Node: 04847696 -Node: 04748045 -Node: 04648454 -Node: 04548862 -Node: 04449223 -Node: 04349582 -Node: 04249785 -Node: 04149946 -Node: 0450193 -Node: 03254294 -Node: 03154697 -Node: 0354894 -Node: 02358194 -Node: 02258428 -Node: 02158708 -Node: 0258913 -Node: 0162991 -Node: Notes63092 -Node: Comparison with Org Agenda searches63254 -Node: org-sidebar64143 -Node: License64422 +Node: Ancestor/descendant predicates19142 +Node: Date/time predicates20270 +Node: Functions / Macros23394 +Node: Agenda-like views23692 +Ref: Function ‘org-ql-block’23854 +Node: Listing / acting-on results25115 +Ref: Caching25323 +Ref: Function ‘org-ql-select’26236 +Ref: Function ‘org-ql-query’28662 +Ref: Macro ‘org-ql’ (deprecated)30436 +Node: Custom predicates30751 +Ref: Macro ‘org-ql-defpred’30975 +Node: Dynamic block34416 +Node: Links37140 +Node: Tips37827 +Node: Changelog38151 +Node: 07-pre38934 +Node: 06340948 +Node: 06241483 +Node: 06141788 +Node: 0642356 +Node: 05245410 +Node: 05145710 +Node: 0546133 +Node: 04947662 +Node: 04847942 +Node: 04748291 +Node: 04648700 +Node: 04549108 +Node: 04449469 +Node: 04349828 +Node: 04250031 +Node: 04150192 +Node: 0450439 +Node: 03254540 +Node: 03154943 +Node: 0355140 +Node: 02358440 +Node: 02258674 +Node: 02158954 +Node: 0259159 +Node: 0163237 +Node: Notes63338 +Node: Comparison with Org Agenda searches63500 +Node: org-sidebar64389 +Node: License64668  End Tag Table diff --git a/tests/test-org-ql.el b/tests/test-org-ql.el index 41ba1f6..25ac617 100644 --- a/tests/test-org-ql.el +++ b/tests/test-org-ql.el @@ -231,17 +231,17 @@ with keyword arg NOW in PLIST." :to-equal '(or (and (rifle :regexps '("foo" "bar"))) (and (rifle :regexps '("baz" "buz")))))) (it "coalesces arguments to predicates which use coalescing functions and whose calls are eligible for coalescing" (expect (org-ql--normalize-query '(and (src "foo") (src "bar"))) - :to-equal '(and (src :lang nil :regexps ("foo" "bar")))) + :to-equal '(and (src :lang nil :regexps '("foo" "bar")))) (expect (org-ql--normalize-query '(and (src "foo" :lang "elisp") (src "bar" :lang "elisp"))) - :to-equal '(and (src :lang "elisp" :regexps ("foo" "bar"))))) + :to-equal '(and (src :lang "elisp" :regexps '("foo" "bar"))))) (it "does not coalesce arguments to predicates which use coalescing functions and whose calls are ineligible for coalescing" (expect (org-ql--normalize-query '(and (src "foo" :lang "elisp") (src "bar"))) ;; NOTE: The current implementation of `org-ql--normalize-query' ;; reorders clauses in this case. Fixing that would probably ;; not be worth the effort in code or runtime. - :to-equal '(and (src :regexps ("bar")) (src :lang "elisp" :regexps ("foo")))) + :to-equal '(and (src :regexps '("bar")) (src :lang "elisp" :regexps '("foo")))) (expect (org-ql--normalize-query '(and (src "foo" :lang "elisp") (src "bar" :lang "python"))) - :to-equal '(and (src :lang "python" :regexps ("bar")) (src :lang "elisp" :regexps ("foo")))))) + :to-equal '(and (src :lang "python" :regexps '("bar")) (src :lang "elisp" :regexps '("foo")))))) (describe "Normalization" @@ -317,21 +317,21 @@ with keyword arg NOW in PLIST." (describe "(src)" (it "normalizes a non-keyword arg to keywords" (expect (org-ql--normalize-query '(src "foo")) - :to-equal '(src :regexps ("foo")))) + :to-equal '(src :regexps '("foo")))) (it "normalizes non-keyword args to keywords" (expect (org-ql--normalize-query '(src "foo" "bar")) - :to-equal '(src :regexps ("foo" "bar")))) + :to-equal '(src :regexps '("foo" "bar")))) (it "normalizes a non-keyword arg with a :lang keyword arg to keywords" (expect (org-ql--normalize-query '(src "foo" :lang "bar")) - :to-equal '(src :lang "bar" :regexps ("foo")))) + :to-equal '(src :lang "bar" :regexps '("foo")))) (it "normalizes non-keyword args with a :lang keyword arg to keywords" (expect (org-ql--normalize-query '(src "foo" "bar" :lang "baz")) - :to-equal '(src :lang "baz" :regexps ("foo" "bar")))) + :to-equal '(src :lang "baz" :regexps '("foo" "bar")))) (it "normalizes all-keyword args without looping" (expect (org-ql--normalize-query '(src :regexps ("foo") :lang "bar")) - :to-equal '(src :lang "bar" :regexps ("foo"))) + :to-equal '(src :lang "bar" :regexps '("foo"))) (expect (org-ql--normalize-query '(src :regexps ("foo") :lang)) - :to-equal '(src :regexps ("foo"))))) + :to-equal '(src :regexps '("foo"))))) (describe "(tags-inherited)" (it "handles 0 arguments" From 91908186fcca4b5fd2e9d26da5bc0375c2b41acf Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Fri, 9 Dec 2022 19:41:30 -0600 Subject: [PATCH 045/224] Change/Fix: Preambles for predicates that expect arguments Closes #285. Thanks to Caleb Chase (@chasecaleb) for reporting. --- org-ql.el | 43 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/org-ql.el b/org-ql.el index 5020d4c..7396e5d 100644 --- a/org-ql.el +++ b/org-ql.el @@ -1415,7 +1415,15 @@ Matching is done case-insensitively." ;; "h" alias. `(heading ,@args))) ;; TODO: Adjust regexp to avoid matching in tag list. - :preambles ((`(,predicate-names ,string) + :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) @@ -1442,7 +1450,15 @@ Matching is done case-insensitively." ;; "h" alias. `(heading-regexp ,@args))) ;; MAYBE: Adjust regexp to avoid matching in tag list. - :preambles ((`(,predicate-names ,regexp) + :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 ,regexp) ;; Only one regexp: 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) @@ -1478,7 +1494,15 @@ COMPARATOR may be `<', `<=', `>', or `>='." ((pred stringp) (string-to-number it)) (_ it)) args)))) - :preambles ((`(,predicate-names ,comparator-or-num ,num) + :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+ "*") " ") + :case-fold t)) + (`(,predicate-names ,comparator-or-num ,num) (let ((repeat (pcase comparator-or-num ('< `(repeat 1 ,(1- num) "*")) ('<= `(repeat 1 ,num "*")) @@ -1736,7 +1760,18 @@ 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)." - :normalizers ((`(,predicate-names ,property ,value . ,plist) + :normalizers ((`(,predicate-names) + ;; HACK: 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 "property:" while the user + ;; is typing. + ;; FIXME: Instead of this being moot, make this + ;; predicate test for whether an entry has local + ;; properties when no arguments are given. + (list 'property "")) + (`(,predicate-names ,property ,value . ,plist) ;; 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). From 3d3d958d20a47365262b8ca738dafcd851ce424e Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Fri, 9 Dec 2022 20:21:23 -0600 Subject: [PATCH 046/224] Meta: Test on CI with Emacs 28.1 and 28.2 --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bbedb2e..87bc281 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -44,6 +44,8 @@ jobs: - 26.3 - 27.1 - 27.2 + - 28.1 + - 28.2 - snapshot steps: - uses: purcell/setup-emacs@master From d253b123cf5bf869857ef978e40e2d42c2d301f4 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Fri, 9 Dec 2022 20:33:01 -0600 Subject: [PATCH 047/224] Docs: Add credits for v0.7-pre --- README.org | 3 +++ org-ql.info | 64 +++++++++++++++++++++++++++++------------------------ 2 files changed, 38 insertions(+), 29 deletions(-) diff --git a/README.org b/README.org index aa0fa6f..2817dcc 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: + Certain query predicates, when called multiple times in an ~and~ sub-expression, are optimized to a single call. + Use ~buffer-chars-modified-tick~ instead of ~buffer-modified-tick~. (Thanks to [[https://github.com/yantar92][Ihor Radchenko]].) +*Credits* ++ Thanks to [[https://github.com/chasecaleb][Caleb Chase]] for help with [[https://github.com/alphapapa/org-ql/pull/285][#285]], fixed in [[https://github.com/alphapapa/org-ql/commit/91908186fcca4b5fd2e9d26da5bc0375c2b41acf][9190818]]. + ** 0.6.3 *Fixed* diff --git a/org-ql.info b/org-ql.info index 811d918..0fd3b9f 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1057,6 +1057,12 @@ File: README.info, Node: 07-pre, Next: 063, Up: Changelog • Use ‘buffer-chars-modified-tick’ instead of ‘buffer-modified-tick’. (Thanks to Ihor Radchenko (https://github.com/yantar92).) + *Credits* + • Thanks to Caleb Chase (https://github.com/chasecaleb) for help with + #285 (https://github.com/alphapapa/org-ql/pull/285), fixed in + 9190818 + (https://github.com/alphapapa/org-ql/commit/91908186fcca4b5fd2e9d26da5bc0375c2b41acf). +  File: README.info, Node: 063, Next: 062, Prev: 07-pre, Up: Changelog @@ -1718,35 +1724,35 @@ Node: Links37140 Node: Tips37827 Node: Changelog38151 Node: 07-pre38934 -Node: 06340948 -Node: 06241483 -Node: 06141788 -Node: 0642356 -Node: 05245410 -Node: 05145710 -Node: 0546133 -Node: 04947662 -Node: 04847942 -Node: 04748291 -Node: 04648700 -Node: 04549108 -Node: 04449469 -Node: 04349828 -Node: 04250031 -Node: 04150192 -Node: 0450439 -Node: 03254540 -Node: 03154943 -Node: 0355140 -Node: 02358440 -Node: 02258674 -Node: 02158954 -Node: 0259159 -Node: 0163237 -Node: Notes63338 -Node: Comparison with Org Agenda searches63500 -Node: org-sidebar64389 -Node: License64668 +Node: 06341209 +Node: 06241744 +Node: 06142049 +Node: 0642617 +Node: 05245671 +Node: 05145971 +Node: 0546394 +Node: 04947923 +Node: 04848203 +Node: 04748552 +Node: 04648961 +Node: 04549369 +Node: 04449730 +Node: 04350089 +Node: 04250292 +Node: 04150453 +Node: 0450700 +Node: 03254801 +Node: 03155204 +Node: 0355401 +Node: 02358701 +Node: 02258935 +Node: 02159215 +Node: 0259420 +Node: 0163498 +Node: Notes63599 +Node: Comparison with Org Agenda searches63761 +Node: org-sidebar64650 +Node: License64929  End Tag Table From 8dae879841dcade01b51c34c1bb6bc75411dac11 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sun, 25 Dec 2022 12:05:52 -0600 Subject: [PATCH 048/224] Change: (org-ql-defpred) Ensure aliased predicates have normalizers Would have prevented me from releasing the "c" alias for "category" without a normalizer. --- org-ql.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/org-ql.el b/org-ql.el index 7396e5d..7c9d5a9 100644 --- a/org-ql.el +++ b/org-ql.el @@ -1221,6 +1221,13 @@ It would be expanded to: normalizers)) (preambles (cl-sublis (list (cons 'predicate-names (cons 'or (--map (list 'quote it) predicate-names)))) preambles))) + ;; Ensure that a normalizer is defined if aliases are defined. + ;; (This doesn't ensure that the normalizer does what is intended, + ;; but it's at least some safeguard.) + ;; TODO: Add per-predicate test in suite to ensure that aliases + ;; are normalized to the full name. + (when (and aliases (not normalizers)) + (user-error "org-ql-defpred: Aliases defined for predicate `%s' without a normalizer (which must be used to replace aliases with the predicate's full name)" name)) `(progn (cl-defun ,fn-name ,args ,docstring ,body) ;; SOMEDAY: Use `map-elt' here, after map 2.1 can be automatically installed in CI sandbox... From 36ff9854ce4a8573386e7073fa2e8084dc06c0fe Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sun, 25 Dec 2022 12:09:50 -0600 Subject: [PATCH 049/224] Fix: (category) Add normalizer for alias --- org-ql.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/org-ql.el b/org-ql.el index 7c9d5a9..ea6aec1 100644 --- a/org-ql.el +++ b/org-ql.el @@ -1327,6 +1327,8 @@ result form." (org-ql-defpred (category c) (&rest categories) "Return non-nil if current heading is in one or more of CATEGORIES (a list of strings)." + :normalizers ((`(,predicate-names . ,rest) + `(category ,@rest))) :body (when-let ((category (org-get-category (point)))) (cl-typecase categories (null t) From 29533525c39e0e243912bb3c807412e4bc3e804e Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sun, 25 Dec 2022 17:51:00 -0600 Subject: [PATCH 050/224] Tidy: (org-ql--plist-get*) Docstring --- org-ql.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/org-ql.el b/org-ql.el index ea6aec1..ede80b5 100644 --- a/org-ql.el +++ b/org-ql.el @@ -699,7 +699,8 @@ returns nil." (user-error "Query aborted by user"))))) (defun org-ql--plist-get* (plist property) - "Return the value of PROPERTY in PLIST, or `not-found' if the property is missing." + "Return the value of PROPERTY in PLIST, or `not-found'. +Returns `not-found' if the property is missing." (if-let ((pair (plist-member plist property))) (cadr pair) 'not-found)) From a5fbb5d9767a2cb777f2cf44873b252a5d7e2931 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 9 Mar 2023 00:01:32 -0600 Subject: [PATCH 051/224] Tidy: Indentation of dash forms See, e.g. . Ultimately I'd prefer to indent with one distinguished argument, but the noise it causes downstream is likely not worth it. (And, unfortunately, the indentation of the built-in thread-first and thread-last forms has changed to be like this as well, which is even worse, causing 10-11 characters of extra indentation in those forms' bodies!) --- helm-org-ql.el | 8 ++-- org-ql-search.el | 10 ++--- org-ql-view.el | 92 ++++++++++++++++++++++---------------------- org-ql.el | 52 ++++++++++++------------- tests/test-org-ql.el | 6 +-- 5 files changed, 84 insertions(+), 84 deletions(-) diff --git a/helm-org-ql.el b/helm-org-ql.el index 38b9722..02eff9a 100644 --- a/helm-org-ql.el +++ b/helm-org-ql.el @@ -59,8 +59,8 @@ Based on `helm-map'.") (helm-make-source "Org QL Views" 'helm-source-sync :candidates (lambda () (->> org-ql-views - (-map #'car) - (-sort #'string<))) + (-map #'car) + (-sort #'string<))) :action (list (cons "Show view" #'org-ql-view))) "Helm source for `org-ql-views'.") @@ -209,8 +209,8 @@ WINDOW-WIDTH should be the width of the Helm window." (width (- window-width (length prefix))) (heading (org-get-heading t)) (path (-> (org-get-outline-path) - (org-format-outline-path width nil "") - (org-split-string ""))) + (org-format-outline-path width nil "") + (org-split-string ""))) (path (if helm-org-ql-reverse-paths (concat heading "\\" (s-join "\\" (nreverse path))) (concat (s-join "/" path) "/" heading)))) diff --git a/org-ql-search.el b/org-ql-search.el index aa75656..c98f1e4 100644 --- a/org-ql-search.el +++ b/org-ql-search.el @@ -233,9 +233,9 @@ automatically from the query." ;; `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) + (-map #'org-ql-view--format-element) + org-agenda-finalize-entries + insert) (insert "\n")))) ;;;###autoload @@ -355,8 +355,8 @@ For example, an org-ql dynamic block header could look like: When RECURSE is non-nil, recurse into subdirectories. When REGEXP is non-nil, only return files that match REGEXP." (let ((files (->> directories - (--map (f-files it nil recurse)) - -flatten))) + (--map (f-files it nil recurse)) + -flatten))) (if regexp (--select (string-match regexp it) files) diff --git a/org-ql-view.el b/org-ql-view.el index 74f74d9..13cde85 100644 --- a/org-ql-view.el +++ b/org-ql-view.el @@ -153,11 +153,11 @@ See info node `(elisp)Cyclic Window Ordering'." (interactive) (let* ((ts (ts-now)) (beg-of-week (->> ts - (ts-adjust 'day (- (ts-dow (ts-now)))) - (ts-apply :hour 0 :minute 0 :second 0))) + (ts-adjust 'day (- (ts-dow (ts-now)))) + (ts-apply :hour 0 :minute 0 :second 0))) (end-of-week (->> ts - (ts-adjust 'day (- 6 (ts-dow (ts-now)))) - (ts-apply :hour 23 :minute 59 :second 59)))) + (ts-adjust 'day (- 6 (ts-dow (ts-now)))) + (ts-apply :hour 23 :minute 59 :second 59)))) (org-ql-search (org-agenda-files) `(ts-active :from ,beg-of-week :to ,end-of-week) @@ -170,11 +170,11 @@ See info node `(elisp)Cyclic Window Ordering'." (interactive) (let* ((ts (ts-adjust 'day 7 (ts-now))) (beg-of-week (->> ts - (ts-adjust 'day (- (ts-dow (ts-now)))) - (ts-apply :hour 0 :minute 0 :second 0))) + (ts-adjust 'day (- (ts-dow (ts-now)))) + (ts-apply :hour 0 :minute 0 :second 0))) (end-of-week (->> ts - (ts-adjust 'day (- 6 (ts-dow (ts-now)))) - (ts-apply :hour 23 :minute 59 :second 59)))) + (ts-adjust 'day (- 6 (ts-dow (ts-now)))) + (ts-apply :hour 23 :minute 59 :second 59)))) (org-ql-search (org-agenda-files) `(ts-active :from ,beg-of-week :to ,end-of-week) @@ -272,8 +272,8 @@ TYPE may be `ts', `ts-active', `ts-inactive', `clocked', or `closed'." (interactive (list :num-days (read-number "Days: ") :type (->> '(ts ts-active ts-inactive clocked closed) - (completing-read "Timestamp type: ") - intern))) + (completing-read "Timestamp type: ") + intern))) ;; It doesn't make much sense to use other date-based selectors to ;; look into the past, so to prevent confusion, we won't allow them. (-let* ((query (pcase-exhaustive type @@ -395,12 +395,12 @@ update search arguments." (let ((inhibit-read-only t)) (erase-buffer) (->> org-ql-views - (-map #'car) - (-sort (if org-ql-view-sidebar-sort-views - #'string< - #'ignore)) - (s-join "\n") - insert)) + (-map #'car) + (-sort (if org-ql-view-sidebar-sort-views + #'string< + #'ignore)) + (s-join "\n") + insert)) (current-buffer))) (defvar bookmark-make-record-function) @@ -469,8 +469,8 @@ If TITLE, prepend it to the header." (format "%s" (org-ql-view--contract-buffers-files buffers-files)))) (buffers-files-formatted (when buffers-files-formatted (propertize (->> buffers-files-formatted - (org-ql-view--font-lock-string 'emacs-lisp-mode) - (s-truncate available-width)) + (org-ql-view--font-lock-string 'emacs-lisp-mode) + (s-truncate available-width)) 'help-echo buffers-files-formatted)))) (concat title (when query (propertize "Query:" 'face 'transient-argument)) @@ -750,8 +750,8 @@ When opened, the link searches the buffer it's opened from." (s-truncate (- (window-width) 15) (concat (propertize key 'face 'transient-argument) ": " (->> value - org-ql-view--format-query - (org-ql-view--font-lock-string 'emacs-lisp-mode))))) + org-ql-view--format-query + (org-ql-view--font-lock-string 'emacs-lisp-mode))))) (transient-define-infix org-ql-view--transient-title () ;; TODO: Add an asterisk or something when the view has been modified but not saved. @@ -850,8 +850,8 @@ 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) + (org-link-display-format it))) (todo-keyword (-some--> (org-element-property :todo-keyword element) (org-ql-view--add-todo-face it))) (tag-list (if org-use-tag-inheritance @@ -872,9 +872,9 @@ return an empty string." (org-element-property :tags element))) (tag-string (when tag-list (--> tag-list - (s-join ":" it) - (s-wrap it ":") - (org-add-props it nil 'face 'org-tag)))) + (s-join ":" it) + (s-wrap it ":") + (org-add-props it nil 'face 'org-tag)))) ;; (category (org-element-property :category element)) (priority-string (-some->> (org-element-property :priority element) (char-to-string) @@ -890,19 +890,19 @@ return an empty string." (remove-list-of-text-properties 0 (length string) '(line-prefix) string) ;; Add all the necessary properties and faces to the whole string (--> string - ;; FIXME: Use proper prefix - (concat " " it) - (org-add-props it properties - 'org-agenda-type 'search - 'todo-state todo-keyword - 'tags tag-list - 'org-habit-p habit-property))))) + ;; FIXME: Use proper prefix + (concat " " it) + (org-add-props it properties + 'org-agenda-type 'search + 'todo-state todo-keyword + 'tags tag-list + 'org-habit-p habit-property))))) (defun org-ql-view--add-faces (element) "Return ELEMENT with deadline and scheduled faces added." (->> element - (org-ql-view--add-scheduled-face) - (org-ql-view--add-deadline-face))) + (org-ql-view--add-scheduled-face) + (org-ql-view--add-deadline-face))) (defun org-ql-view--add-priority-face (string) "Return STRING with priority face added." @@ -959,11 +959,11 @@ return an empty string." ((> today-day-number scheduled-day-number) 'org-scheduled-previously) (t 'org-scheduled))) (title (--> (org-element-property :raw-value element) - (org-add-props it nil - 'face face))) + (org-add-props it nil + 'face face))) (properties (--> (cadr element) - (plist-put it :title title) - (plist-put it :relative-due-date relative-due-date)))) + (plist-put it :title title) + (plist-put it :relative-due-date relative-due-date)))) (list (car element) properties)) ;; Not scheduled @@ -985,16 +985,16 @@ property." ;; FIXME: Unused for now: (done-p (member todo-keyword org-done-keywords)) ;; FIXME: Unused for now: (today-p (= today-day-number deadline-day-number)) (deadline-passed-fraction (--> (- deadline-day-number today-day-number) - (float it) - (/ it (max org-deadline-warning-days 1)) - (- 1 it))) + (float it) + (/ it (max org-deadline-warning-days 1)) + (- 1 it))) (face (org-agenda-deadline-face deadline-passed-fraction)) (title (--> (org-element-property :raw-value element) - (org-add-props it nil - 'face face))) + (org-add-props it nil + 'face face))) (properties (--> (cadr element) - (plist-put it :title title) - (plist-put it :relative-due-date relative-due-date)))) + (plist-put it :title title) + (plist-put it :relative-due-date relative-due-date)))) (list (car element) properties)) ;; No deadline @@ -1117,7 +1117,7 @@ The counterpart to `org-ql-view--contract-buffers-files'." "todo") nil nil (when org-ql-view-sort (prin1-to-string org-ql-view-sort))) - (--remove (equal "buffer-order" it))))) + (--remove (equal "buffer-order" it))))) (pcase input ('nil nil) ((and (pred listp) sort) diff --git a/org-ql.el b/org-ql.el index ede80b5..0015f1d 100644 --- a/org-ql.el +++ b/org-ql.el @@ -584,7 +584,7 @@ Returns cons (INHERITED-TAGS . LOCAL-TAGS)." (cond ((and (listp inherited) (listp local)) (->> (append inherited local) - -non-nil -uniq)) + -non-nil -uniq)) ((listp inherited) inherited) ((listp local) local))))) (cl-typecase org-use-tag-inheritance @@ -680,8 +680,8 @@ from within ELEMENT's buffer." ;; time? I don't know, but for now, it seems that we have to use `copy-marker'. (let* ((marker (copy-marker (org-element-property :begin element))) (properties (--> (cadr element) - (plist-put it :org-marker marker) - (plist-put it :org-hd-marker marker)))) + (plist-put it :org-marker marker) + (plist-put it :org-hd-marker marker)))) (setf (cadr element) properties) element)) @@ -922,16 +922,16 @@ value of `org-ql-predicates')." (let* ((names (--map (symbol-name (plist-get (cdr it) :name)) predicates)) (aliases (->> predicates - (--map (plist-get (cdr it) :aliases)) - -non-nil - -flatten - (-map #'symbol-name))) + (--map (plist-get (cdr it) :aliases)) + -non-nil + -flatten + (-map #'symbol-name))) (predicate-names (->> (append names aliases) - -uniq - ;; Sort the keywords longest-first to work around what seems to be an - ;; 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)))) + -uniq + ;; Sort the keywords longest-first to work around what seems to be an + ;; 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])))) (term (or (and negation (list positive-term) ;; This is a bit confusing, but it seems to work. There's probably a better way. @@ -1003,8 +1003,8 @@ manually; see the definition of `org-ql-defpred').") "Define function `org-ql--normalize-query' for PREDICATES. PREDICATES should be the value of `org-ql-predicates'." (let ((normalizer-patterns (->> predicates - (--map (plist-get (cdr it) :normalizers)) - (-flatten-n 1)))) + (--map (plist-get (cdr it) :normalizers)) + (-flatten-n 1)))) (fset 'org-ql--normalize-query (byte-compile `(lambda (query) @@ -1274,33 +1274,33 @@ result form." (when from (setq from (pcase from ((or 'today "today") (->> (ts-now) - (ts-apply :hour 0 :minute 0 :second 0))) + (ts-apply :hour 0 :minute 0 :second 0))) ((pred numberp) (->> (ts-now) - (ts-adjust 'day from) - (ts-apply :hour 0 :minute 0 :second 0))) + (ts-adjust 'day from) + (ts-apply :hour 0 :minute 0 :second 0))) ((and (pred stringp) (guard (ignore-errors (cl-parse-integer from)))) ;; The `pcase' `let' pattern doesn't bind values in the ;; body forms, so we have to parse the integer again. (->> (ts-now) - (ts-adjust 'day (cl-parse-integer from)) - (ts-apply :hour 0 :minute 0 :second 0))) + (ts-adjust 'day (cl-parse-integer from)) + (ts-apply :hour 0 :minute 0 :second 0))) ((pred stringp) (ts-parse-fill 'begin from)) ((pred ts-p) from)))) (when to (setq to (pcase to ((or 'today "today") (->> (ts-now) - (ts-apply :hour 23 :minute 59 :second 59))) + (ts-apply :hour 23 :minute 59 :second 59))) ((pred numberp) (->> (ts-now) - (ts-adjust 'day to) - (ts-apply :hour 23 :minute 59 :second 59))) + (ts-adjust 'day to) + (ts-apply :hour 23 :minute 59 :second 59))) ((and (pred stringp) (guard (ignore-errors (cl-parse-integer to)))) ;; The `pcase' `let' pattern doesn't bind values in the ;; body forms, so we have to parse the integer again. (->> (ts-now) - (ts-adjust 'day (cl-parse-integer to)) - (ts-apply :hour 23 :minute 59 :second 59))) + (ts-adjust 'day (cl-parse-integer to)) + (ts-apply :hour 23 :minute 59 :second 59))) ((pred stringp) (ts-parse-fill 'end to)) ((pred ts-p) to)))) (setf result (progn ,@body)) @@ -2219,8 +2219,8 @@ non-nil if entry has a deadline." :normalizers ((`(,predicate-names auto . ,rest) ;; Use `org-deadline-warning-days' as the :to arg. (let ((ts (->> (ts-now) - (ts-adjust 'day org-deadline-warning-days) - (ts-apply :hour 23 :minute 59 :second 59)))) + (ts-adjust 'day org-deadline-warning-days) + (ts-apply :hour 23 :minute 59 :second 59)))) `(deadline-warning :to ,ts ,@rest))) (`(,predicate-names . ,(and rest (guard (numberp (car rest))))) (org-ql--normalize-from-to-on diff --git a/tests/test-org-ql.el b/tests/test-org-ql.el index 25ac617..fbccd80 100644 --- a/tests/test-org-ql.el +++ b/tests/test-org-ql.el @@ -105,9 +105,9 @@ Set at runtime by test suite.") "Return buffer visiting FILENAME. FILENAME should be a file in the \"tests\" directory." (->> (locate-dominating-file default-directory ".git") - (expand-file-name "tests") - (expand-file-name filename) - find-file-noselect)) + (expand-file-name "tests") + (expand-file-name filename) + find-file-noselect)) ;;;; Macros From 6c9c0b957abd21df57f1885032847a721c3e859f Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 9 Mar 2023 00:05:14 -0600 Subject: [PATCH 052/224] Tests: Rename data2.org to data-file-tags.org It appears likely that we'll need a few test-specific data files, so we should use descriptive names. --- tests/{data2.org => data-file-tags.org} | 0 tests/test-org-ql.el | 18 +++++++++--------- 2 files changed, 9 insertions(+), 9 deletions(-) rename tests/{data2.org => data-file-tags.org} (100%) diff --git a/tests/data2.org b/tests/data-file-tags.org similarity index 100% rename from tests/data2.org rename to tests/data-file-tags.org diff --git a/tests/test-org-ql.el b/tests/test-org-ql.el index fbccd80..5210a7c 100644 --- a/tests/test-org-ql.el +++ b/tests/test-org-ql.el @@ -1409,10 +1409,10 @@ with keyword arg NOW in PLIST." (org-ql-it "with file tags" (org-ql-expect ('(tags "food")) '("Fruit" "Blueberry" "Strawberry" "Vegetable" "Broccoli" "Potato") - :buffer (org-ql-test-data-buffer "data2.org")) + :buffer (org-ql-test-data-buffer "data-file-tags.org")) (org-ql-expect ('(tags "fruit")) '("Fruit" "Blueberry" "Strawberry") - :buffer (org-ql-test-data-buffer "data2.org")))) + :buffer (org-ql-test-data-buffer "data-file-tags.org")))) (describe "(tags-inherited)" @@ -1440,10 +1440,10 @@ with keyword arg NOW in PLIST." (org-ql-it "with file tags" (org-ql-expect ('(tags-inherited "food")) '("Fruit" "Blueberry" "Strawberry" "Vegetable" "Broccoli" "Potato") - :buffer (org-ql-test-data-buffer "data2.org")) + :buffer (org-ql-test-data-buffer "data-file-tags.org")) (org-ql-expect ('(tags-inherited "fruit")) '("Blueberry" "Strawberry") - :buffer (org-ql-test-data-buffer "data2.org")))) + :buffer (org-ql-test-data-buffer "data-file-tags.org")))) (describe "(tags-local)" @@ -1470,10 +1470,10 @@ with keyword arg NOW in PLIST." (org-ql-it "with file tags" (org-ql-expect ('(tags-local "food")) nil - :buffer (org-ql-test-data-buffer "data2.org")) + :buffer (org-ql-test-data-buffer "data-file-tags.org")) (org-ql-expect ('(tags-local "fruit")) '("Fruit") - :buffer (org-ql-test-data-buffer "data2.org")))) + :buffer (org-ql-test-data-buffer "data-file-tags.org")))) (describe "(tags-all), (tags&)" @@ -1486,7 +1486,7 @@ with keyword arg NOW in PLIST." (org-ql-it "with file tags" (org-ql-expect ('(tags-all "food" "fruit")) '("Fruit" "Blueberry" "Strawberry") - :buffer (org-ql-test-data-buffer "data2.org")))) + :buffer (org-ql-test-data-buffer "data-file-tags.org")))) (describe "(tags-regexp), (tags*)" @@ -1511,10 +1511,10 @@ with keyword arg NOW in PLIST." (org-ql-it "with regexp matching file tags" (org-ql-expect ('(tags-regexp "foo")) '("Fruit" "Blueberry" "Strawberry" "Vegetable" "Broccoli" "Potato") - :buffer (org-ql-test-data-buffer "data2.org")) + :buffer (org-ql-test-data-buffer "data-file-tags.org")) (org-ql-expect ('(tags* "frui")) '("Fruit" "Blueberry" "Strawberry") - :buffer (org-ql-test-data-buffer "data2.org")))) + :buffer (org-ql-test-data-buffer "data-file-tags.org")))) (describe "(ts)" From 0304a2c9dcfb32a4ef9794a59d6466ddda92c21a Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 9 Mar 2023 00:52:47 -0600 Subject: [PATCH 053/224] Tests: (org-ql-it) Expand using Buttercup's it As the implementation of `it' changes, this will change with it (correctly). --- tests/test-org-ql.el | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/tests/test-org-ql.el b/tests/test-org-ql.el index 5210a7c..9fd9315 100644 --- a/tests/test-org-ql.el +++ b/tests/test-org-ql.el @@ -112,20 +112,17 @@ FILENAME should be a file in the \"tests\" directory." ;;;; Macros (defmacro org-ql-it (description &rest body) - "Expand to two specs, one of which tests with preambles and the other without. -Based on Buttercup macro `it'." + "Expand to two specs, one of which tests with preambles and the other without." (declare (indent 1) (debug (&define sexp def-body))) - (if body - `(progn - (buttercup-it ,(concat description " (preamble) ") - (lambda () - (let ((org-ql-use-preamble t)) - ,@body))) - (buttercup-it ,(concat description " (no preamble)") - (lambda () - (let ((org-ql-use-preamble nil)) - ,@body)))) - `(buttercup-xit ,description))) + `(progn + (it ,(concat description " (preamble) ") + ,(when body + `(let ((org-ql-use-preamble t)) + ,@body))) + (it ,(concat description " (no preamble) ") + ,(when body + `(let ((org-ql-use-preamble nil)) + ,@body)))) ) (cl-defmacro org-ql-expect (ql-args results &key (buffer 'org-ql-test-buffer)) "Expand to `expect' test form that expects QL-ARGS to equal RESULTS. From 1996969920a58259439e8a4baa446264008430ce Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 9 Mar 2023 01:41:01 -0600 Subject: [PATCH 054/224] Fix: (src) Rewrite body Fixes #304. Thanks to @johanwk for reporting. --- README.org | 1 + org-ql.el | 36 ++++++++++++++++-------------------- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/README.org b/README.org index 2817dcc..4935af9 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: *Fixed* + Predicate ~src~'s matching of begin/end block lines, normalization of arguments, and handling in non-sexp queries. ++ Predicate ~src~'s behavior with various arguments. *Internal* + Certain query predicates, when called multiple times in an ~and~ sub-expression, are optimized to a single call. diff --git a/org-ql.el b/org-ql.el index 0015f1d..d602e60 100644 --- a/org-ql.el +++ b/org-ql.el @@ -1925,26 +1925,22 @@ language. Matching is done case-insensitively." ;; Always check contents with predicate. :query query))) :body - (catch 'return - (save-excursion - (save-match-data - (when (re-search-forward org-babel-src-block-regexp (org-entry-end-position) t) - (when lang - (unless (string= lang (match-string 2)) - (throw 'return nil))) - (if regexps - (let ((contents-beg (progn - (goto-char (match-beginning 0)) - (forward-line 1) - (point))) - (contents-end (progn - (goto-char (match-end 0)) - (point-at-bol)))) - (cl-loop for re in regexps - do (goto-char contents-beg) - always (re-search-forward re contents-end t))) - ;; No regexps to check: return non-nil. - t)))))) + (save-excursion + (save-match-data + (cl-loop while (re-search-forward org-babel-src-block-regexp (org-entry-end-position) t) + thereis (when (or (not lang) (equal lang (match-string 2))) + (or (not regexps) + (save-excursion + (let ((contents-beg (progn + (goto-char (match-beginning 0)) + (forward-line 1) + (point))) + (contents-end (progn + (goto-char (match-end 0)) + (point-at-bol)))) + (cl-loop for re in regexps + do (goto-char contents-beg) + always (re-search-forward re contents-end t)))))))))) (org-ql-defpred (tags) (&rest tags) "Return non-nil if current heading has one or more of TAGS (a list of strings). From 1fdad05fef83f6c2fea1eb75231fde5267d56908 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 9 Mar 2023 01:42:49 -0600 Subject: [PATCH 055/224] Tests: Tidy --- 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 9fd9315..3c44f38 100644 --- a/tests/test-org-ql.el +++ b/tests/test-org-ql.el @@ -161,7 +161,7 @@ with keyword arg NOW in PLIST." (substring-no-properties (org-get-heading t t))) (defun org-ql-test-org-get-heading () ;; For Org 9.1.9. - (substring-no-properties (org-get-heading t t t t)))) + (substring-no-properties (org-get-heading t t t t)))) ) (setq org-ql-test-buffer (org-ql-test-data-buffer "data.org") ;; For manual testing: From 2ae60f8dc50cf2a156a3ca7ec929d19909139097 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 9 Mar 2023 01:44:20 -0600 Subject: [PATCH 056/224] Tests: (src) More normal forms --- tests/test-org-ql.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test-org-ql.el b/tests/test-org-ql.el index 3c44f38..3750798 100644 --- a/tests/test-org-ql.el +++ b/tests/test-org-ql.el @@ -328,7 +328,10 @@ with keyword arg NOW in PLIST." (expect (org-ql--normalize-query '(src :regexps ("foo") :lang "bar")) :to-equal '(src :lang "bar" :regexps '("foo"))) (expect (org-ql--normalize-query '(src :regexps ("foo") :lang)) - :to-equal '(src :regexps '("foo"))))) + :to-equal '(src :regexps '("foo")))) + (it "normalizes just the :lang keyword arg" + (expect (org-ql--normalize-query '(src :lang "bar")) + :to-equal '(src :lang "bar" :regexps 'nil)))) (describe "(tags-inherited)" (it "handles 0 arguments" From 68ac6ddd28b46f4eead9108566c9bc4b545fa2e5 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 9 Mar 2023 01:44:44 -0600 Subject: [PATCH 057/224] Tests: Use before-each for org-ql-test-data-buffer This seems like the best way. --- tests/test-org-ql.el | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test-org-ql.el b/tests/test-org-ql.el index 3750798..f762231 100644 --- a/tests/test-org-ql.el +++ b/tests/test-org-ql.el @@ -163,6 +163,7 @@ with keyword arg NOW in PLIST." ;; For Org 9.1.9. (substring-no-properties (org-get-heading t t t t)))) ) + (before-each (setq org-ql-test-buffer (org-ql-test-data-buffer "data.org") ;; For manual testing: ;; org-ql-test-buffer (find-file-noselect "data.org") From d784f8f71c8d6dd1c0f39955046848f61be951e5 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 9 Mar 2023 01:45:03 -0600 Subject: [PATCH 058/224] Tests: (src) Implement --- README.org | 1 + tests/data-src.org | 29 +++++++++++++++++++++++++++++ tests/test-org-ql.el | 42 +++++++++++++++++++++++++++++++++++++++--- 3 files changed, 69 insertions(+), 3 deletions(-) create mode 100644 tests/data-src.org diff --git a/README.org b/README.org index 4935af9..8f8e751 100644 --- a/README.org +++ b/README.org @@ -563,6 +563,7 @@ Simple links may also be written manually in either sexp or non-sexp form, like: *Internal* + Certain query predicates, when called multiple times in an ~and~ sub-expression, are optimized to a single call. + Use ~buffer-chars-modified-tick~ instead of ~buffer-modified-tick~. (Thanks to [[https://github.com/yantar92][Ihor Radchenko]].) ++ Implemented tests for ~src~ predicate. *Credits* + Thanks to [[https://github.com/chasecaleb][Caleb Chase]] for help with [[https://github.com/alphapapa/org-ql/pull/285][#285]], fixed in [[https://github.com/alphapapa/org-ql/commit/91908186fcca4b5fd2e9d26da5bc0375c2b41acf][9190818]]. diff --git a/tests/data-src.org b/tests/data-src.org new file mode 100644 index 0000000..20f75a8 --- /dev/null +++ b/tests/data-src.org @@ -0,0 +1,29 @@ +#+title: org-ql test data for ~src~ predicate + +* Alpha + +#+begin_src elisp + (message "foo") +#+end_src + +#+begin_src python + print("foo") +#+end_src + +#+begin_src js + console.log("foo") +#+end_src + +* Bravo + +#+begin_src elisp + (message "bar") +#+end_src + +#+begin_src python + print("bar") +#+end_src + +* Charlie + +This entry has no source block. diff --git a/tests/test-org-ql.el b/tests/test-org-ql.el index f762231..bac29be 100644 --- a/tests/test-org-ql.el +++ b/tests/test-org-ql.el @@ -1367,9 +1367,45 @@ with keyword arg NOW in PLIST." (org-ql-expect ('(scheduled :on 0)) '("Practice leaping tall buildings in a single bound" "Order a pizza" "Get haircut" "Fix flux capacitor" "Shop for groceries" "Rewrite Emacs in Common Lisp"))))) - ;; ;; TODO: Test (src) predicate. That will require modifying test data, which will be a - ;; ;; significant hassle. Manual testing shows that the predicate appears to work properly. - ;; + (describe "(src)" + (before-each + ;; It would seem preferable to use :var for this, but this seems more reliable. + (setq org-ql-test-buffer (org-ql-test-data-buffer "data-src.org"))) + + (org-ql-it "without arguments" + (org-ql-expect ('(src)) + '("Alpha" "Bravo"))) + + (org-ql-it "with plain argument" + ;; Finds in first source block in entry. + (org-ql-expect ('(src "foo")) + '("Alpha")) + (org-ql-expect ('(src "bar")) + '("Bravo")) + (org-ql-expect ('(src "print")) + ;; Finds in subsequent source block in entry. + '("Alpha" "Bravo"))) + + (org-ql-it "with :regexps argument" + (org-ql-expect ('(src :regexps ("foo"))) + '("Alpha")) + (org-ql-expect ('(src :regexps ("bar"))) + '("Bravo")) + (org-ql-expect ('(src :regexps ("print" "foo"))) + '("Alpha")) + (org-ql-expect ('(src :regexps ("foo" "bar"))) + nil)) + + (org-ql-it "with :lang argument" + ;; Finds in first source block in entry. + (org-ql-expect ('(src :lang "elisp")) + '("Alpha" "Bravo")) + ;; Finds in subsequent source block in entry. + (org-ql-expect ('(src :lang "python")) + '("Alpha" "Bravo")) + (org-ql-expect ('(src :lang "js")) + '("Alpha")))) + (describe "(todo)" (org-ql-it "without arguments" From 0d9940c5df02ee51aa307b45b5068f016cc4cb7a Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 9 Mar 2023 01:45:28 -0600 Subject: [PATCH 059/224] Docs: Update README --- org-ql.info | 60 +++++++++++++++++++++++++++-------------------------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/org-ql.info b/org-ql.info index 0fd3b9f..14a562c 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1050,12 +1050,14 @@ File: README.info, Node: 07-pre, Next: 063, Up: Changelog *Fixed* • Predicate ‘src’’s matching of begin/end block lines, normalization of arguments, and handling in non-sexp queries. + • Predicate ‘src’’s behavior with various arguments. *Internal* • Certain query predicates, when called multiple times in an ‘and’ sub-expression, are optimized to a single call. • Use ‘buffer-chars-modified-tick’ instead of ‘buffer-modified-tick’. (Thanks to Ihor Radchenko (https://github.com/yantar92).) + • Implemented tests for ‘src’ predicate. *Credits* • Thanks to Caleb Chase (https://github.com/chasecaleb) for help with @@ -1724,35 +1726,35 @@ Node: Links37140 Node: Tips37827 Node: Changelog38151 Node: 07-pre38934 -Node: 06341209 -Node: 06241744 -Node: 06142049 -Node: 0642617 -Node: 05245671 -Node: 05145971 -Node: 0546394 -Node: 04947923 -Node: 04848203 -Node: 04748552 -Node: 04648961 -Node: 04549369 -Node: 04449730 -Node: 04350089 -Node: 04250292 -Node: 04150453 -Node: 0450700 -Node: 03254801 -Node: 03155204 -Node: 0355401 -Node: 02358701 -Node: 02258935 -Node: 02159215 -Node: 0259420 -Node: 0163498 -Node: Notes63599 -Node: Comparison with Org Agenda searches63761 -Node: org-sidebar64650 -Node: License64929 +Node: 06341323 +Node: 06241858 +Node: 06142163 +Node: 0642731 +Node: 05245785 +Node: 05146085 +Node: 0546508 +Node: 04948037 +Node: 04848317 +Node: 04748666 +Node: 04649075 +Node: 04549483 +Node: 04449844 +Node: 04350203 +Node: 04250406 +Node: 04150567 +Node: 0450814 +Node: 03254915 +Node: 03155318 +Node: 0355515 +Node: 02358815 +Node: 02259049 +Node: 02159329 +Node: 0259534 +Node: 0163612 +Node: Notes63713 +Node: Comparison with Org Agenda searches63875 +Node: org-sidebar64764 +Node: License65043  End Tag Table From 8bb17396615c18ff820d1c8aa8b86aacb77ca871 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 9 Mar 2023 01:47:53 -0600 Subject: [PATCH 060/224] Tests: (src) Normalization with no args Closes #293. Thanks to Akira Komamura (@akirak) for reporting. --- README.org | 2 +- org-ql.info | 61 ++++++++++++++++++++++---------------------- tests/test-org-ql.el | 3 +++ 3 files changed, 35 insertions(+), 31 deletions(-) diff --git a/README.org b/README.org index 8f8e751..3e57404 100644 --- a/README.org +++ b/README.org @@ -557,7 +557,7 @@ Simple links may also be written manually in either sexp or non-sexp form, like: + Predicate ~src~ now matches case-insensitively. *Fixed* -+ Predicate ~src~'s matching of begin/end block lines, normalization of arguments, and handling in non-sexp queries. ++ Predicate ~src~'s matching of begin/end block lines, normalization of arguments, and handling in non-sexp queries. (Thanks to [[https://github.com/akirak][Akira Komamura]] for reporting.) + Predicate ~src~'s behavior with various arguments. *Internal* diff --git a/org-ql.info b/org-ql.info index 14a562c..caee1f6 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1049,7 +1049,8 @@ File: README.info, Node: 07-pre, Next: 063, Up: Changelog *Fixed* • Predicate ‘src’’s matching of begin/end block lines, normalization - of arguments, and handling in non-sexp queries. + of arguments, and handling in non-sexp queries. (Thanks to Akira + Komamura (https://github.com/akirak) for reporting.) • Predicate ‘src’’s behavior with various arguments. *Internal* @@ -1726,35 +1727,35 @@ Node: Links37140 Node: Tips37827 Node: Changelog38151 Node: 07-pre38934 -Node: 06341323 -Node: 06241858 -Node: 06142163 -Node: 0642731 -Node: 05245785 -Node: 05146085 -Node: 0546508 -Node: 04948037 -Node: 04848317 -Node: 04748666 -Node: 04649075 -Node: 04549483 -Node: 04449844 -Node: 04350203 -Node: 04250406 -Node: 04150567 -Node: 0450814 -Node: 03254915 -Node: 03155318 -Node: 0355515 -Node: 02358815 -Node: 02259049 -Node: 02159329 -Node: 0259534 -Node: 0163612 -Node: Notes63713 -Node: Comparison with Org Agenda searches63875 -Node: org-sidebar64764 -Node: License65043 +Node: 06341399 +Node: 06241934 +Node: 06142239 +Node: 0642807 +Node: 05245861 +Node: 05146161 +Node: 0546584 +Node: 04948113 +Node: 04848393 +Node: 04748742 +Node: 04649151 +Node: 04549559 +Node: 04449920 +Node: 04350279 +Node: 04250482 +Node: 04150643 +Node: 0450890 +Node: 03254991 +Node: 03155394 +Node: 0355591 +Node: 02358891 +Node: 02259125 +Node: 02159405 +Node: 0259610 +Node: 0163688 +Node: Notes63789 +Node: Comparison with Org Agenda searches63951 +Node: org-sidebar64840 +Node: License65119  End Tag Table diff --git a/tests/test-org-ql.el b/tests/test-org-ql.el index bac29be..c884971 100644 --- a/tests/test-org-ql.el +++ b/tests/test-org-ql.el @@ -325,6 +325,9 @@ with keyword arg NOW in PLIST." (it "normalizes non-keyword args with a :lang keyword arg to keywords" (expect (org-ql--normalize-query '(src "foo" "bar" :lang "baz")) :to-equal '(src :lang "baz" :regexps '("foo" "bar")))) + (it "normalizes zero args without looping" + (expect (org-ql--normalize-query '(src)) + :to-equal '(src))) (it "normalizes all-keyword args without looping" (expect (org-ql--normalize-query '(src :regexps ("foo") :lang "bar")) :to-equal '(src :lang "bar" :regexps '("foo"))) From 2bc327d85f48d314890239cd50b37585ffadcff6 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 9 Mar 2023 02:35:00 -0600 Subject: [PATCH 061/224] Fix: (org-ql-view--link-store) Error message for test suite Use format string to prevent `substitute-quotes' from changing the error string, breaking the test suite when run on CI. Fixes #317. --- org-ql-view.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org-ql-view.el b/org-ql-view.el index 13cde85..95dfe3b 100644 --- a/org-ql-view.el +++ b/org-ql-view.el @@ -672,7 +672,7 @@ When opened, the link searches the buffer it's opened from." (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 "Views that search non-file-backed buffers can't be linked to")) + (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) it (org-ql-view--format-query org-ql-view-query))) (buffers-files (prompt-for (org-ql-view--contract-buffers-files org-ql-view-buffers-files))) From 5c5a15a09b5fe0773fabbdc2f55643e9d4b5e847 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 9 Mar 2023 02:47:23 -0600 Subject: [PATCH 062/224] Fix: (org-ql--sanity-check-form) Use pcase --- org-ql.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org-ql.el b/org-ql.el index d602e60..1043809 100644 --- a/org-ql.el +++ b/org-ql.el @@ -768,7 +768,7 @@ be coalesced." "Signal error if any forms in FORM do not have preconditions met. Or, when possible, fix the problem." (cl-flet ((check (symbol) - (cl-case 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?")))))) From d86a402ba5bf549ea5100c11aec2df32cd91d50c Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 9 Mar 2023 03:04:15 -0600 Subject: [PATCH 063/224] Tidy: Docstrings --- org-ql-search.el | 27 ++++++++++++++++++--------- org-ql.el | 41 ++++++++++++++++++++++++++--------------- 2 files changed, 44 insertions(+), 24 deletions(-) diff --git a/org-ql-search.el b/org-ql-search.el index c98f1e4..1d47be3 100644 --- a/org-ql-search.el +++ b/org-ql-search.el @@ -50,7 +50,7 @@ ;;;; Variables (defvar org-ql-block-header nil - "An optional string to override the default header in `org-ql-block' agenda blocks.") + "Optional string overriding default header in `org-ql-block' agenda blocks.") ;;;; Customization @@ -277,13 +277,16 @@ Valid parameters include: :ts-format Optional format string used to format timestamp-based columns. -For example, an org-ql dynamic block header could look like: +For example, an org-ql dynamic block header could look like +this (must be a single line in the Org buffer): - #+BEGIN: org-ql :query (todo \"UNDERWAY\") :columns (priority todo heading) :sort (priority date) :ts-format \"%Y-%m-%d %H:%M\"" + #+BEGIN: org-ql :query (todo \"UNDERWAY\") +:columns (priority todo heading) :sort (priority date) +:ts-format \"%Y-%m-%d %H:%M\"" (-let* (((&plist :query :columns :sort :ts-format :take) params) (query (cl-etypecase query (string (org-ql--query-string-to-sexp query)) - (list ;; SAFETY: Query is in sexp form: ask for confirmation, because it could contain arbitrary code. + (list ;; SAFETY: Query is in sexp form: ask for confirmation, because it could contain arbitrary code. (org-ql--ask-unsafe-query query) query))) (columns (or columns '(heading todo (priority "P")))) @@ -337,7 +340,7 @@ For example, an org-ql dynamic block header could look like: columns) " | ") " |" "\n") - (insert "|- \n") ; Separator hline + (insert "|- \n") ; Separator hline (dolist (element elements) (insert "| " (format-element element) " |" "\n")) (delete-char -1) @@ -345,13 +348,19 @@ For example, an org-ql dynamic block header could look like: ;;;; Functions +(defvar org-ql-search-directories-files-error + ;; Workaround to silence byte-compiler which thinks having this string in an + ;; argument's default value form is a too-long docstring. + "No DIRECTORIES given, and `org-directory' doesn't exist") + (cl-defun org-ql-search-directories-files - (&key (directories (if (file-exists-p org-directory) - (list org-directory) - (user-error "Org-ql-search-directories-files: No DIRECTORIES given, and `org-directory' doesn't exist"))) + (&key (directories + (if (file-exists-p org-directory) + (list org-directory) + (user-error org-ql-search-directories-files-error))) (recurse org-ql-search-directories-files-recursive) (regexp org-ql-search-directories-files-regexp)) - "Return list of matching files in DIRECTORIES, a list of directory paths. + "Return list of matching files in DIRECTORIES. When RECURSE is non-nil, recurse into subdirectories. When REGEXP is non-nil, only return files that match REGEXP." (let ((files (->> directories diff --git a/org-ql.el b/org-ql.el index 1043809..22fa86f 100644 --- a/org-ql.el +++ b/org-ql.el @@ -229,7 +229,8 @@ regexps.") (group-n 1 (regexp ,org-ql-regexp-ts-inactive))) (seq (or "DEADLINE" "SCHEDULED") ":" (0+ " ") (group-n 1 (regexp ,org-ql-regexp-ts-active)))))) - "Matches CLOSED, DEADLINE or SCHEDULED keyword with timestamp, with or without time.") + "Matches CLOSED, DEADLINE or SCHEDULED keyword with timestamp. +Matches with or without time.") (defvar org-ql-regexp-planning-with-time (rx-to-string `(seq bow (or (seq "CLOSED" ":" (0+ " ") @@ -503,8 +504,14 @@ NARROW corresponds to the `org-ql-select' argument NARROW." (cl-defun org-ql--select (&key preamble preamble-case-fold predicate action narrow &allow-other-keys) - "Return results of mapping function ACTION across entries in current buffer matching function PREDICATE. -If NARROW is non-nil, buffer will not be widened." + "Return results for given arguments. +Return results of mapping function ACTION across entries in +current buffer matching function PREDICATE. If NARROW is +non-nil, buffer will not be widened. + +PREAMBLE may be a regexp to search for before calling PREDICATE. +When doing so, `case-fold-search' is bound to +PREAMBLE-CASE-FOLD." ;; Since the mappings are stored in the variable `org-ql-predicates', macros like `flet' ;; can't be used, so we do it manually (this is same as the equivalent `flet' expansion). ;; Mappings are stored in the variable because it allows predicates to be defined with a @@ -1327,7 +1334,7 @@ result form." (setf org-ql-defpred-defer t) (org-ql-defpred (category c) (&rest categories) - "Return non-nil if current heading is in one or more of CATEGORIES (a list of strings)." + "Return non-nil if current heading is in one or more of CATEGORIES." :normalizers ((`(,predicate-names . ,rest) `(category ,@rest))) :body (when-let ((category (org-get-category (point)))) @@ -1359,7 +1366,8 @@ 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. + (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\"." @@ -1492,8 +1500,10 @@ Matching is done case-insensitively." The following forms are accepted: (level NUMBER): Matches if heading level is NUMBER. - (level NUMBER NUMBER): Matches if heading level is equal to or between NUMBERs. - (level COMPARATOR NUMBER): Matches if heading level compares to NUMBER with COMPARATOR. + (level NUMBER NUMBER): Matches if heading level is equal to or between + NUMBERs. + (level COMPARATOR NUMBER): Matches if heading level compares to NUMBER with + COMPARATOR. COMPARATOR may be `<', `<=', `>', or `>='." :normalizers ((`(,predicate-names . ,args) @@ -1610,7 +1620,7 @@ any link is found." (match-string org-ql-link-description-group))))))))) (org-ql-defpred (rifle smart) (&rest strings) - "Return non-nil if each string argument is found in either the entry or its outline path. + "Return non-nil if each of strings is found in the entry or its outline path. Works like `org-rifle'. This is probably the most useful, intuitive, general-purpose predicate." ;; NOTE: This predicate advertises that it takes strings, but they @@ -1677,7 +1687,7 @@ contiguous segment of the outline path: :body (org-ql--infix-p regexps (org-ql--value-at (point) #'org-ql--outline-path))) (org-ql-defpred path (&rest regexps) - "Return non-nil if current heading's buffer's filename path matches any of REGEXPS (regexp strings). + "Return non-nil if current heading's buffer's file path matches any of REGEXPS. Without arguments, return non-nil if buffer is file-backed." ;; FIXME: This should AND the regexps together, not OR them. :body (when (buffer-file-name) @@ -1764,7 +1774,7 @@ priority B)." thereis (= item-priority (* 1000 (- org-lowest-priority (string-to-char priority-arg))))))))) (org-ql-defpred property (property &optional value &key inherit) - "Return non-nil if current entry has PROPERTY (a string), and optionally VALUE (a string). + "Return non-nil if current entry has PROPERTY, and optionally VALUE. 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 @@ -1856,7 +1866,7 @@ interpreted as nil or non-nil)." (re-search-forward regexp end t)))))) (org-ql-defpred src (&key regexps lang) - "Return non-nil if current entry contains an Org source block matching all of REGEXPS. + "Return non-nil if current entry has an Org source block matching all REGEXPS. If keyword argument LANG is non-nil, the block must be in that language. Matching is done case-insensitively." :coalesce (lambda (coalesced-args current-args) @@ -1968,7 +1978,7 @@ Tests both inherited and local tags." :body (apply #'org-ql--predicate-tags tags)) (org-ql-defpred (tags-inherited inherited-tags tags-i itags) (&rest tags) - "Return non-nil if current heading's inherited tags include one or more of TAGS (a list of strings). + "Return non-nil if current heading's inherited tags include any of TAGS. If TAGS is nil, return non-nil if heading has any inherited tags." :normalizers ((`(,predicate-names . ,tags) `(tags-inherited ,@tags))) @@ -1982,7 +1992,7 @@ If TAGS is nil, return non-nil if heading has any inherited tags." (seq-intersection tags inherited))))))) (org-ql-defpred (tags-local local-tags tags-l ltags) (&rest tags) - "Return non-nil if current heading's local tags include one or more of TAGS (a list of strings). + "Return non-nil if current heading's local tags include any of TAGS. If TAGS is nil, return non-nil if heading has any local tags." :normalizers ((`(,predicate-names . ,tags) `(tags-local ,@tags))) @@ -2025,7 +2035,7 @@ Tests both inherited and local tags." (org-ql-defpred 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)." +With KEYWORDS, return non-nil if its keyword is one of KEYWORDS." ;; TODO: Can we make a preamble for plain (todo) queries? :preambles ((`(,predicate-names . ,(and todo-keywords (guard todo-keywords))) (list :case-fold nil :regexp (rx-to-string `(seq bol (1+ "*") (1+ space) (or ,@todo-keywords) (or " " eol)) t)))) @@ -2239,7 +2249,8 @@ non-nil if entry has a deadline." (org-ql-defpred deadline-warning (&key from to) ;; TODO: Should this also accept a WITH-TIME argument? ;; MAYBE: Use the new org-ql-regexps? - "Internal predicate used to handle `org-deadline-warning-days' and deadlines with warning periods." + "Internal predicate. +Used to handle `org-deadline-warning-days' and deadlines with warning periods." :preambles ((`(,predicate-names . ,_) (list :regexp org-deadline-time-regexp :query query))) :body From d21da3682bc74195569164f06d4cb5cb2276b42e Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 9 Mar 2023 03:23:42 -0600 Subject: [PATCH 064/224] Tidy: Compilation warnings --- README.org | 1 + helm-org-ql.el | 2 ++ org-ql-completing-read.el | 1 + org-ql-find.el | 2 +- org-ql-search.el | 16 +++++++++-- org-ql-view.el | 7 +++-- org-ql.el | 21 +++++++------- org-ql.info | 59 ++++++++++++++++++++------------------- tests/test-org-ql.el | 6 +++- 9 files changed, 68 insertions(+), 47 deletions(-) diff --git a/README.org b/README.org index 3e57404..7b66d34 100644 --- a/README.org +++ b/README.org @@ -559,6 +559,7 @@ Simple links may also be written manually in either sexp or non-sexp form, like: *Fixed* + Predicate ~src~'s matching of begin/end block lines, normalization of arguments, and handling in non-sexp queries. (Thanks to [[https://github.com/akirak][Akira Komamura]] for reporting.) + Predicate ~src~'s behavior with various arguments. ++ Various compilation warnings. *Internal* + Certain query predicates, when called multiple times in an ~and~ sub-expression, are optimized to a single call. diff --git a/helm-org-ql.el b/helm-org-ql.el index 02eff9a..5d460a5 100644 --- a/helm-org-ql.el +++ b/helm-org-ql.el @@ -98,6 +98,8 @@ Based on `helm-map'.") Interactively, search the current buffer. Note that this command only accepts non-sexp, \"plain\" queries. +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 diff --git a/org-ql-completing-read.el b/org-ql-completing-read.el index 81d8557..b1ef11a 100644 --- a/org-ql-completing-read.el +++ b/org-ql-completing-read.el @@ -81,6 +81,7 @@ For an experience like `org-rifle', use a newline." (cl-defun org-ql-completing-read (buffers-files &key query-prefix query-filter (prompt "Find entry: ")) "Return marker at Org 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 the user (e.g. use \"heading:\" to only search headings, easily diff --git a/org-ql-find.el b/org-ql-find.el index d9ccad9..9483c61 100644 --- a/org-ql-find.el +++ b/org-ql-find.el @@ -55,7 +55,7 @@ See function `display-buffer'." (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. +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 diff --git a/org-ql-search.el b/org-ql-search.el index 1d47be3..f2fd953 100644 --- a/org-ql-search.el +++ b/org-ql-search.el @@ -47,6 +47,18 @@ (t (warn "org-ql: Unable to define alias `org-ql-search--link-heading-search-string'. This may affect links in dynamic blocks. Please report this as a bug.") #'identity))) +(defalias 'org-ql-search--org-make-link-string + (cond ((fboundp 'org-link-make-string) #'org-link-make-string) + ((fboundp 'org-make-link-string) #'org-make-link-string) + (t (warn "org-ql: Unable to define alias `org-ql-search--org-make-link-string'. Please report this as a bug.") + #'identity))) + +(defalias 'org-ql-search--org-link-store-props + (cond ((fboundp 'org-link-store-props) #'org-link-store-props) + ((fboundp 'org-store-link-props) #'org-store-link-props) + (t (warn "org-ql: Unable to define alias `org-ql-search--org-link-store-props'. Please report this as a bug.") + #'identity))) + ;;;; Variables (defvar org-ql-block-header nil @@ -138,7 +150,7 @@ SUPER-GROUPS: An `org-super-agenda' group set. See variable selectors'. NARROW: When non-nil, don't widen buffers before -searching. Interactively, with prefix, leave narrowed. +searching. Interactively, with prefix, leave narrowed. SORT: One or a list of `org-ql' sorting functions, like `date' or `priority' (see Info node `(org-ql)Listing / acting-on results'). @@ -299,7 +311,7 @@ this (must be a single line in the Org buffer): (cons 'heading (lambda (element) (let ((normalized-heading (org-ql-search--link-heading-search-string (org-element-property :raw-value element)))) - (org-make-link-string normalized-heading (org-link-display-format normalized-heading))))) + (org-ql-search--org-make-link-string normalized-heading (org-link-display-format normalized-heading))))) (cons 'priority (lambda (element) (--when-let (org-element-property :priority element) (char-to-string it)))) diff --git a/org-ql-view.el b/org-ql-view.el index 95dfe3b..5a03b80 100644 --- a/org-ql-view.el +++ b/org-ql-view.el @@ -44,6 +44,7 @@ ;; clearly is. It seems to not handle cl-defun, even though its code ;; appears to account for it. (declare-function org-ql-search "org-ql-search" t) +(declare-function org-ql-search--org-link-store-props "org-ql-search" t) (require 'dash) (require 's) @@ -288,7 +289,8 @@ TYPE may be `ts', `ts-active', `ts-inactive', `clocked', or ;;;###autoload (cl-defun org-ql-view-sidebar (&key (slot org-ql-view-list-slot)) - "Show `org-ql-view' view list sidebar." + "Show `org-ql-view' view list sidebar. +SLOT is passed to `display-buffer-in-side-window', which see." ;; TODO: Update sidebar when `org-ql-views' changes. (interactive) (select-window @@ -688,8 +690,7 @@ When opened, the link searches the buffer it's opened from." "?" (url-build-query-string (delete nil params)))) (url (url-recreate-url (url-parse-make-urlobj "org-ql-search" nil nil nil nil filename)))) - ;; FIXME: "Warning: ‘org-store-link-props’ is an obsolete function (as of Org 9.3); use ‘org-link-store-props’ instead" - (org-store-link-props + (org-ql-search--org-link-store-props :type "org-ql-search" :link url :description (concat "org-ql-search: " org-ql-view-title)))) diff --git a/org-ql.el b/org-ql.el index 22fa86f..9bb05fd 100644 --- a/org-ql.el +++ b/org-ql.el @@ -75,10 +75,10 @@ That is, \"CLOSED:\", \"DEADLINE:\", or \"SCHEDULED:\".") Tags are stored in match group 1. Match group 2 stores the tags without the enclosing colons.") -(defconst org-ql-link-regexp +(defvaralias 'org-ql-link-regexp (if (bound-and-true-p org-link-bracket-re) - org-link-bracket-re - org-bracket-link-regexp) + 'org-link-bracket-re + 'org-bracket-link-regexp) "Regexp used to match Org bracket links. Necessary because of changes in Org 9.something.") @@ -1347,18 +1347,17 @@ result form." ;; NOTE: This was a defsubst before being defined with the macro. Might be good to make it a defsubst again. :body (or (apply #'org-ql--predicate-todo org-done-keywords))) -(defun org-ql--duration-to-minutes (duration) +(defalias 'org-ql--duration-to-minutes + ;; TODO: Remove when compatibility with Org 9.0 is dropped. + (cond ((fboundp 'org-duration-to-minutes) #'org-duration-to-minutes) + ((fboundp 'org-duration-string-to-minutes) #'org-duration-string-to-minutes) + (t (warn "org-ql: Unable to define alias `org-ql-search--link-heading-search-string'. Please report this as a bug.") + #'identity)) "Return DURATION string as a number of minutes. For compatibility, since Org 9.1 deprecated `org-duration-string-to-minutes', replacing it with `org-duration-to-minutes', which seems to return floats instead -of integers." - ;; FIXME: Define this as an alias instead. - ;; MAYBE: Remove if compatibility with Org 9.0 is dropped. - (funcall (if (fboundp 'org-duration-to-minutes) - #'org-duration-to-minutes - #'org-duration-string-to-minutes) - duration)) +of integers.") (org-ql-defpred effort (&optional effort-or-comparator effort) "Return non-nil if current heading's effort property matches arguments. diff --git a/org-ql.info b/org-ql.info index caee1f6..6857239 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1052,6 +1052,7 @@ File: README.info, Node: 07-pre, Next: 063, Up: Changelog of arguments, and handling in non-sexp queries. (Thanks to Akira Komamura (https://github.com/akirak) for reporting.) • Predicate ‘src’’s behavior with various arguments. + • Various compilation warnings. *Internal* • Certain query predicates, when called multiple times in an ‘and’ @@ -1727,35 +1728,35 @@ Node: Links37140 Node: Tips37827 Node: Changelog38151 Node: 07-pre38934 -Node: 06341399 -Node: 06241934 -Node: 06142239 -Node: 0642807 -Node: 05245861 -Node: 05146161 -Node: 0546584 -Node: 04948113 -Node: 04848393 -Node: 04748742 -Node: 04649151 -Node: 04549559 -Node: 04449920 -Node: 04350279 -Node: 04250482 -Node: 04150643 -Node: 0450890 -Node: 03254991 -Node: 03155394 -Node: 0355591 -Node: 02358891 -Node: 02259125 -Node: 02159405 -Node: 0259610 -Node: 0163688 -Node: Notes63789 -Node: Comparison with Org Agenda searches63951 -Node: org-sidebar64840 -Node: License65119 +Node: 06341436 +Node: 06241971 +Node: 06142276 +Node: 0642844 +Node: 05245898 +Node: 05146198 +Node: 0546621 +Node: 04948150 +Node: 04848430 +Node: 04748779 +Node: 04649188 +Node: 04549596 +Node: 04449957 +Node: 04350316 +Node: 04250519 +Node: 04150680 +Node: 0450927 +Node: 03255028 +Node: 03155431 +Node: 0355628 +Node: 02358928 +Node: 02259162 +Node: 02159442 +Node: 0259647 +Node: 0163725 +Node: Notes63826 +Node: Comparison with Org Agenda searches63988 +Node: org-sidebar64877 +Node: License65156  End Tag Table diff --git a/tests/test-org-ql.el b/tests/test-org-ql.el index c884971..3af3537 100644 --- a/tests/test-org-ql.el +++ b/tests/test-org-ql.el @@ -30,6 +30,7 @@ (require 'with-simulated-input) (require 'org-ql) +(require 'org-ql-search) (require 'org-ql-view) ;;;; Variables @@ -200,7 +201,10 @@ with keyword arg NOW in PLIST." (insert "* Heading 1") ;; FIXME: `--value-at' does not actually move point, so we do it here. (goto-char (point-min)) - (expect (org-ql--value-at (point-min) #'org-get-local-tags) + (expect (org-ql--value-at (point-min) + ;; TODO: Just use org-get-tags when requiring Org 9.2+. + (cond ((fboundp 'org-get-tags) #'org-get-tags) + ((fboundp 'org-get-local-tags) #'org-get-local-tags))) :to-be nil)))) (describe "Query pre-processing" From e5e9daab0757b485df14e10fc52c2ace2c1abd3b Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 9 Mar 2023 03:37:52 -0600 Subject: [PATCH 065/224] Fix: Aliases One of them seems to break on Emacs 26.3 only... --- org-ql-search.el | 9 +++------ org-ql.el | 3 +-- tests/test-org-ql.el | 5 +---- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/org-ql-search.el b/org-ql-search.el index f2fd953..cedcadb 100644 --- a/org-ql-search.el +++ b/org-ql-search.el @@ -44,20 +44,17 @@ (cond ((fboundp 'org-link--normalize-string) #'org-link--normalize-string) ((fboundp 'org-link-heading-search-string) #'org-link-heading-search-string) ((fboundp 'org-make-org-heading-search-string) #'org-make-org-heading-search-string) - (t (warn "org-ql: Unable to define alias `org-ql-search--link-heading-search-string'. This may affect links in dynamic blocks. Please report this as a bug.") - #'identity))) + (t (error "org-ql: Unable to define alias `org-ql-search--link-heading-search-string'. This may affect links in dynamic blocks. Please report this as a bug")))) (defalias 'org-ql-search--org-make-link-string (cond ((fboundp 'org-link-make-string) #'org-link-make-string) ((fboundp 'org-make-link-string) #'org-make-link-string) - (t (warn "org-ql: Unable to define alias `org-ql-search--org-make-link-string'. Please report this as a bug.") - #'identity))) + (t (error "org-ql: Unable to define alias `org-ql-search--org-make-link-string'. Please report this as a bug")))) (defalias 'org-ql-search--org-link-store-props (cond ((fboundp 'org-link-store-props) #'org-link-store-props) ((fboundp 'org-store-link-props) #'org-store-link-props) - (t (warn "org-ql: Unable to define alias `org-ql-search--org-link-store-props'. Please report this as a bug.") - #'identity))) + (t (error "org-ql: Unable to define alias `org-ql-search--org-link-store-props'. Please report this as a bug")))) ;;;; Variables diff --git a/org-ql.el b/org-ql.el index 9bb05fd..3c70b34 100644 --- a/org-ql.el +++ b/org-ql.el @@ -1351,8 +1351,7 @@ result form." ;; TODO: Remove when compatibility with Org 9.0 is dropped. (cond ((fboundp 'org-duration-to-minutes) #'org-duration-to-minutes) ((fboundp 'org-duration-string-to-minutes) #'org-duration-string-to-minutes) - (t (warn "org-ql: Unable to define alias `org-ql-search--link-heading-search-string'. Please report this as a bug.") - #'identity)) + (t (error "org-ql: Unable to define alias `org-ql-search--link-heading-search-string'. Please report this as a bug"))) "Return DURATION string as a number of minutes. For compatibility, since Org 9.1 deprecated `org-duration-string-to-minutes', replacing it with diff --git a/tests/test-org-ql.el b/tests/test-org-ql.el index 3af3537..e6fc909 100644 --- a/tests/test-org-ql.el +++ b/tests/test-org-ql.el @@ -201,10 +201,7 @@ with keyword arg NOW in PLIST." (insert "* Heading 1") ;; FIXME: `--value-at' does not actually move point, so we do it here. (goto-char (point-min)) - (expect (org-ql--value-at (point-min) - ;; TODO: Just use org-get-tags when requiring Org 9.2+. - (cond ((fboundp 'org-get-tags) #'org-get-tags) - ((fboundp 'org-get-local-tags) #'org-get-local-tags))) + (expect (org-ql--value-at (point-min) #'ignore) :to-be nil)))) (describe "Query pre-processing" From 6afe3be5721d6625eac5bc7c900d88d4ce1387c8 Mon Sep 17 00:00:00 2001 From: Akira Komamura Date: Wed, 28 Jul 2021 17:31:29 +0900 Subject: [PATCH 066/224] Add: (blocked) predicate --- README.org | 1 + org-ql.el | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/README.org b/README.org index 7b66d34..9127889 100644 --- a/README.org +++ b/README.org @@ -254,6 +254,7 @@ Arguments are listed next to predicate names, where applicable. + =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~). ++ =blocked= :: Return non-nil if current heading is blocked. *** Ancestor/descendant predicates diff --git a/org-ql.el b/org-ql.el index 3c70b34..87a090c 100644 --- a/org-ql.el +++ b/org-ql.el @@ -2377,6 +2377,11 @@ any planning prefix); it defaults to 0 (i.e. the whole regexp)." (from (test-timestamps (ts<= from next-ts))) (to (test-timestamps (ts<= next-ts to))))))) +(org-ql-defpred blocked () + "Return non-nil if the entry is blocked." + :body + (org-entry-blocked-p)) + ;; NOTE: Predicates defined: stop deferring and define normalizer and ;; preamble functions now. Reversing preserves the order in which ;; they were defined. Generally it shouldn't matter, but it might... From 902dad04c10e9215db3c49e33abb30b21e41f44e Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Fri, 10 Mar 2023 03:36:21 -0600 Subject: [PATCH 067/224] Docs/Tidy: Update readme, reorder forms --- README.org | 3 +- org-ql.el | 10 +++--- org-ql.info | 97 ++++++++++++++++++++++++++++------------------------- 3 files changed, 58 insertions(+), 52 deletions(-) diff --git a/README.org b/README.org index 9127889..e19b3d6 100644 --- a/README.org +++ b/README.org @@ -221,6 +221,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). + =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=. @@ -254,7 +255,6 @@ Arguments are listed next to predicate names, where applicable. + =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~). -+ =blocked= :: Return non-nil if current heading is blocked. *** Ancestor/descendant predicates @@ -552,6 +552,7 @@ Simple links may also be written manually in either sexp or non-sexp form, like: + Option ~org-ql-default-predicate~, applied to plain-string query tokens (before, the ~regexp~ predicate was always used, but now it may be customized). + Alias ~c~ for predicate ~category~. + Predicate ~property~ now accepts the argument ~:inherit~ to match entries with property inheritance, and when unspecified, the option ~org-use-property-inheritance~ controls whether inheritance is used. ++ Predicate ~blocked~. (Thanks to [[https://github.com/akirak][Akira Komamura]].) *Changed* + Give more useful error message for invalid queries. diff --git a/org-ql.el b/org-ql.el index 87a090c..acfe8c0 100644 --- a/org-ql.el +++ b/org-ql.el @@ -1333,6 +1333,11 @@ result form." ;; redefinitions until all of the predicates have been defined. (setf org-ql-defpred-defer t) +(org-ql-defpred blocked () + "Return non-nil if entry is blocked. +Calls `org-entry-blocked-p', which see." + :body (org-entry-blocked-p)) + (org-ql-defpred (category c) (&rest categories) "Return non-nil if current heading is in one or more of CATEGORIES." :normalizers ((`(,predicate-names . ,rest) @@ -2377,11 +2382,6 @@ any planning prefix); it defaults to 0 (i.e. the whole regexp)." (from (test-timestamps (ts<= from next-ts))) (to (test-timestamps (ts<= next-ts to))))))) -(org-ql-defpred blocked () - "Return non-nil if the entry is blocked." - :body - (org-entry-blocked-p)) - ;; NOTE: Predicates defined: stop deferring and define normalizer and ;; preamble functions now. Reversing preserves the order in which ;; they were defined. Generally it shouldn't matter, but it might... diff --git a/org-ql.info b/org-ql.info index 6857239..ec95d26 100644 --- a/org-ql.info +++ b/org-ql.info @@ -415,6 +415,9 @@ File: README.info, Node: General predicates, Next: Ancestor/descendant predica 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). @@ -1042,6 +1045,8 @@ File: README.info, Node: 07-pre, Next: 063, Up: Changelog entries with property inheritance, and when unspecified, the option ‘org-use-property-inheritance’ controls whether inheritance is used. + • Predicate ‘blocked’. (Thanks to Akira Komamura + (https://github.com/akirak).) *Changed* • Give more useful error message for invalid queries. @@ -1711,52 +1716,52 @@ Node: org-ql-sparse-tree8594 Node: Queries9394 Node: Non-sexp query syntax10511 Node: General predicates12270 -Node: Ancestor/descendant predicates19142 -Node: Date/time predicates20270 -Node: Functions / Macros23394 -Node: Agenda-like views23692 -Ref: Function ‘org-ql-block’23854 -Node: Listing / acting-on results25115 -Ref: Caching25323 -Ref: Function ‘org-ql-select’26236 -Ref: Function ‘org-ql-query’28662 -Ref: Macro ‘org-ql’ (deprecated)30436 -Node: Custom predicates30751 -Ref: Macro ‘org-ql-defpred’30975 -Node: Dynamic block34416 -Node: Links37140 -Node: Tips37827 -Node: Changelog38151 -Node: 07-pre38934 -Node: 06341436 -Node: 06241971 -Node: 06142276 -Node: 0642844 -Node: 05245898 -Node: 05146198 -Node: 0546621 -Node: 04948150 -Node: 04848430 -Node: 04748779 -Node: 04649188 -Node: 04549596 -Node: 04449957 -Node: 04350316 -Node: 04250519 -Node: 04150680 -Node: 0450927 -Node: 03255028 -Node: 03155431 -Node: 0355628 -Node: 02358928 -Node: 02259162 -Node: 02159442 -Node: 0259647 -Node: 0163725 -Node: Notes63826 -Node: Comparison with Org Agenda searches63988 -Node: org-sidebar64877 -Node: License65156 +Node: Ancestor/descendant predicates19257 +Node: Date/time predicates20385 +Node: Functions / Macros23509 +Node: Agenda-like views23807 +Ref: Function ‘org-ql-block’23969 +Node: Listing / acting-on results25230 +Ref: Caching25438 +Ref: Function ‘org-ql-select’26351 +Ref: Function ‘org-ql-query’28777 +Ref: Macro ‘org-ql’ (deprecated)30551 +Node: Custom predicates30866 +Ref: Macro ‘org-ql-defpred’31090 +Node: Dynamic block34531 +Node: Links37255 +Node: Tips37942 +Node: Changelog38266 +Node: 07-pre39049 +Node: 06341645 +Node: 06242180 +Node: 06142485 +Node: 0643053 +Node: 05246107 +Node: 05146407 +Node: 0546830 +Node: 04948359 +Node: 04848639 +Node: 04748988 +Node: 04649397 +Node: 04549805 +Node: 04450166 +Node: 04350525 +Node: 04250728 +Node: 04150889 +Node: 0451136 +Node: 03255237 +Node: 03155640 +Node: 0355837 +Node: 02359137 +Node: 02259371 +Node: 02159651 +Node: 0259856 +Node: 0163934 +Node: Notes64035 +Node: Comparison with Org Agenda searches64197 +Node: org-sidebar65086 +Node: License65365  End Tag Table From 2b7d4e0e79260b5caa9cf978ee80edf03c7c981d Mon Sep 17 00:00:00 2001 From: Akira Komamura Date: Tue, 22 Mar 2022 17:59:01 +0900 Subject: [PATCH 068/224] Fix: Accept plain queries in interactive org-ql-sparse-tree --- org-ql-search.el | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/org-ql-search.el b/org-ql-search.el index cedcadb..b442b38 100644 --- a/org-ql-search.el +++ b/org-ql-search.el @@ -102,7 +102,7 @@ matches, which allows stacking calls to this command. Runs `org-occur-hook' after making the sparse tree." ;; Code based on `org-occur'. - (interactive (list (read-minibuffer "Query: ") + (interactive (list (read-string "Query: ") :keep-previous current-prefix-arg)) (with-current-buffer buffer (unless keep-previous @@ -110,7 +110,15 @@ Runs `org-occur-hook' after making the sparse tree." ;; we remove existing `org-occur' highlights, just in case. (org-remove-occur-highlights nil nil t) (org-overview)) - (let ((num-results 0)) + (let ((num-results 0) + (query (cl-etypecase query + (string (if (or (string-prefix-p "(" query) + (string-prefix-p "\"" query)) + ;; Read sexp query. + (read query) + ;; Parse non-sexp query into sexp query. + (org-ql--query-string-to-sexp query))) + (list query)))) ;; FIXME: Accept plain queries as well. (org-ql-select buffer query :action (lambda () From 1ae2f0cd60974e85b204cd1bd255aa39b253473f Mon Sep 17 00:00:00 2001 From: Akira Komamura Date: Tue, 22 Mar 2022 18:08:13 +0900 Subject: [PATCH 069/224] Update the docstring --- org-ql-search.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/org-ql-search.el b/org-ql-search.el index b442b38..efd9aa7 100644 --- a/org-ql-search.el +++ b/org-ql-search.el @@ -93,8 +93,8 @@ directories, etc, which would make it slow to list the The tree will show the lines where the query matches, and any other context defined in `org-show-context-detail', which see. -QUERY is an `org-ql' query sexp (quoted, since this is a -function). BUFFER defaults to the current buffer. +QUERY: An `org-ql' query in either sexp or non-sexp form (see +Info node `(org-ql)Queries'). When KEEP-PREVIOUS is non-nil (interactively, with prefix), the outline is not reset to the overview state before finding From 99e580b53077ff1de26009de2c56dc5870dd3b19 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Fri, 10 Mar 2023 04:44:05 -0600 Subject: [PATCH 070/224] Tidy: (org-ql-sparse-tree) Docstring; use pcase --- org-ql-search.el | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/org-ql-search.el b/org-ql-search.el index efd9aa7..e0ab3ff 100644 --- a/org-ql-search.el +++ b/org-ql-search.el @@ -93,7 +93,7 @@ directories, etc, which would make it slow to list the The tree will show the lines where the query matches, and any other context defined in `org-show-context-detail', which see. -QUERY: An `org-ql' query in either sexp or non-sexp form (see +QUERY is an `org-ql' query in either sexp or string form (see Info node `(org-ql)Queries'). When KEEP-PREVIOUS is non-nil (interactively, with prefix), the @@ -111,14 +111,17 @@ Runs `org-occur-hook' after making the sparse tree." (org-remove-occur-highlights nil nil t) (org-overview)) (let ((num-results 0) - (query (cl-etypecase query - (string (if (or (string-prefix-p "(" query) - (string-prefix-p "\"" query)) - ;; Read sexp query. - (read query) - ;; Parse non-sexp query into sexp query. - (org-ql--query-string-to-sexp query))) - (list query)))) + (query (pcase-exhaustive query + ((and (pred stringp) + (rx bos (0+ blank) (or "(" "\""))) + ;; Read sexp query from string. + (read query)) + ((pred stringp) + ;; Parse string query into sexp query. + (org-ql--query-string-to-sexp query)) + ((pred listp) + ;; Sexp query. + query)))) ;; FIXME: Accept plain queries as well. (org-ql-select buffer query :action (lambda () From d92afcda062b2953b148b0507f8137d6bfbad862 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Fri, 10 Mar 2023 04:46:32 -0600 Subject: [PATCH 071/224] Docs: Update changelog --- README.org | 1 + org-ql.info | 60 +++++++++++++++++++++++++++-------------------------- 2 files changed, 32 insertions(+), 29 deletions(-) diff --git a/README.org b/README.org index e19b3d6..2845805 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: *Changed* + Give more useful error message for invalid queries. + Predicate ~src~ now matches case-insensitively. ++ Command ~org-ql-sparse-tree~ accepts both string and sexp queries. (Thanks to [[https://github.com/akirak][Akira Komamura]].) *Fixed* + Predicate ~src~'s matching of begin/end block lines, normalization of arguments, and handling in non-sexp queries. (Thanks to [[https://github.com/akirak][Akira Komamura]] for reporting.) diff --git a/org-ql.info b/org-ql.info index ec95d26..08900a2 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1051,6 +1051,8 @@ File: README.info, Node: 07-pre, Next: 063, Up: Changelog *Changed* • Give more useful error message for invalid queries. • Predicate ‘src’ now matches case-insensitively. + • Command ‘org-ql-sparse-tree’ accepts both string and sexp queries. + (Thanks to Akira Komamura (https://github.com/akirak).) *Fixed* • Predicate ‘src’’s matching of begin/end block lines, normalization @@ -1733,35 +1735,35 @@ Node: Links37255 Node: Tips37942 Node: Changelog38266 Node: 07-pre39049 -Node: 06341645 -Node: 06242180 -Node: 06142485 -Node: 0643053 -Node: 05246107 -Node: 05146407 -Node: 0546830 -Node: 04948359 -Node: 04848639 -Node: 04748988 -Node: 04649397 -Node: 04549805 -Node: 04450166 -Node: 04350525 -Node: 04250728 -Node: 04150889 -Node: 0451136 -Node: 03255237 -Node: 03155640 -Node: 0355837 -Node: 02359137 -Node: 02259371 -Node: 02159651 -Node: 0259856 -Node: 0163934 -Node: Notes64035 -Node: Comparison with Org Agenda searches64197 -Node: org-sidebar65086 -Node: License65365 +Node: 06341784 +Node: 06242319 +Node: 06142624 +Node: 0643192 +Node: 05246246 +Node: 05146546 +Node: 0546969 +Node: 04948498 +Node: 04848778 +Node: 04749127 +Node: 04649536 +Node: 04549944 +Node: 04450305 +Node: 04350664 +Node: 04250867 +Node: 04151028 +Node: 0451275 +Node: 03255376 +Node: 03155779 +Node: 0355976 +Node: 02359276 +Node: 02259510 +Node: 02159790 +Node: 0259995 +Node: 0164073 +Node: Notes64174 +Node: Comparison with Org Agenda searches64336 +Node: org-sidebar65225 +Node: License65504  End Tag Table From 9e14f9eefaba4dbfc28382dee306cade11c49189 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Fri, 10 Mar 2023 05:52:06 -0600 Subject: [PATCH 072/224] Fix: (link) Allow brackets in description Org 9.3 stopped replacing brackets in link descriptions with braces and started escaping them instead. Fixes #283. Thanks to Daniel Borchmann (@exot) for reporting. --- README.org | 1 + org-ql.el | 77 ++++++++++++++++++++++---------------------- org-ql.info | 61 ++++++++++++++++++----------------- tests/data-links.org | 10 ++++++ tests/test-org-ql.el | 34 ++++++++++++++++++- 5 files changed, 115 insertions(+), 68 deletions(-) create mode 100644 tests/data-links.org diff --git a/README.org b/README.org index 2845805..0715680 100644 --- a/README.org +++ b/README.org @@ -560,6 +560,7 @@ Simple links may also be written manually in either sexp or non-sexp form, like: + Command ~org-ql-sparse-tree~ accepts both string and sexp queries. (Thanks to [[https://github.com/akirak][Akira Komamura]].) *Fixed* ++ Predicate ~link~ matches links whose descriptions contain escaped brackets (changed in Org 9.3). (Thanks to [[https://github.com/exot][Daniel Borchmann]] for reporting.) + Predicate ~src~'s matching of begin/end block lines, normalization of arguments, and handling in non-sexp queries. (Thanks to [[https://github.com/akirak][Akira Komamura]] for reporting.) + Predicate ~src~'s behavior with various arguments. + Various compilation warnings. diff --git a/org-ql.el b/org-ql.el index acfe8c0..a471f4e 100644 --- a/org-ql.el +++ b/org-ql.el @@ -794,38 +794,43 @@ DESCRIPTION-OR-TARGET, match it in either description or target. If DESCRIPTION, match it in the description. If TARGET, match it in the target. If both DESCRIPTION and TARGET, match both, respectively." - (cl-labels - ((no-desc - (match) (rx-to-string `(seq (or bol (1+ blank)) - "[[" (0+ (not (any "]"))) (regexp ,match) (0+ (not (any "]"))) - "]]"))) - (match-both - (description target) - (rx-to-string `(seq (or bol (1+ blank)) - "[[" (0+ (not (any "]"))) (regexp ,target) (0+ (not (any "]"))) - "][" (0+ (not (any "]"))) (regexp ,description) (0+ (not (any "]"))) - "]]"))) - ;; 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)) - "[[" (0+ (not (any "]"))) - "][" (0+ (not (any "]"))) (regexp ,match) (0+ (not (any "]"))) - "]]"))) - (match-target - (match) (rx-to-string `(seq (or bol (1+ blank)) - "[[" (0+ (not (any "]"))) (regexp ,match) (0+ (not (any "]"))) - "][" (0+ (not (any "]"))) - "]]")))) - (cond (description-or-target - (rx-to-string `(or (regexp ,(no-desc description-or-target)) - (regexp ,(match-desc description-or-target)) - (regexp ,(match-target description-or-target))))) - ((and description target) - (match-both description target)) - (description (match-desc description)) - (target (rx-to-string `(or (regexp ,(no-desc target)) - (regexp ,(match-target target)))))))) + ;; This `rx' part is borrowed from `org-make-link-regexps'. It matches the interior of an + ;; Org link target (i.e. the parts between the brackets, including any escaped brackets). + (let ((link-target-part '(0+ (or (not (any "[]\\")) + (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) + "]]"))) + ;; 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) + "]]")))) + (cond (description-or-target + (rx-to-string `(or (regexp ,(no-desc description-or-target)) + (regexp ,(match-desc description-or-target)) + (regexp ,(match-target description-or-target))))) + ((and description target) + (match-both description target)) + (description (match-desc description)) + (target (rx-to-string `(or (regexp ,(no-desc target)) + (regexp ,(match-target target))))))))) (defun org-ql--format-src-block-regexp (&optional lang) "Return regexp equivalent to `org-babel-src-block-regexp' with LANG filled in." @@ -1563,12 +1568,8 @@ any link is found." ;; enabled nearly all of the time, in which case this function won't be called anyway, it's ;; probably not worth rewriting code all over the place to fix this. :preambles ((`(,predicate-names) - (list :regexp ;; Match a link with a target and optionally a description. - (rx (or bol (1+ blank)) - "[[" (1+ (not (any "]"))) "]" - (optional (seq "[" (0+ (not (any "]"))) "]")) - "]" - (or eol blank)))) + ;; Match a link with a target and optionally a description. + (list :regexp (org-ql--link-regexp :target ".*"))) (`(,predicate-names ,(and description-or-target (guard (not (keywordp description-or-target)))) . ,plist) diff --git a/org-ql.info b/org-ql.info index 08900a2..ce8d981 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1055,6 +1055,9 @@ File: README.info, Node: 07-pre, Next: 063, Up: Changelog (Thanks to Akira Komamura (https://github.com/akirak).) *Fixed* + • Predicate ‘link’ matches links whose descriptions contain escaped + brackets (changed in Org 9.3). (Thanks to Daniel Borchmann + (https://github.com/exot) for reporting.) • Predicate ‘src’’s matching of begin/end block lines, normalization of arguments, and handling in non-sexp queries. (Thanks to Akira Komamura (https://github.com/akirak) for reporting.) @@ -1735,35 +1738,35 @@ Node: Links37255 Node: Tips37942 Node: Changelog38266 Node: 07-pre39049 -Node: 06341784 -Node: 06242319 -Node: 06142624 -Node: 0643192 -Node: 05246246 -Node: 05146546 -Node: 0546969 -Node: 04948498 -Node: 04848778 -Node: 04749127 -Node: 04649536 -Node: 04549944 -Node: 04450305 -Node: 04350664 -Node: 04250867 -Node: 04151028 -Node: 0451275 -Node: 03255376 -Node: 03155779 -Node: 0355976 -Node: 02359276 -Node: 02259510 -Node: 02159790 -Node: 0259995 -Node: 0164073 -Node: Notes64174 -Node: Comparison with Org Agenda searches64336 -Node: org-sidebar65225 -Node: License65504 +Node: 06341973 +Node: 06242508 +Node: 06142813 +Node: 0643381 +Node: 05246435 +Node: 05146735 +Node: 0547158 +Node: 04948687 +Node: 04848967 +Node: 04749316 +Node: 04649725 +Node: 04550133 +Node: 04450494 +Node: 04350853 +Node: 04251056 +Node: 04151217 +Node: 0451464 +Node: 03255565 +Node: 03155968 +Node: 0356165 +Node: 02359465 +Node: 02259699 +Node: 02159979 +Node: 0260184 +Node: 0164262 +Node: Notes64363 +Node: Comparison with Org Agenda searches64525 +Node: org-sidebar65414 +Node: License65693  End Tag Table diff --git a/tests/data-links.org b/tests/data-links.org new file mode 100644 index 0000000..b158951 --- /dev/null +++ b/tests/data-links.org @@ -0,0 +1,10 @@ +* Alpha + +Let us link to: [[id:74d357ac-fb9c-40d1-a63f-eca8a227321d][Bravo [a phrase in brackets]​]]. + +* Bravo [a phrase in brackets] +:PROPERTIES: +:ID: 74d357ac-fb9c-40d1-a63f-eca8a227321d +:END: + +* Charlie diff --git a/tests/test-org-ql.el b/tests/test-org-ql.el index e6fc909..4e78f3a 100644 --- a/tests/test-org-ql.el +++ b/tests/test-org-ql.el @@ -1141,7 +1141,39 @@ with keyword arg NOW in PLIST." '("/r/emacs"))) (org-ql-it "with :description and :target regexp" (org-ql-expect ('(link :description "em.cs" :target "em.cs" :regexp-p t)) - '("/r/emacs")))) + '("/r/emacs"))) + + (describe "matches links whose descriptions contain brackets" + (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"))))) (describe "(outline-path)" (org-ql-it "with one argument" From 962a3dc4142d19aa75a618457986e1d6ddf7a695 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Fri, 10 Mar 2023 06:19:01 -0600 Subject: [PATCH 073/224] Comment: Remove old FIXME See 3c73888b981b32c20dcaaa6739619b1465deddbd. --- org-ql-search.el | 1 - 1 file changed, 1 deletion(-) diff --git a/org-ql-search.el b/org-ql-search.el index e0ab3ff..b029544 100644 --- a/org-ql-search.el +++ b/org-ql-search.el @@ -122,7 +122,6 @@ Runs `org-occur-hook' after making the sparse tree." ((pred listp) ;; Sexp query. query)))) - ;; FIXME: Accept plain queries as well. (org-ql-select buffer query :action (lambda () (org-show-context 'occur-tree) From 44679a6c93a2207eee9f1e835b75a5be33a4aebb Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Fri, 10 Mar 2023 06:23:53 -0600 Subject: [PATCH 074/224] Comment: Remove old FIXMEs --- org-ql-view.el | 7 ------- 1 file changed, 7 deletions(-) diff --git a/org-ql-view.el b/org-ql-view.el index 5a03b80..72a057b 100644 --- a/org-ql-view.el +++ b/org-ql-view.el @@ -40,9 +40,6 @@ (require 'org-ql) -;; FIXME: check-declare declares "function not found", even though it -;; clearly is. It seems to not handle cl-defun, even though its code -;; appears to account for it. (declare-function org-ql-search "org-ql-search" t) (declare-function org-ql-search--org-link-store-props "org-ql-search" t) @@ -1014,10 +1011,6 @@ property." ;; These functions are somewhat regrettable because of the need to keep them ;; in sync, but it seems worth it to provide users with the flexibility. -;; FIXME: `check-declare' declares that this function is not in org-ql-search, even though -;; it is. It appears to happen because `org-ql-search-directories-files' is declared with -;; `cl-defun', because when I remove "cl-", it finds it. This makes no sense, because the -;; source code of `check-declare' shows that it searches for "cl-defun" declarations. (declare-function org-ql-search-directories-files "org-ql-search" t) (defun org-ql-view--contract-buffers-files (buffers-files) From 107fc66d08ea7afbe150a9b76a607b3a5981b383 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Fri, 10 Mar 2023 06:24:03 -0600 Subject: [PATCH 075/224] Change: (org-ql-view--format-element) Use display-warning --- org-ql-view.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/org-ql-view.el b/org-ql-view.el index 72a057b..d771d12 100644 --- a/org-ql-view.el +++ b/org-ql-view.el @@ -864,8 +864,7 @@ return an empty string." (not type)) append type))) ;; No marker found - ;; TODO: Use `display-warning' with `org-ql' as the type. - (warn "No marker found for item: %s" title) + (display-warning 'org-ql (format "No marker found for item: %s" title)) (org-element-property :tags element)) (org-element-property :tags element))) (tag-string (when tag-list From aadddc4d84a72fa80d3bf909c9a3a4cbce53cd93 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Fri, 10 Mar 2023 06:25:45 -0600 Subject: [PATCH 076/224] Release: v0.7 --- README.org | 2 +- org-ql.el | 2 +- org-ql.info | 140 ++++++++++++++++++++++++++-------------------------- 3 files changed, 72 insertions(+), 72 deletions(-) diff --git a/README.org b/README.org index 0715680..637a13d 100644 --- a/README.org +++ b/README.org @@ -543,7 +543,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-pre +** 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.). diff --git a/org-ql.el b/org-ql.el index a471f4e..3b72ff0 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-pre +;; Version: 0.7 ;; 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 ce8d981..e0c6191 100644 --- a/org-ql.info +++ b/org-ql.info @@ -71,7 +71,7 @@ Functions / Macros Changelog -* 0.7-pre: 07-pre. +* 0.7: 07. * 0.6.3: 063. * 0.6.2: 062. * 0.6.1: 061. @@ -990,7 +990,7 @@ releases. * Menu: -* 0.7-pre: 07-pre. +* 0.7: 07. * 0.6.3: 063. * 0.6.2: 062. * 0.6.1: 061. @@ -1018,10 +1018,10 @@ releases. * 0.1: 01.  -File: README.info, Node: 07-pre, Next: 063, Up: Changelog +File: README.info, Node: 07, Next: 063, Up: Changelog -5.1 0.7-pre -=========== +5.1 0.7 +======= *Added* • Commands ‘org-ql-find’, ‘org-ql-find-heading’, and @@ -1078,7 +1078,7 @@ File: README.info, Node: 07-pre, Next: 063, Up: Changelog (https://github.com/alphapapa/org-ql/commit/91908186fcca4b5fd2e9d26da5bc0375c2b41acf).  -File: README.info, Node: 063, Next: 062, Prev: 07-pre, Up: Changelog +File: README.info, Node: 063, Next: 062, Prev: 07, Up: Changelog 5.2 0.6.3 ========= @@ -1703,70 +1703,70 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1797 -Node: Screenshots1920 -Node: Installation2038 -Node: Quelpa2552 -Node: Helm support3080 -Node: Usage3483 -Node: Commands3881 -Node: org-ql-find4325 -Node: org-ql-refile4791 -Node: org-ql-search5114 -Node: helm-org-ql6810 -Node: org-ql-view7188 -Node: org-ql-view-sidebar7718 -Node: org-ql-view-recent-items8098 -Node: org-ql-sparse-tree8594 -Node: Queries9394 -Node: Non-sexp query syntax10511 -Node: General predicates12270 -Node: Ancestor/descendant predicates19257 -Node: Date/time predicates20385 -Node: Functions / Macros23509 -Node: Agenda-like views23807 -Ref: Function ‘org-ql-block’23969 -Node: Listing / acting-on results25230 -Ref: Caching25438 -Ref: Function ‘org-ql-select’26351 -Ref: Function ‘org-ql-query’28777 -Ref: Macro ‘org-ql’ (deprecated)30551 -Node: Custom predicates30866 -Ref: Macro ‘org-ql-defpred’31090 -Node: Dynamic block34531 -Node: Links37255 -Node: Tips37942 -Node: Changelog38266 -Node: 07-pre39049 -Node: 06341973 -Node: 06242508 -Node: 06142813 -Node: 0643381 -Node: 05246435 -Node: 05146735 -Node: 0547158 -Node: 04948687 -Node: 04848967 -Node: 04749316 -Node: 04649725 -Node: 04550133 -Node: 04450494 -Node: 04350853 -Node: 04251056 -Node: 04151217 -Node: 0451464 -Node: 03255565 -Node: 03155968 -Node: 0356165 -Node: 02359465 -Node: 02259699 -Node: 02159979 -Node: 0260184 -Node: 0164262 -Node: Notes64363 -Node: Comparison with Org Agenda searches64525 -Node: org-sidebar65414 -Node: License65693 +Node: Contents1789 +Node: Screenshots1912 +Node: Installation2030 +Node: Quelpa2544 +Node: Helm support3072 +Node: Usage3475 +Node: Commands3873 +Node: org-ql-find4317 +Node: org-ql-refile4783 +Node: org-ql-search5106 +Node: helm-org-ql6802 +Node: org-ql-view7180 +Node: org-ql-view-sidebar7710 +Node: org-ql-view-recent-items8090 +Node: org-ql-sparse-tree8586 +Node: Queries9386 +Node: Non-sexp query syntax10503 +Node: General predicates12262 +Node: Ancestor/descendant predicates19249 +Node: Date/time predicates20377 +Node: Functions / Macros23501 +Node: Agenda-like views23799 +Ref: Function ‘org-ql-block’23961 +Node: Listing / acting-on results25222 +Ref: Caching25430 +Ref: Function ‘org-ql-select’26343 +Ref: Function ‘org-ql-query’28769 +Ref: Macro ‘org-ql’ (deprecated)30543 +Node: Custom predicates30858 +Ref: Macro ‘org-ql-defpred’31082 +Node: Dynamic block34523 +Node: Links37247 +Node: Tips37934 +Node: Changelog38258 +Node: 0739033 +Node: 06341945 +Node: 06242476 +Node: 06142781 +Node: 0643349 +Node: 05246403 +Node: 05146703 +Node: 0547126 +Node: 04948655 +Node: 04848935 +Node: 04749284 +Node: 04649693 +Node: 04550101 +Node: 04450462 +Node: 04350821 +Node: 04251024 +Node: 04151185 +Node: 0451432 +Node: 03255533 +Node: 03155936 +Node: 0356133 +Node: 02359433 +Node: 02259667 +Node: 02159947 +Node: 0260152 +Node: 0164230 +Node: Notes64331 +Node: Comparison with Org Agenda searches64493 +Node: org-sidebar65382 +Node: License65661  End Tag Table From ce66f67c960495ee24712b106c4f1c87e70e77fe Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sun, 12 Mar 2023 05:59:13 -0500 Subject: [PATCH 077/224] Meta: v0.7.1-pre --- README.org | 4 ++ org-ql.el | 2 +- org-ql.info | 195 +++++++++++++++++++++++++++------------------------- 3 files changed, 108 insertions(+), 93 deletions(-) diff --git a/README.org b/README.org index 637a13d..2532294 100644 --- a/README.org +++ b/README.org @@ -543,6 +543,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.1-pre + +Nothing new yet. + ** 0.7 *Added* diff --git a/org-ql.el b/org-ql.el index 3b72ff0..c0f548a 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 +;; Version: 0.7.1-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 e0c6191..741030a 100644 --- a/org-ql.info +++ b/org-ql.info @@ -71,6 +71,7 @@ Functions / Macros Changelog +* 0.7.1-pre: 071-pre. * 0.7: 07. * 0.6.3: 063. * 0.6.2: 062. @@ -990,6 +991,7 @@ releases. * Menu: +* 0.7.1-pre: 071-pre. * 0.7: 07. * 0.6.3: 063. * 0.6.2: 062. @@ -1018,9 +1020,17 @@ releases. * 0.1: 01.  -File: README.info, Node: 07, Next: 063, Up: Changelog +File: README.info, Node: 071-pre, Next: 07, Up: Changelog -5.1 0.7 +5.1 0.7.1-pre +============= + +Nothing new yet. + + +File: README.info, Node: 07, Next: 063, Prev: 071-pre, Up: Changelog + +5.2 0.7 ======= *Added* @@ -1080,7 +1090,7 @@ File: README.info, Node: 07, Next: 063, Up: Changelog  File: README.info, Node: 063, Next: 062, Prev: 07, Up: Changelog -5.2 0.6.3 +5.3 0.6.3 ========= *Fixed* @@ -1096,7 +1106,7 @@ File: README.info, Node: 063, Next: 062, Prev: 07, Up: Changelog  File: README.info, Node: 062, Next: 061, Prev: 063, Up: Changelog -5.3 0.6.2 +5.4 0.6.2 ========= *Fixed* @@ -1107,7 +1117,7 @@ File: README.info, Node: 062, Next: 061, Prev: 063, Up: Changelog  File: README.info, Node: 061, Next: 06, Prev: 062, Up: Changelog -5.4 0.6.1 +5.5 0.6.1 ========= *Fixed* @@ -1125,7 +1135,7 @@ File: README.info, Node: 061, Next: 06, Prev: 062, Up: Changelog  File: README.info, Node: 06, Next: 052, Prev: 061, Up: Changelog -5.5 0.6 +5.6 0.6 ======= *Added* @@ -1192,7 +1202,7 @@ File: README.info, Node: 06, Next: 052, Prev: 061, Up: Changelog  File: README.info, Node: 052, Next: 051, Prev: 06, Up: Changelog -5.6 0.5.2 +5.7 0.5.2 ========= *Fixed* @@ -1203,7 +1213,7 @@ File: README.info, Node: 052, Next: 051, Prev: 06, Up: Changelog  File: README.info, Node: 051, Next: 05, Prev: 052, Up: Changelog -5.7 0.5.1 +5.8 0.5.1 ========= *Fixed* @@ -1216,7 +1226,7 @@ File: README.info, Node: 051, Next: 05, Prev: 052, Up: Changelog  File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog -5.8 0.5 +5.9 0.5 ======= *Added* @@ -1257,8 +1267,8 @@ File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog  File: README.info, Node: 049, Next: 048, Prev: 05, Up: Changelog -5.9 0.4.9 -========= +5.10 0.4.9 +========== *Fixed* • Agenda restriction in ‘org-ql-block’. (Fixes #84 @@ -1268,7 +1278,7 @@ File: README.info, Node: 049, Next: 048, Prev: 05, Up: Changelog  File: README.info, Node: 048, Next: 047, Prev: 049, Up: Changelog -5.10 0.4.8 +5.11 0.4.8 ========== *Fixed* @@ -1280,7 +1290,7 @@ File: README.info, Node: 048, Next: 047, Prev: 049, Up: Changelog  File: README.info, Node: 047, Next: 046, Prev: 048, Up: Changelog -5.11 0.4.7 +5.12 0.4.7 ========== *Fixed* @@ -1293,7 +1303,7 @@ File: README.info, Node: 047, Next: 046, Prev: 048, Up: Changelog  File: README.info, Node: 046, Next: 045, Prev: 047, Up: Changelog -5.12 0.4.6 +5.13 0.4.6 ========== *Fixed* @@ -1306,7 +1316,7 @@ File: README.info, Node: 046, Next: 045, Prev: 047, Up: Changelog  File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog -5.13 0.4.5 +5.14 0.4.5 ========== *Fixed* @@ -1318,7 +1328,7 @@ File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog  File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog -5.14 0.4.4 +5.15 0.4.4 ========== *Fixed* @@ -1330,7 +1340,7 @@ File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog  File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog -5.15 0.4.3 +5.16 0.4.3 ========== *Fixed* @@ -1340,7 +1350,7 @@ File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog  File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog -5.16 0.4.2 +5.17 0.4.2 ========== *Fixed* @@ -1349,7 +1359,7 @@ File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog  File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog -5.17 0.4.1 +5.18 0.4.1 ========== *Fixed* @@ -1359,7 +1369,7 @@ File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog  File: README.info, Node: 04, Next: 032, Prev: 041, Up: Changelog -5.18 0.4 +5.19 0.4 ======== _Note:_ The next release, 0.5, may include changes which will require @@ -1440,7 +1450,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.19 0.3.2 +5.20 0.3.2 ========== *Fixed* @@ -1453,7 +1463,7 @@ File: README.info, Node: 032, Next: 031, Prev: 04, Up: Changelog  File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog -5.20 0.3.1 +5.21 0.3.1 ========== *Fixed* @@ -1463,7 +1473,7 @@ File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog  File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog -5.21 0.3 +5.22 0.3 ======== *Added* @@ -1531,7 +1541,7 @@ File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog  File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog -5.22 0.2.3 +5.23 0.2.3 ========== *Fixed* @@ -1541,7 +1551,7 @@ File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog  File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog -5.23 0.2.2 +5.24 0.2.2 ========== *Fixed* @@ -1552,7 +1562,7 @@ File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog  File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog -5.24 0.2.1 +5.25 0.2.1 ========== *Fixed* @@ -1562,7 +1572,7 @@ File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog  File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog -5.25 0.2 +5.26 0.2 ======== *Added* @@ -1645,7 +1655,7 @@ File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog  File: README.info, Node: 01, Prev: 02, Up: Changelog -5.26 0.1 +5.27 0.1 ======== First tagged release. @@ -1703,70 +1713,71 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1789 -Node: Screenshots1912 -Node: Installation2030 -Node: Quelpa2544 -Node: Helm support3072 -Node: Usage3475 -Node: Commands3873 -Node: org-ql-find4317 -Node: org-ql-refile4783 -Node: org-ql-search5106 -Node: helm-org-ql6802 -Node: org-ql-view7180 -Node: org-ql-view-sidebar7710 -Node: org-ql-view-recent-items8090 -Node: org-ql-sparse-tree8586 -Node: Queries9386 -Node: Non-sexp query syntax10503 -Node: General predicates12262 -Node: Ancestor/descendant predicates19249 -Node: Date/time predicates20377 -Node: Functions / Macros23501 -Node: Agenda-like views23799 -Ref: Function ‘org-ql-block’23961 -Node: Listing / acting-on results25222 -Ref: Caching25430 -Ref: Function ‘org-ql-select’26343 -Ref: Function ‘org-ql-query’28769 -Ref: Macro ‘org-ql’ (deprecated)30543 -Node: Custom predicates30858 -Ref: Macro ‘org-ql-defpred’31082 -Node: Dynamic block34523 -Node: Links37247 -Node: Tips37934 -Node: Changelog38258 -Node: 0739033 -Node: 06341945 -Node: 06242476 -Node: 06142781 -Node: 0643349 -Node: 05246403 -Node: 05146703 -Node: 0547126 -Node: 04948655 -Node: 04848935 -Node: 04749284 -Node: 04649693 -Node: 04550101 -Node: 04450462 -Node: 04350821 -Node: 04251024 -Node: 04151185 -Node: 0451432 -Node: 03255533 -Node: 03155936 -Node: 0356133 -Node: 02359433 -Node: 02259667 -Node: 02159947 -Node: 0260152 -Node: 0164230 -Node: Notes64331 -Node: Comparison with Org Agenda searches64493 -Node: org-sidebar65382 -Node: License65661 +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: 0739190 +Node: 06342118 +Node: 06242649 +Node: 06142954 +Node: 0643522 +Node: 05246576 +Node: 05146876 +Node: 0547299 +Node: 04948828 +Node: 04849110 +Node: 04749459 +Node: 04649868 +Node: 04550276 +Node: 04450637 +Node: 04350996 +Node: 04251199 +Node: 04151360 +Node: 0451607 +Node: 03255708 +Node: 03156111 +Node: 0356308 +Node: 02359608 +Node: 02259842 +Node: 02160122 +Node: 0260327 +Node: 0164405 +Node: Notes64506 +Node: Comparison with Org Agenda searches64668 +Node: org-sidebar65557 +Node: License65836  End Tag Table From e08de2a76c2bbd6364126653fdd911b37243f572 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sun, 12 Mar 2023 05:59:22 -0500 Subject: [PATCH 078/224] Fix: (org-ql-completing-read) Bind org-outline-path-cache nil --- 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 b1ef11a..c661d45 100644 --- a/org-ql-completing-read.el +++ b/org-ql-completing-read.el @@ -103,7 +103,8 @@ single predicate)." query-tokens snippet-regexp) (cl-labels ((action () (font-lock-ensure (point-at-bol) (point-at-eol)) - (let* ((path (thread-first (org-get-outline-path t t) + (let* ((org-outline-path-cache) ; See `org-get-outline-path' docstring. + (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 From 4c1a4b169f54d37ce541902c0ae5043759ef9d9b Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sun, 12 Mar 2023 09:30:29 -0500 Subject: [PATCH 079/224] Fix: (org-ql-completing-read) This seems to work better now with default Emacs completion (i.e. not using Vertico or Helm). It's still not perfect, but it seems to work reasonably well and be more correct. Fixes #338. Thanks to @arozbiz for reporting. --- README.org | 3 +- org-ql-completing-read.el | 224 ++++++++++++++++++++++++++------------ org-ql.info | 66 +++++------ 3 files changed, 192 insertions(+), 101 deletions(-) diff --git a/README.org b/README.org index 2532294..5135cdc 100644 --- a/README.org +++ b/README.org @@ -545,7 +545,8 @@ Simple links may also be written manually in either sexp or non-sexp form, like: ** 0.7.1-pre -Nothing new yet. +*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.) ** 0.7 diff --git a/org-ql-completing-read.el b/org-ql-completing-read.el index c661d45..b72c8fa 100644 --- a/org-ql-completing-read.el +++ b/org-ql-completing-read.el @@ -94,104 +94,190 @@ with commas to turn multiple tokens, which would normally be treated as multiple predicates, into multiple arguments to a single predicate)." (declare (indent defun)) - ;; Emacs's completion API is not always easy to understand, - ;; especially when using "programmed completion." This code was - ;; made possible by the example Clemens Radermacher shared at + ;; Emacs's completion API is not always easy to understand, especially when using "programmed + ;; completion." This code was made possible by the example Clemens Radermacher shared at ;; . + + ;; NOTE: I don't usually leave commented-out debugging code, but due to the incredibly tedious + ;; complexity of the "Programmed Completion" API and the time spent trying to get this reasonably + ;; close to "correct," I'm leaving it in, because I will undoubtedly have to go through this + ;; process again. + + ;; (message "ORG-QL-COMPLETING-READ: Starts.") (let ((table (make-hash-table :test #'equal)) + (disambiguations (make-hash-table :test #'equal)) (window-width (window-width)) - query-tokens snippet-regexp) - (cl-labels ((action + last-input org-outline-path-cache query-tokens snippet-regexp) + (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)) - (let* ((org-outline-path-cache) ; See `org-get-outline-path' docstring. - (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)) + ;; 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-get-heading t t))) + (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))))) + (puthash heading (point-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))) + (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 for marker = (gethash completion table) - for todo-state = (if-let (it (org-entry-get marker "TODO")) - (concat (propertize it - 'face (org-get-todo-face it)) - " ") - "") - for snippet = (if-let (it (snippet marker)) - (propertize (concat " " it) - 'face 'org-ql-completing-read-snippet) - "") - collect (list completion todo-state snippet))) + 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. + ;; 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)) ""))) - (snippet (marker) - (org-with-point-at marker - (or (funcall org-ql-completing-read-snippet-function snippet-regexp) - (org-ql-completing-read--snippet-simple)))) + (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 (gethash candidate table)))) (_ candidate))) - (try (string _table _pred point &optional _metadata) + (try (string _collection _pred point &optional _metadata) + ;; (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)) - (collection (str _pred flag) + (collection (input _pred flag) (when query-prefix - (setf str (concat query-prefix str))) + (setf input (concat query-prefix input))) (pcase flag ('metadata (list 'metadata (cons 'group-function #'group) (cons 'affixation-function #'affix) (cons 'annotation-function #'annotate))) - (`t (unless (string-empty-p str) - (when query-filter - (setf str (funcall query-filter str))) - (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 str 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 str) - :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'. + (`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) + (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 + ;; 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'. (unless (listp buffers-files) ;; Since we map across this argument, we ensure it's a list. (setf buffers-files (list buffers-files))) (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))) - (gethash selected table))))) + (selected (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 + ;; (e.g. a heading "foo" that matches a query "todo:"), `completing-read' will not + ;; select it automatically, so we return it ourselves. But note that this is not + ;; necessarily correct. For example, if the user types "todo:" and gets a list of + ;; completions ("foo" "bar"), and then changes the input to "ba" and presses RET + ;; immediately (without getting a new list of completions), the table will include "foo" + ;; and "bar", and we will return "foo"'s value rather than the first match for the query + ;; "ba", because `completing-read' will not cause the COLLECTION function to run a new + ;; query for the new input. + (car (hash-table-values table)) + (user-error "No results for input")))))) (defun org-ql-completing-read--snippet-simple (&optional _regexp) "Return a snippet of the current entry. diff --git a/org-ql.info b/org-ql.info index 741030a..7998193 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1025,7 +1025,11 @@ File: README.info, Node: 071-pre, Next: 07, Up: Changelog 5.1 0.7.1-pre ============= -Nothing new yet. +*Fixes* + • Function ‘org-ql-completing-read’ is more compatible with default + Emacs completion. (See #338 + (https://github.com/alphapapa/org-ql/issues/338). Thanks to + arozbiz (https://github.com/arozbiz) for reporting.)  File: README.info, Node: 07, Next: 063, Prev: 071-pre, Up: Changelog @@ -1748,36 +1752,36 @@ Node: Links37270 Node: Tips37957 Node: Changelog38281 Node: 071-pre39079 -Node: 0739190 -Node: 06342118 -Node: 06242649 -Node: 06142954 -Node: 0643522 -Node: 05246576 -Node: 05146876 -Node: 0547299 -Node: 04948828 -Node: 04849110 -Node: 04749459 -Node: 04649868 -Node: 04550276 -Node: 04450637 -Node: 04350996 -Node: 04251199 -Node: 04151360 -Node: 0451607 -Node: 03255708 -Node: 03156111 -Node: 0356308 -Node: 02359608 -Node: 02259842 -Node: 02160122 -Node: 0260327 -Node: 0164405 -Node: Notes64506 -Node: Comparison with Org Agenda searches64668 -Node: org-sidebar65557 -Node: License65836 +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  End Tag Table From 1d98c7d07c6f2af5c84e8358cb6c5db71e8f1006 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Tue, 14 Mar 2023 12:13:07 -0500 Subject: [PATCH 080/224] 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 081/224] 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 082/224] 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 083/224] 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>()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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 084/224] 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 085/224] 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 086/224] 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 087/224] 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 088/224] 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 089/224] 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 090/224] 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 091/224] 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 092/224] 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 093/224] 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 094/224] 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 095/224] 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 096/224] 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 097/224] 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 098/224] 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 099/224] 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 100/224] 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 101/224] 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 102/224] 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 103/224] 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 104/224] 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 105/224] 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 106/224] 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 107/224] 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 108/224] 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 109/224] 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 110/224] 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 111/224] 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 112/224] 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 113/224] 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 114/224] 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 115/224] 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 116/224] 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 117/224] 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 118/224] 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 119/224] 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 120/224] 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 121/224] 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 122/224] 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 123/224] 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 124/224] 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 125/224] 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 126/224] 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 127/224] 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 128/224] 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 129/224] 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 130/224] 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 131/224] 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 132/224] 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 133/224] 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 134/224] 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 135/224] 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 136/224] 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 137/224] 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 138/224] 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 139/224] 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 140/224] 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 141/224] 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 142/224] 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 143/224] 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 144/224] 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 145/224] 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 146/224] 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 147/224] 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 148/224] 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 149/224] 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 150/224] 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 151/224] 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 152/224] 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 153/224] 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 154/224] 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 155/224] 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 156/224] 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 157/224] 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 158/224] 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 159/224] 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 160/224] 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 161/224] 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 162/224] 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 163/224] 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 164/224] 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 165/224] 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 166/224] 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 167/224] 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 168/224] 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 169/224] 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 170/224] 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 171/224] 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 172/224] 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 173/224] 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 174/224] 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 175/224] 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 176/224] 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 177/224] 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 178/224] 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 179/224] 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 180/224] 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 181/224] 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 182/224] 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 183/224] 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 184/224] 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 185/224] 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 186/224] 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 187/224] 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 188/224] 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 189/224] 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 190/224] 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 191/224] 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 192/224] 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 193/224] 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 194/224] 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 195/224] 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 196/224] 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 197/224] 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 198/224] 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 199/224] 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 200/224] 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 201/224] 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 202/224] 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 203/224] 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 204/224] 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 205/224] 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 206/224] 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 207/224] 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 208/224] 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 209/224] 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 210/224] 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 211/224] 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 212/224] 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 213/224] 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 214/224] 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 215/224] 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 216/224] 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 217/224] 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 218/224] 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 219/224] 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 220/224] 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 221/224] 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 222/224] 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 223/224] =?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 224/224] 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