Merge: 0.2.2
This commit is contained in:
commit
c9ad34c47f
2 changed files with 16 additions and 12 deletions
|
|
@ -499,6 +499,11 @@ Expands into a call to ~org-ql-select~ with the same arguments. For convenience
|
||||||
*Internal*
|
*Internal*
|
||||||
+ Refactored code from file =org-ql-agenda.el= into files =org-ql-search.el= and =org-ql-view.el=. Function and variable names have been changed accordingly.
|
+ Refactored code from file =org-ql-agenda.el= into files =org-ql-search.el= and =org-ql-view.el=. Function and variable names have been changed accordingly.
|
||||||
|
|
||||||
|
** 0.2.2
|
||||||
|
|
||||||
|
*Fixed*
|
||||||
|
+ =(deadline auto)= selector matched entries whose deadlines had a warning period that had not yet been entered (=org-deadline-warning-days= too soon).
|
||||||
|
|
||||||
** 0.2.1
|
** 0.2.1
|
||||||
|
|
||||||
*Fixed*
|
*Fixed*
|
||||||
|
|
|
||||||
23
org-ql.el
23
org-ql.el
|
|
@ -1016,9 +1016,7 @@ parseable by `parse-time-string' which may omit the time value."
|
||||||
:limit (line-end-position 2)))
|
:limit (line-end-position 2)))
|
||||||
|
|
||||||
(org-ql--defpred deadline-warning (&key from to)
|
(org-ql--defpred deadline-warning (&key from to)
|
||||||
"Internal selector used to handle `org-deadline-warning-days' and deadlines with warning periods.
|
"Internal selector used to handle `org-deadline-warning-days' and deadlines with warning periods."
|
||||||
Should be called on a planning line, because it does not search
|
|
||||||
past the end of the current line."
|
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(forward-line 1)
|
(forward-line 1)
|
||||||
(when (re-search-forward org-deadline-time-regexp (line-end-position) t)
|
(when (re-search-forward org-deadline-time-regexp (line-end-position) t)
|
||||||
|
|
@ -1031,15 +1029,16 @@ past the end of the current line."
|
||||||
(`(planning ,tss) (plist-get tss :deadline))
|
(`(planning ,tss) (plist-get tss :deadline))
|
||||||
(`(timestamp . ,_) context)))
|
(`(timestamp . ,_) context)))
|
||||||
((_timestamp (&keys :warning-value :warning-unit)) deadline-ts-element)
|
((_timestamp (&keys :warning-value :warning-unit)) deadline-ts-element)
|
||||||
(ts (ts-parse-org-element deadline-ts-element))
|
(ts (ts-parse-org-element deadline-ts-element)))
|
||||||
(ts (pcase warning-unit
|
(pcase warning-unit
|
||||||
('nil ts)
|
('nil ;; Deadline has no warning unit: compare with ts passed in.
|
||||||
((and unit (or 'year 'month 'day))
|
(cond ((and from to) (ts-in from to ts))
|
||||||
(->> ts (ts-adjust unit (* -1 warning-value))))
|
(from (ts<= from ts))
|
||||||
('week (->> ts (ts-adjust 'day (* -7 warning-value)))))))
|
(to (ts<= ts to))))
|
||||||
(cond ((and from to) (ts-in from to ts))
|
;; Deadline has warning unit: compare with current time (`org-ql--today').
|
||||||
(from (ts<= from ts))
|
((and unit (or 'year 'month 'day))
|
||||||
(to (ts<= ts to)))))))
|
(ts<= (->> ts (ts-adjust unit (- warning-value))) org-ql--today))
|
||||||
|
('week (ts<= (->> ts (ts-adjust 'day (* -7 warning-value))) org-ql--today)))))))
|
||||||
|
|
||||||
(org-ql--defpred planning (&key from to _on)
|
(org-ql--defpred planning (&key from to _on)
|
||||||
;; The underscore before `on' prevents "unused lexical variable"
|
;; The underscore before `on' prevents "unused lexical variable"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue