Commit graph

504 commits

Author SHA1 Message Date
Adam Porter
0adc23d34d Release: 0.2 2019-08-31 23:49:26 -05:00
Akira Komamura
3a5e4a1e11 Fix: Add autoloads
Fixes #36.  Thanks to Akira Komamura (@akirak).
2019-08-31 23:43:49 -05:00
Adam Porter
42947aa2df Comment: Update to-dos 2019-08-31 23:36:19 -05:00
Adam Porter
a34d5f77bd Change/Tidy: (-agenda--format-element) Remove no-marker warning
And update to-dos.
2019-08-31 23:33:11 -05:00
Adam Porter
ad9de23987 Comment: Update some to-dos 2019-08-31 23:28:12 -05:00
Adam Porter
932960c686 Add: Save position when refreshing search buffers 2019-08-31 23:24:36 -05:00
Adam Porter
dbd385c664 Comment: Remove old TODO 2019-08-31 23:24:36 -05:00
Adam Porter
693f52edef Notes: Add to idea 2019-08-31 23:24:36 -05:00
Adam Porter
df1209dbab Notes: Add idea 2019-08-31 23:24:36 -05:00
Adam Porter
65125a695f Change: (org-ql-agenda--agenda) Also accept strings
This allows the strings to be provided from another function, enabling
features such as a "timeline" view (coming soon...).
2019-08-31 23:24:36 -05:00
Adam Porter
077b7000cf Change: (org-ql-view-recent-items) Use keyword args, etc.
A bit more flexible this way.  Also adjust the default groups to be
less specific to my own config.
2019-08-31 23:24:36 -05:00
Adam Porter
bf14afdf4d Add: (org-ql-views) Agenda-like and Review views 2019-08-31 23:24:36 -05:00
Adam Porter
e4c063e8db Notes: Add 2019-08-31 23:24:36 -05:00
Adam Porter
b49f65cfac Notes: Add 2019-08-31 23:24:36 -05:00
Adam Porter
8d57a69125 Change/Fix: (--select-cached) Query-cache key and narrowing
1.  It seems that caching was broken in
3adaf4e5fc, because I changed what key
was used to retrieve from the cache but not the key that was used to
store in the cache.  I guess I hadn't noticed the performance
difference.  It should be fixed now.

2.  While making this fix, the test suite caught a bug in the new,
almost-fixed version that was caused by not including the preamble in
the key, and it only did so because the tests ran sequentially in the
same Emacs, making use of caching.  If each test were independent and
ran with a clean cache, it wouldn't have caught the bug, and it would
undoubtedly have been quite a head-scratcher, or even a hair-puller,
at some future time.

3.  And I would have pushed a version including that bug if I didn't
have a git pre-push hook that runs the tests, because somehow I missed
running the tests on that particular change.

So, lessons reinforced: tests are good; automated tests are better;
enforced tests are best.

4.  Narrowed queries are now cached using point-min/max in the buffer.
This will be especially helpful for the WIP recursive queries feature.
I do wonder if the overhead of caching might be a drawback in some
cases, however some simple benchmarks of recursive queries that return
about 2,000 results shows a large improvement from caching, reducing
runtime from 3.12 to 0.24 seconds, so it's probably worth it, overall.
2019-08-31 23:24:36 -05:00
Adam Porter
802bc462d6 Change: (children, descendants) Return after finding one match
A simple optimization that can be significant in large subtrees.
2019-08-30 09:32:03 -05:00
Adam Porter
e839397579 Fix: Planning-related predicates searched too far into entries
Planning-line-related predicates searched entire entries, which could
find lines that looked like planning lines but were not.  For example, in an
entry talking about tiny.el, in a source code block, in Elisp comments
that had text resembling an Org planning line, that text would be
found by the regexp search, and the predicate would then attempt to
parse the match, which could fail.

