diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-05 04:19:24 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-05 04:19:24 -0500 |
| commit | 39a465d54964873980b1b3fe147e7e640bf74985 (patch) | |
| tree | e25ed25c389096e8f5893d2398390852044f62b9 /org-drill.el | |
| parent | 8a83694d8882a3a80328b7ffd8ddbc2c2c73f3ae (diff) | |
| download | org-drill-39a465d54964873980b1b3fe147e7e640bf74985.tar.gz org-drill-39a465d54964873980b1b3fe147e7e640bf74985.zip | |
test: add entry-status, days-since-creation, and overdue ordering coverage
Plus a docs fix to org-drill-order-overdue-entries' header comment.
16 ERT tests covering:
- org-drill-entry-status: non-drill nil, empty entry nil, virgin :new,
future :future, low-quality :failed, due+short-interval :young,
due+long-interval :old, very-overdue :overdue, skipped-leech
:unscheduled, three-element return shape
- org-drill-entry-days-since-creation: with DATE_ADDED, missing without
flag (nil), missing with use-last-interval-p flag (overdue+interval)
- org-drill-order-overdue-entries: empty stays empty, non-lapsed
sorted by DUE desc, lapsed split (by DUE crossing threshold, not AGE)
appearing after sorted by AGE desc
Fixed misleading header comment at line 2888 — it claimed the lapse
split was by AGE, but the code uses DUE (cl-second). This matches
the semantic gate in org-drill--entry-lapsed-p, so the code was
right and the comment was stale. Updated the comment to state the
actual three-step sort.
Diffstat (limited to 'org-drill.el')
| -rw-r--r-- | org-drill.el | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/org-drill.el b/org-drill.el index e2234e5..dd210a2 100644 --- a/org-drill.el +++ b/org-drill.el @@ -2889,8 +2889,13 @@ all the markers used by Org-Drill will be freed." ;;; where POS is a marker pointing to the start of the entry, and ;;; DUE is a number indicating how many days ago the entry was due. ;;; AGE is the number of days elapsed since item creation (nil if unknown). -;;; if age > lapse threshold (default 90), sort by age (oldest first) -;;; if age < lapse threshold, sort by due (biggest first) +;;; +;;; Sort order: +;;; 1. Split by DUE: entries with DUE > org-drill-lapse-threshold-days +;;; are "lapsed", the rest are "not-lapsed". This matches the gate +;;; in `org-drill--entry-lapsed-p'. +;;; 2. Not-lapsed are sorted by DUE descending (most-overdue first). +;;; 3. Lapsed are appended after, sorted by AGE descending (oldest first). (defun org-drill-order-overdue-entries (session) (let* ((lapsed-days (if org-drill--lapse-very-overdue-entries-p org-drill-lapse-threshold-days |
