From 39a465d54964873980b1b3fe147e7e640bf74985 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Tue, 5 May 2026 04:19:24 -0500 Subject: test: add entry-status, days-since-creation, and overdue ordering coverage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- org-drill.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'org-drill.el') 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 -- cgit v1.2.3