Commit graph

341 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
99a18dff2a Comment: Add TODO 2019-08-18 21:08:35 -05:00
Adam Porter
6aeb3030c6 Add: Customization group 2019-08-16 12:15:09 -05:00
Adam Porter
317a460c1d Tidy: (org-ql--parse-time-string) Remove
Unused now.  It served well.
2019-08-13 21:29:05 -05:00
Adam Porter
eb38cf6b06 Comment: Clarify 2019-08-13 21:28:20 -05:00
Adam Porter
4a9379c83e Comment: Correct comments 2019-08-13 21:27:13 -05:00
Adam Porter
ae8b0c740c Change: (ts) Use ts-in 2019-08-13 21:11:58 -05:00
Adam Porter
94d499bcf3 Meta: Update description 2019-08-13 19:43:17 -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
40b36ecad2 Comment: Add TODO 2019-08-13 17:02:38 -05:00
Adam Porter
1d69ab7b20 Fix: (org-ql-query) Indentation declaration 2019-08-13 16:26:56 -05:00
Adam Porter
9f8101779c Change: (ts) Accept ts structs 2019-08-13 16:08:10 -05:00
Adam Porter
559764aedd Comment: Remove task
Basically done.  Also, I think :from/:to/:on are ultimately better
than numeric comparators like <=, because it's easier to express a
range of dates.
2019-08-13 15:38:47 -05:00
Adam Porter
3856e61800 Fix: (org-ql-select) Don't search hidden/special buffers 2019-08-13 15:05:47 -05:00
Adam Porter
b634647e46 Fix: (org-ql--select) Don't search buffers without headings
Especially important when using org-ql-search to search "all" Org
buffers.
2019-08-13 14:37:27 -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
31bc01bc52 Fix: (org-ql--pre-process-query) Process (not) clauses 2019-08-13 13:48:56 -05:00
Adam Porter
b641e6d53c Comment: Add TODO 2019-08-13 13:19:08 -05:00
Adam Porter
2b47e7c7b0 Comment: Add FIXME 2019-08-13 13:14:11 -05:00
Adam Porter
a425c45afd Add: ts preambles 2019-08-11 16:40:05 -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
1ca5930b2f Tidy: (org-ql-query) Indentation 2019-08-11 11:02:46 -05:00
Adam Porter
a77e60640b Fix: (org-ql-query) Argument
Oops.
2019-08-11 10:41:48 -05:00
Adam Porter
ab0df68aae Add: (org-ql-query) narrow, order-by 2019-08-10 10:18:03 -05:00
Adam Porter
2cdc210645 Add: (habit) preamble 2019-08-09 17:19:07 -05:00
Adam Porter
13993f1394 Add: (closed) preamble 2019-08-09 17:10:03 -05:00
Adam Porter
cd4f3cc99b Add: (scheduled) preamble 2019-08-09 17:07:49 -05:00
Adam Porter
ed26effe1c Add: (deadline) preamble 2019-08-09 17:05:17 -05:00
Adam Porter
e7eb3b2031 Add: (property) Preambles 2019-08-09 16:47:56 -05:00
Adam Porter
2dbe40d9ea Fix: (org-ql-select) Accept special forms and macros in action 2019-08-08 15:51:51 -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
f8a5dc353d Comment: Add/improve some comments 2019-07-26 16:39:29 -05:00
Adam Porter
8a8b74f141 Add: (tags) Preamble and tests
Only enabled when org-use-tag-inheritance is enabled.
2019-07-26 16:39:29 -05:00
Adam Porter
b5ccc3294e Fix: (--select) Don't iterate over every heading with preamble
Oops, using "when" instead of "while" did outline-next-heading even
when re-search-forward found no more matches.  That unnecessarily
slowed down some searches, negating almost all of the gains.
2019-07-26 16:39:29 -05:00
Adam Porter
70176d9c5f Add: Convert bare strings to (regexp) predicates 2019-07-26 16:38:54 -05:00
Adam Porter
7c4297b667 Add/Change: (org-ql-select, org-ql-query) Add/rename function
Also improve docstrings.
2019-07-26 16:38:53 -05:00
Adam Porter
3b9c474193 Fix: (org-ql-query) Don't byte-compile compiled functions 2019-07-24 00:47:43 -05:00
Adam Porter
06c7f55b21 Change: (--query-preamble) Simplify 2019-07-23 23:55:49 -05:00
Adam Porter
6728ddaaa7 Change: (--query-preamble) Simplify (todo) preamble 2019-07-23 23:55:49 -05:00
Adam Porter
76ba0afebd Comment: Add FIXME 2019-07-23 23:55:49 -05:00