From 2ee7d97344d463ba6c1e51f165929fb3513c80e8 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Mon, 15 Jun 2026 16:25:27 -0500 Subject: refactor(org-agenda): drop OVERDUE block, lead with the schedule The daily F8 agenda opened with an OVERDUE block that re-listed every past-due scheduled or deadline task. Those items already show in the SCHEDULE block on today's line, since org-scheduled-past-days and org-deadline-past-days are both 10000. The OVERDUE section was pure duplication. I removed it and moved SCHEDULE to the top so the calendar leads the view. The now-dead cj/org-agenda-skip-subtree-if-not-overdue helper, its header defvar, and the nine tests covering it are gone too. --- tests/test-org-agenda-config-commands.el | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests/test-org-agenda-config-commands.el') diff --git a/tests/test-org-agenda-config-commands.el b/tests/test-org-agenda-config-commands.el index e29871b7..76407439 100644 --- a/tests/test-org-agenda-config-commands.el +++ b/tests/test-org-agenda-config-commands.el @@ -145,6 +145,24 @@ calling `org-agenda'." (should build-called) (should (equal agenda-args '("a" "d"))))) +;;; org-agenda-custom-commands "d" daily structure + +(defun test-org-agenda--daily-blocks () + "Return the block list of the \"d\" daily agenda command." + (nth 2 (assoc "d" org-agenda-custom-commands))) + +(ert-deftest test-org-agenda-daily-schedule-block-is-first () + "Normal: the schedule (calendar) block leads the daily agenda." + (should (eq (car (nth 0 (test-org-agenda--daily-blocks))) 'agenda))) + +(ert-deftest test-org-agenda-daily-has-no-overdue-block () + "Normal: no overdue block. It duplicated the past-due +scheduled/deadline items the schedule block already surfaces on +today's line (org-scheduled-past-days/org-deadline-past-days are +large), so the standalone OVERDUE section was redundant." + (let ((flat (flatten-tree (test-org-agenda--daily-blocks)))) + (should-not (memq 'cj/org-agenda-skip-subtree-if-not-overdue flat)))) + ;;; cj/add-timestamp-to-org-entry (ert-deftest test-org-agenda-add-timestamp-inserts-on-next-line () -- cgit v1.2.3