This patch makes a very small change to the function that determines if a
timestamp is close to the current day, which is used for showing/hiding items in
agenda views.

Under current behavior, a deadline of today is close only if it has some amount
of lead time. If your date is 2016-06-01, the following statements evaluate to
nil:
#+BEGIN_SRC emacs-lisp
(org-deadline-close "2016-06-01 Wed -0d") ;; but this is today!
(org-deadline-close "2016-06-02 Wed -1d")
#+END_SRC

One effect of this is that if you set =org-agenda-todo-ignore-deadlines= to
=far= and generate the TODO list agenda view (C-c a t), then items only appear
if you are one day past the point at which they should appear. For example, the
following item does not show up in my current TODO list:
#+BEGIN_EXAMPLE
* TODO due today, no lead time
DEADLINE: <2016-06-01 -0d>
#+END_EXAMPLE
From 5401da2076b9de890fbf086e472c09c3f0a66fdf Mon Sep 17 00:00:00 2001
From: Don March <d...@ohspite.net>
Date: Wed, 1 Jun 2016 00:05:12 -0400
Subject: [PATCH] Make today's deadlines "close" without lead time

* org.el (org-deadline-close): A timestamp is close if the days between
  now and the timestamp are less then or equal to the days of lead time.
---
 lisp/org.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index 680086d..fb9e101 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -17479,7 +17479,7 @@ If SECONDS is non-nil, return the difference in seconds."
 (defun org-deadline-close (timestamp-string &optional ndays)
   "Is the time in TIMESTAMP-STRING close to the current date?"
   (setq ndays (or ndays (org-get-wdays timestamp-string)))
-  (and (< (org-time-stamp-to-now timestamp-string) ndays)
+  (and (<= (org-time-stamp-to-now timestamp-string) ndays)
        (not (org-entry-is-done-p))))
 
 (defun org-get-wdays (ts &optional delay zero-delay)
-- 
2.8.1

Reply via email to