Commit graph

63 commits

Author SHA1 Message Date
Adam Porter
9a56141f6c Add: (link) predicate 2020-02-24 01:47:02 -06:00
Adam Porter
32c68d7f24 Fix: (--pre-process-query) level predicate with args in plain query
Fixes #96.  Thanks to Akira Komamura (@akirak) for reporting.

Released as 0.4.1.
2020-02-23 23:22:11 -06:00
Adam Porter
e48cdf7143 Tests: Add ancestor/parent tests 2020-01-22 23:33:16 -06:00
Adam Porter
fc536cafd6 Tests: (org-ql-test-show-result) Fix symbol 2020-01-13 20:24:14 -06:00
Adam Porter
16cb6cef52 Tests: Declare variable 2020-01-08 13:05:50 -06:00
Adam Porter
9f5bbeb3f2 Fix: Inherit org-file-tags
Fixes #55.  Closes #57.

Thanks to Mikhail Skorzhinskiy (@mskorzhinskiy).
2020-01-08 10:58:55 -06:00
Adam Porter
dadbbe4a87 Tests: Allow using other data file 2020-01-08 09:26:55 -06:00
Adam Porter
2a7440b639 Tests: Move non-test-data to notes.org 2020-01-08 09:00:24 -06:00
Adam Porter
d2f7b06f3d Tests: Rename symbols, fix loading test data interactively 2020-01-08 06:48:11 -06:00
Adam Porter
997765f9ea Tidy: Comment out unused form
Removes a linter warning for now.
2020-01-03 07:02:06 -06:00
Adam Porter
a513f25b4a Tests: Declare buttercup dependency
Used in makem.sh to parse test dependencies.
2019-12-31 21:13:50 -06:00
Adam Porter
091a732a88 Fix: (--value-at) On cache miss, return nil when function does
Previously, on a cache miss, if FN returned nil, the sentinel would be
returned instead of nil.

Closes #78.  Thanks to Josh Moller-Mara (@mm--) for reporting.
2019-12-21 16:28:51 -06:00
Adam Porter
a1851ed0eb Fix: (--value-at) Clear value cache when buffer changes
Fixes #59.  Thanks to Daniel Hubmann (@hubisan) for reporting.
2019-11-24 05:43:21 -06:00
Adam Porter
7d321630a0 Test: Add test for negated, plain quoted phrase
0.3.2 doesn't have negation, and this should be tested with negation.
2019-10-19 02:04:04 -05:00
Adam Porter
d5c26b7f60 Merge: 0.3.2 2019-10-19 02:01:13 -05:00
Adam Porter
7a4a41e402 Fix: Quoted phrase plain-string queries 2019-10-19 01:55:33 -05:00
Adam Porter
949a06c3ab Add: Negation in plain queries 2019-10-09 19:05:11 -05:00
Adam Porter
37ba30c969 Add: src predicate 2019-10-09 14:23:29 -05:00
Adam Porter
c06e5518eb Add: Predicates outline-path, outline-path-segment 2019-10-07 19:53:10 -05:00
Adam Porter
f4918b19dc Merge: wip/helm-query-rewriting
It's finally time to merge this branch, which adds non-sexp queries,
updates the readme, and a few other things.

Squashed commit of the following:

commit ee54e31dfa2c3335e4ef5498fc9714ddc093968b
Author: Adam Porter <adam@alphapapa.net>
Date:   Sun Oct 6 00:10:19 2019 -0500

    WIP: Depend-on/Require dash-functional

commit 42f6a47d86dfb7f8e96f3b1822e17a3eed825897
Author: Adam Porter <adam@alphapapa.net>
Date:   Sat Oct 5 23:45:06 2019 -0500

    WIP: Update docs

commit eb56e46ed8cd9ad6874dc955375be5efadb4fcf2
Author: Adam Porter <adam@alphapapa.net>
Date:   Sat Oct 5 22:04:24 2019 -0500

    WIP: Add demo script

commit cdd394f4865cd49791b2fbebb1913d9210aeaf35
Author: Adam Porter <adam@alphapapa.net>
Date:   Sat Oct 5 20:24:44 2019 -0500

    WIP: Update demo GIF

commit 7f470a7c3c7612b7718dc26044069dc2a6afdff3
Author: Adam Porter <adam@alphapapa.net>
Date:   Sat Oct 5 13:02:09 2019 -0500

    WIP: (property) Convert keyword properties to strings

    I'm a little uncomfortable with how query parsing and processing is
    getting spread out among 2 or 3 functions, but handling this in the
    plain-query parsing function would require uglier special-case
    workarounds, so this seems like the best solution for now.

commit 4e494a03f29a1d0068daa9cddf095dba15252133
Author: Adam Porter <adam@alphapapa.net>
Date:   Fri Oct 4 16:25:00 2019 -0500

    WIP: Handle query errors, move code, add tags-all, tags& aliases

    This prevents query compilation errors from displaying a warning
    buffer, especially in the Helm command.

    Close to done, but now need to figure out the "property:" predicate,
    because its value argument looks like an alternative property rather
    than a value, e.g. "property:agenda-group,plans" in which "plans" is
    the value for the property "agenda-group".

