From 0d12cdb3f5a0bc2a80803ae762c26766c76ceafe Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Mon, 16 Nov 2020 02:25:45 -0600 Subject: [PATCH] Fix: (org-ql-search-directories-files) Error unless org-directory Fixes #139. Thanks to Matt Huszagh (@matthuszagh) for reporting. Released as 0.4.7. --- README.org | 5 ++ org-ql-search.el | 9 ++-- org-ql.info | 130 ++++++++++++++++++++++++++--------------------- 3 files changed, 84 insertions(+), 60 deletions(-) diff --git a/README.org b/README.org index a7d79eb..23c4a9d 100644 --- a/README.org +++ b/README.org @@ -398,6 +398,11 @@ Expands into a call to ~org-ql-select~ with the same arguments. For convenience /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.4.7 + +*Fixed* ++ Give a useful error if =org-ql-search-directories-files= is called without a directories argument and =org-directory= doesn't exist. (Fixes [[https://github.com/alphapapa/org-ql/issues/139][#139]]. Thanks to [[https://github.com/matthuszagh][Matt Huszagh]] for reporting.) + ** 0.4.6 *Fixed* diff --git a/org-ql-search.el b/org-ql-search.el index d97d59e..cf49281 100644 --- a/org-ql-search.el +++ b/org-ql-search.el @@ -270,9 +270,12 @@ automatically from the query." ;;;; Functions -(cl-defun org-ql-search-directories-files (&key (directories (list org-directory)) - (recurse org-ql-search-directories-files-recursive) - (regexp org-ql-search-directories-files-regexp)) +(cl-defun org-ql-search-directories-files + (&key (directories (if (file-exists-p org-directory) + (list org-directory) + (user-error "org-ql-search-directories-files: No DIRECTORIES given, and `org-directory' doesn't exist"))) + (recurse org-ql-search-directories-files-recursive) + (regexp org-ql-search-directories-files-regexp)) "Return list of matching files in DIRECTORIES, a list of directory paths. When RECURSE is non-nil, recurse into subdirectories. When REGEXP is non-nil, only return files that match REGEXP." diff --git a/org-ql.info b/org-ql.info index 213b610..6e8a77d 100644 --- a/org-ql.info +++ b/org-ql.info @@ -63,6 +63,7 @@ Functions / Macros Changelog +* 0.4.7: 047. * 0.4.6: 046. * 0.4.5: 045. * 0.4.4: 044. @@ -709,6 +710,7 @@ releases. * Menu: +* 0.4.7: 047. * 0.4.6: 046. * 0.4.5: 045. * 0.4.4: 044. @@ -726,9 +728,22 @@ releases. * 0.1: 01.  -File: README.info, Node: 046, Next: 045, Up: Changelog +File: README.info, Node: 047, Next: 046, Up: Changelog -5.1 0.4.6 +5.1 0.4.7 +========= + +*Fixed* + • Give a useful error if org-ql-search-directories-files is called + without a directories argument and org-directory doesn’t exist. + (Fixes #139 (https://github.com/alphapapa/org-ql/issues/139). + Thanks to Matt Huszagh (https://github.com/matthuszagh) for + reporting.) + + +File: README.info, Node: 046, Next: 045, Prev: 047, Up: Changelog + +5.2 0.4.6 ========= *Fixed* @@ -741,7 +756,7 @@ File: README.info, Node: 046, Next: 045, Up: Changelog  File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog -5.2 0.4.5 +5.3 0.4.5 ========= *Fixed* @@ -753,7 +768,7 @@ File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog  File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog -5.3 0.4.4 +5.4 0.4.4 ========= *Fixed* @@ -765,7 +780,7 @@ File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog  File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog -5.4 0.4.3 +5.5 0.4.3 ========= *Fixed* @@ -775,7 +790,7 @@ File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog  File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog -5.5 0.4.2 +5.6 0.4.2 ========= *Fixed* @@ -784,7 +799,7 @@ File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog  File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog -5.6 0.4.1 +5.7 0.4.1 ========= *Fixed* @@ -794,7 +809,7 @@ File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog  File: README.info, Node: 04, Next: 032, Prev: 041, Up: Changelog -5.7 0.4 +5.8 0.4 ======= _Note:_ The next release, 0.5, may include changes which will require @@ -875,7 +890,7 @@ as they will be pushed to the master branch when ready.  File: README.info, Node: 032, Next: 031, Prev: 04, Up: Changelog -5.8 0.3.2 +5.9 0.3.2 ========= *Fixed* @@ -888,8 +903,8 @@ File: README.info, Node: 032, Next: 031, Prev: 04, Up: Changelog  File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog -5.9 0.3.1 -========= +5.10 0.3.1 +========== *Fixed* • Compatibility with Org 9.2. Thanks to Brian Leung @@ -898,7 +913,7 @@ File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog  File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog -5.10 0.3 +5.11 0.3 ======== *Added* @@ -963,7 +978,7 @@ File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog  File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog -5.11 0.2.3 +5.12 0.2.3 ========== *Fixed* @@ -973,7 +988,7 @@ File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog  File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog -5.12 0.2.2 +5.13 0.2.2 ========== *Fixed* @@ -984,7 +999,7 @@ File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog  File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog -5.13 0.2.1 +5.14 0.2.1 ========== *Fixed* @@ -994,7 +1009,7 @@ File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog  File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog -5.14 0.2 +5.15 0.2 ======== *Added* @@ -1077,7 +1092,7 @@ File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog  File: README.info, Node: 01, Prev: 02, Up: Changelog -5.15 0.1 +5.16 0.1 ======== First tagged release. @@ -1138,46 +1153,47 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1492 -Node: Screenshots1666 -Node: Installation1784 -Node: Quelpa2422 -Node: Usage2865 -Node: Commands3214 -Node: org-ql-search3687 -Node: helm-org-ql5335 -Node: org-ql-view5747 -Node: org-ql-view-sidebar5945 -Node: org-ql-view-recent-items6301 -Node: org-ql-sparse-tree6785 -Node: Queries7585 -Node: Non-sexp query syntax8493 -Node: General predicates10200 -Node: Ancestor/descendant predicates15007 -Node: Date/time predicates16135 -Node: Functions / Macros18790 -Node: Agenda-like views19023 -Node: Listing / acting-on results20428 -Node: Changelog25030 -Node: 04625649 -Node: 04526037 -Node: 04426396 -Node: 04326753 -Node: 04226948 -Node: 04127107 -Node: 0427346 -Node: 03231277 -Node: 03131654 -Node: 0331849 -Node: 02334824 -Node: 02235052 -Node: 02135320 -Node: 0235519 -Node: 0139554 -Node: Notes39655 -Node: Comparison with Org Agenda searches39817 -Node: org-sidebar40688 -Node: License40967 +Node: Contents1507 +Node: Screenshots1681 +Node: Installation1799 +Node: Quelpa2437 +Node: Usage2880 +Node: Commands3229 +Node: org-ql-search3702 +Node: helm-org-ql5350 +Node: org-ql-view5762 +Node: org-ql-view-sidebar5960 +Node: org-ql-view-recent-items6316 +Node: org-ql-sparse-tree6800 +Node: Queries7600 +Node: Non-sexp query syntax8508 +Node: General predicates10215 +Node: Ancestor/descendant predicates15022 +Node: Date/time predicates16150 +Node: Functions / Macros18805 +Node: Agenda-like views19038 +Node: Listing / acting-on results20443 +Node: Changelog25045 +Node: 04725679 +Node: 04626062 +Node: 04526462 +Node: 04426821 +Node: 04327178 +Node: 04227373 +Node: 04127532 +Node: 0427771 +Node: 03231702 +Node: 03132079 +Node: 0332276 +Node: 02335251 +Node: 02235479 +Node: 02135747 +Node: 0235946 +Node: 0139981 +Node: Notes40082 +Node: Comparison with Org Agenda searches40244 +Node: org-sidebar41115 +Node: License41394  End Tag Table