Now the regexp search for planning-line-related predicates is bound by
the end of the line after the heading, which is the only place that
actual Org planning lines are supposed to be.
2019-08-30 05:29:05 -05:00
Adam Porter
d8d2455a2c Notes: Add a benchmark 2019-08-29 06:42:13 -05:00
Adam Porter
aff6f22fee Notes: Add recursive queries 2019-08-29 02:16:27 -05:00
Adam Porter
a99759d4d9 Add: (priority) Preambles and plain predicate style 2019-08-25 23:24:53 -05:00
Adam Porter
a52d421fd7 Add: random sorter 2019-08-25 20:14:31 -05:00
Adam Porter
f26052eb79 Fix: (org-ql-select) Properly accept arbitrary sort function
Fixes #37.  Thanks to Milan Zamazal (@mz-pdm).
2019-08-25 20:08:51 -05:00
Adam Porter
c576813fc8 Fix: (org-ql-agenda-block) Insert newline after block
Fixes #40.  Thanks to Milan Zamazal (@mz-pdm).
2019-08-25 19:59:24 -05:00
Adam Porter
68697c38a1 Docs: (regexp) Clarify
Fixes #39.  Thanks to Milan Zamazal (@mz-pdm).
2019-08-25 19:53:30 -05:00
Adam Porter
0585c368bd Fix: (regexp) Properly join multiple regexps
Fixes #39.  Thanks to Milan Zamazal (@mz-pdm).
2019-08-25 19:51:26 -05:00
Adam Porter
9c38e96e73 Notes: DONE items 2019-08-19 16:44:55 -05:00
Adam Porter
77aa32cfe6 Docs: Update examples 2019-08-19 14:00:40 -05:00
Adam Porter
0cbb03b667 Docs: Changelog 2019-08-19 13:49:50 -05:00
Adam Porter
f8265a233d Docs: Clarify 2019-08-19 13:46:54 -05:00
Adam Porter
b4066607ec Docs: Update examples
I think that's all of them now...
2019-08-19 13:34:29 -05:00
Adam Porter
027bb89373 Fix: (deadline-warning) Handle plain timestamp elements
Sometimes org-element-context returns an element like:

    (planning (:closed (timestamp (:type inactive ...))
               :deadline (timestamp (:type active ...))
               :scheduled (timestamp (:type active ...))
              :begin 93706 ...))

Other times it returns just:

    (timestamp (:type active ...))

Even with point in the same position, immediately after the deadline
timestamp.  I don't know why, and it might even be a bug that's been
fixed in newer version of Org.

Anyway, this handles both.
2019-08-19 13:31:13 -05:00
Adam Porter
fea39f5c05 Tests: Update makem.sh 2019-08-19 03:30:38 -05:00
Adam Porter
c4c861de2e Docs: Update example 2019-08-19 03:30:38 -05:00
Adam Porter
876f20a340 Docs/Notes: Move inline task to notes
GitHub renders the inline task even with :noexport:.
2019-08-19 03:30:38 -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
4d97dc6234 Docs: Update example 2019-08-19 03:30:38 -05:00
Adam Porter
c2b8776eca Change: (org-ql-view-recent-items) Disallow some selectors 2019-08-19 03:30:38 -05:00
Adam Porter
f8f18716ae Change: Move some timestamp-predicate arg processing
Those pcase clauses looked nice and clean, but putting the logic in
the macrolet lets us use number arguments to the keywords, which is
useful.

Eventually I may want to unify this, or put it in the defpred macro.
2019-08-19 03:30:37 -05:00
Adam Porter
8d34bc13bd Docs: s/selectors/predicates/
I tend to use both terms, but I should probably stick to one.
2019-08-19 03:30:37 -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
c2ecbc67a5 Add: org-ql-view-recent-items 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
99a18dff2a Comment: Add TODO 2019-08-18 21:08:35 -05:00
Adam Porter
26a8c3d5dc Tests: Add convenient comment 2019-08-18 20:27:11 -05:00
Adam Porter
869ce69f1d Docs: Bindings 2019-08-16 12:43:35 -05:00
Adam Porter
be92d531ec Add: org-ql-view, org-ql-views, org-ql-search-save 2019-08-16 12:35:24 -05:00
Adam Porter
ae3ec62e3c Add: org-ql-view-map 2019-08-16 12:29:20 -05:00
Adam Porter
429c313634 Docs: Organize commands 2019-08-16 12:27:30 -05:00
Adam Porter
6aeb3030c6 Add: Customization group 2019-08-16 12:15:09 -05:00
Adam Porter
62878f5d9f Fix: Free variable warning 2019-08-16 11:47:04 -05:00