aboutsummaryrefslogtreecommitdiff
path: root/tests/test-org-agenda-config-commands.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-15 16:25:27 -0500
committerCraig Jennings <c@cjennings.net>2026-06-15 16:25:27 -0500
commit2ee7d97344d463ba6c1e51f165929fb3513c80e8 (patch)
treed565b440a50905e0a8b2de1e97dbdc8a10f7e2c1 /tests/test-org-agenda-config-commands.el
parent6c1fb575f33e0868e935fbf5d495e74b20ec725c (diff)
downloaddotemacs-2ee7d97344d463ba6c1e51f165929fb3513c80e8.tar.gz
dotemacs-2ee7d97344d463ba6c1e51f165929fb3513c80e8.zip
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.
Diffstat (limited to 'tests/test-org-agenda-config-commands.el')
-rw-r--r--tests/test-org-agenda-config-commands.el18
1 files changed, 18 insertions, 0 deletions
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 ()