From 0e39372146b56902d01d6c1d7cc3aab7bc29d095 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sun, 24 Dec 2023 01:09:49 -0600 Subject: [PATCH 01/48] 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 02/48] 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 9c63a458211c2b6214f352fdd80f2363a761d42e Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sat, 13 Jan 2024 00:47:35 -0600 Subject: [PATCH 03/48] 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 04/48] 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 e41fe9018a4699532ec875bedddc9746f8e362aa Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 21 Feb 2024 20:00:39 -0600 Subject: [PATCH 05/48] 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 0f01f0a9d8a23cf48e5801e9365c84537e927b3b Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 12 Jun 2024 22:47:33 -0500 Subject: [PATCH 06/48] 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 07/48] 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 08/48] 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 09/48] 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 10/48] 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 d4faa216407b6b99f8e4a75512ac8fc8640d67c5 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 26 Jun 2024 12:01:32 -0500 Subject: [PATCH 11/48] 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 12/48] 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 13/48] 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 14/48] 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 15/48] 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 16/48] 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 17/48] 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 18/48] 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 19/48] 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 20/48] 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 21/48] 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 22/48] 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 23/48] 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 24/48] 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 25/48] 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 26/48] 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 27/48] 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 28/48] 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 29/48] 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 30/48] 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 31/48] 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 32/48] 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 33/48] 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 34/48] 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 35/48] 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 36/48] 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 37/48] 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 38/48] 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 39/48] 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 40/48] 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 41/48] 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 42/48] 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 43/48] 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 44/48] 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 45/48] 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 46/48] 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 47/48] =?UTF-8?q?Docs:=20Remove=20grammatical=20typo=20fro?= =?UTF-8?q?m=20=E2=80=9Corg-ql-search-block=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- org-ql-search.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org-ql-search.el b/org-ql-search.el index 9c0aa86..dc7c130 100644 --- a/org-ql-search.el +++ b/org-ql-search.el @@ -235,7 +235,7 @@ Like other agenda block commands, it searches files returned by function `org-agenda-files'. Inserts a newline after the block. If `org-ql-block-header' is non-nil, it is used as the header -string for the block, otherwise a the header is formed +string for the block, otherwise the header is formed automatically from the query." (let (narrow-p old-beg old-end) (when-let* ((from (pcase org-agenda-restrict From ed23480e4b141b53a6c2503d786b8dd7ba22f3e0 Mon Sep 17 00:00:00 2001 From: Jiri Jakes Date: Mon, 17 Aug 2026 19:55:50 +0800 Subject: [PATCH 48/48] 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