I'm trying to get
org-agenda to behave a bit more like a paper day planner, and have it only show deadlines on the day that they're due, rather than carrying them forward when they're overdue. So far, I've created a custom
org-agenda view as follows:
(defun org-agenda-skip-deadline-if-not-today () (ignore-errors (let ((subtree-end (save-excursion (org-end-of-subtree t))) (deadline-day (time-to-days (org-time-string-to-time (org-entry-get nil "DEADLINE")))) (now (time-to-days (current-time)))) (and deadline-day (not (= deadline-day now)) subtree-end)))) (setq org-agenda-custom-commands '(("b" agenda "Today's Deadlines" ((org-agenda-span 'day) (org-agenda-skip-function '(org-agenda-skip-deadline-if-not-today)) (org-agenda-entry-types '(:deadline)) (org-agenda-overriding-header "Today's Deadlines")))))
However, this only shows the agenda entries for today. What I would like to do is pass into
org-agenda-skip-deadline-if-not-today the date range of the current agenda view, and have it exclude subtrees whose deadline lies outside of that range.
Is it possible to do that with elisp? I've looked at the org manual for custom agenda views, but I haven't been able to find out get the date range for the current agenda view.