commit 9d8222d8fa9a584b1ee648c5aa38999200e7c54f
Author: Adam Porter <adam@alphapapa.net>
Date:   Thu Oct 3 22:18:29 2019 -0500

    WIP: Rewrite (priority) predicate to accept multiple priorities

    This commit also fixes a latent bug in the preamble for (priority), which
    wasn't being hit because the query (priority) was being rewritten by
    pre-process to (priority '>= C).

commit 4900470ba52b0fcf4786ab857e316403dec00481
Author: Adam Porter <adam@alphapapa.net>
Date:   Thu Oct 3 20:41:54 2019 -0500

    WIP: More documentation

commit 5041a901f6c1071a4233e5671a0926e65e29a5c0
Author: Adam Porter <adam@alphapapa.net>
Date:   Thu Oct 3 12:30:50 2019 -0500

    WIP: Mention query types for commands

commit bb2d18532cb972a54b5b9056b76b0582eb4cad03
Author: Adam Porter <adam@alphapapa.net>
Date:   Thu Oct 3 11:01:56 2019 -0500

    WIP: Remove old code

commit 8de048e531bfa9ba7058e7d540aae2d332f9be68
Author: Adam Porter <adam@alphapapa.net>
Date:   Thu Oct 3 11:01:03 2019 -0500

    WIP: TODO done

commit 6a38fc845aeb05fe3f03174c04a7011830873705
Author: Adam Porter <adam@alphapapa.net>
Date:   Thu Oct 3 10:59:45 2019 -0500

    WIP: Tidy docstrings

commit 04d0c254fc8694b1363c91a1691f3303fcf7755a
Author: Adam Porter <adam@alphapapa.net>
Date:   Thu Oct 3 10:58:21 2019 -0500

    WIP: Document plain queries

commit 23dcc9bad4a8e6660e48632a20a04adb2654e20d
Author: Adam Porter <adam@alphapapa.net>
Date:   Thu Oct 3 10:27:41 2019 -0500

    WIP: Move ts aliases into defpreds, improve docstrings and comments

commit 6ef710f25bbd430b56ce205b8f314b17cd9ac7c3
Author: Adam Porter <adam@alphapapa.net>
Date:   Thu Oct 3 10:11:17 2019 -0500

    Tidy: Whitespace

commit 1022c4b36fb03a6724d97ba4dd1b5bb68025ed7b
Author: Adam Porter <adam@alphapapa.net>
Date:   Thu Oct 3 10:01:53 2019 -0500

    WIP: (org-ql-search) Accept plain queries

    This way, helm-org-ql and org-ql-search accept queries in the same
    format.

commit 1903e8f5684269c272a2ff3984d4d262f41323c5
Author: Adam Porter <adam@alphapapa.net>
Date:   Thu Oct 3 09:22:35 2019 -0500

    WIP: Add more plain-query tests

commit 9d58e3395e871f3536296ccfbb3901f98416bd9a
Author: Adam Porter <adam@alphapapa.net>
Date:   Thu Oct 3 09:17:07 2019 -0500

    WIP: Return boolean from --plain-query, and only when needed

commit 3770e18e68eaf776aef6fbb94e6ac5648c869c12
Author: Adam Porter <adam@alphapapa.net>
Date:   Thu Oct 3 08:59:55 2019 -0500

    WIP: Parse numbers in key/value args

    e.g. "ts-a:on=-1" for yesterday, or "ts:on=0" or "ts:on=today" for
    today.

commit 0f2b71bb869980f413c7366d1b15fa35f3f6a1c5
Author: Adam Porter <adam@alphapapa.net>
Date:   Thu Oct 3 08:59:43 2019 -0500

    WIP: Rename plain-query function

commit be410a36f4a1c043de24a2d0d2fbbe22135c3385
Author: Adam Porter <adam@alphapapa.net>
Date:   Wed Oct 2 19:21:07 2019 -0500

    WIP: Reverse query properly

    PEG returns queries backwards for some reason, so reverse them back to
    the order they were input in.

commit c184091ac2e96a76696055509ca6245e9a020b03
Author: Adam Porter <adam@alphapapa.net>
Date:   Wed Oct 2 19:17:20 2019 -0500

    WIP: Fix previous commit

    Something weird happens when defining the function that's defined by
    the macro in the eval-when block: It seems that I have to eval it
    twice before it takes effect.  So when I made the previous commit, the
    function defined at the time was working properly, but the function
    defined at the time was apparently not what was written in the file,
    but some intermediate state that had been written before, so I don't
    even know what the code was that was working properly.

    After some more fiddling, this seems to work properly.

commit 4e7288d494c6cfe69f82f3aea4b88feced7232f7
Author: Adam Porter <adam@alphapapa.net>
Date:   Wed Oct 2 18:42:59 2019 -0500

    WIP: Handle keyword/value queries

commit f603d199f47c1115cf11f8661c19c73f056b414d
Author: Adam Porter <adam@alphapapa.net>
Date:   Tue Oct 1 16:45:33 2019 -0500

    WIP: Define pred aliases and input-query function with macros

commit 217ef7dff13e8464baaa50539c82843e48bc3fe8
Author: Adam Porter <adam@alphapapa.net>
Date:   Tue Oct 1 16:16:04 2019 -0500

    WIP: Tidy: Don't quote the lambda

    I don't even know why I did that.

commit 3130f6519d7c21e47a026404e3929f118b003092
Author: Adam Porter <adam@alphapapa.net>
Date:   Fri Sep 27 23:20:50 2019 -0500

    WIP: Parsing with peg

    Seems to be working pretty well.

commit 0762825c7ba8026768aec74b4fffd32b8530c42c
Author: Adam Porter <adam@alphapapa.net>
Date:   Tue Sep 10 16:17:50 2019 -0500

    WIP: Rewriting Helm queries

    Some people are unaccustomed to parentheses, so we'll try to
    accommodate them.
2019-10-06 00:17:14 -05:00
Adam Porter
c34c806127 Tests: (-test-show-result) Fix
Update for refactoring that removed org-ql-agenda.
2019-10-03 22:20:25 -05:00
Adam Porter
e60e217312 Tidy: Test data file
Not sure how that indentation ended up there.
2019-10-01 04:46:31 -05:00
Adam Porter
8f2a02264f Add/Fix: Set case-fold for preambles
And use for (todo) preambles.
2019-09-18 01:33:15 -05:00
Adam Porter
6e4ce26f45 Tests: Add org-tweak-timestamps function 2019-09-16 23:43:34 -05:00
Adam Porter
9bc3138ff8 Tests: Add (heading) 2019-09-11 22:07:59 -05:00
Adam Porter
5574f33682 Change: (regexp) Match all regexps
This seems more useful, because it makes it easier to narrow down
results, which is the most common way to search.
2019-09-11 21:59:39 -05:00
Adam Porter
ea2ed02c84 Add: (path) predicate 2019-09-09 14:08:48 -05:00
Adam Porter
deb78e51c7 Merge: 0.2.1 2019-09-09 09:07:44 -05:00
Adam Porter
55694f17fc Fix: (descendants) matched against parent heading
It matched against parent headings instead of only descendants, which
caused some queries to return incorrect results.

Released as 0.2.1.
2019-09-09 09:05:13 -05:00
Adam Porter
f55aae782c Add: tags-all, tags& 2019-09-05 15:51:40 -05:00
Adam Porter
ca9ab3e6a5 Add: Tag cache, inherited/local tags predicates 2019-09-05 15:51:40 -05:00
Adam Porter
ad9de23987 Comment: Update some to-dos 2019-08-31 23:28:12 -05:00
Adam Porter
a99759d4d9 Add: (priority) Preambles and plain predicate style 2019-08-25 23:24:53 -05:00
Adam Porter
ed32701772 Change/Fix: Restore today arguments to ts-related predicates
Also, DRY some code into a macro.  Much cleaner.
2019-08-19 03:30:38 -05:00
Adam Porter
49d0fa8306 Add: Timestamp selectors :on a number
This ought to be pretty thorough now.
2019-08-19 03:30:37 -05:00
Adam Porter
ab3d1178b9 Add: Call some ts-type predicates with a number/auto 2019-08-19 03:30:37 -05:00
Adam Porter
26a8c3d5dc Tests: Add convenient comment 2019-08-18 20:27:11 -05:00
Adam Porter
6b9b985c1e Change: Use ts for all timestamp-related selectors
This is much simpler, and it seems quite fast with the preambles.
2019-08-13 17:06:39 -05:00
Adam Porter
76debff1c5 Add: Selectors (children) and (descendants) 2019-08-13 14:20:21 -05:00
Adam Porter
515b4960c4 Change: (todo) Don't match done tasks 2019-08-13 14:02:12 -05:00
Adam Porter
4954789ca5 Add/Change: Use ts.el, add ts-a and ts-i
Improves performance, reduces code, and more test cases added.
2019-08-11 16:39:36 -05:00
Adam Porter
913292787b Tests: Query functions/macros
Test a few basic forms of these to ensure, e.g. that arguments don't
get broken.
2019-08-11 11:36:37 -05:00
Adam Porter
1c5bf06804 Tests: Add (habit) 2019-08-09 17:18:56 -05:00
Adam Porter
e7eb3b2031 Add: (property) Preambles 2019-08-09 16:47:56 -05:00
Adam Porter
b12d498cec Tests: Update helper functions 2019-08-09 16:47:01 -05:00
Adam Porter
cc92fccb7f Test: Simplify with org-ql-expect macro 2019-08-08 17:07:25 -05:00
Adam Porter
c4531b25a4 Fix: Compound queries with preamble
Bug was introduced in b5ccc32.
2019-08-08 08:29:26 -05:00
Adam Porter
4db4e411a0 Tests: Fix function definer
Works correctly interactively now.
2019-08-08 08:28:40 -05:00
Adam Porter
7e5cb33031 Tests: Require buttercup
Makes it easier to run interactively by eval'ing the buffer.
2019-08-08 08:28:10 -05:00
Adam Porter
51af2a16a7 Tests: Turn on truncate-lines and add to comment 2019-07-26 16:39:29 -05:00