If you have a task with the following timestamp: SCHEDULED: <2016-06-19 Sun 21:00 ++1w>
then marking it as DONE at [2016-06-27 at 07:00] should (debatably) result in SCHEDULED: <2016-06-26 Sun 21:00 ++1w> but instead it becomes SCHEDULED: <2016-07-03 Sun 21:00 ++1w> The attached patch changes the behavior to not skip a repeat occurrence that would occur on the day that a task is completed, if there is a time in the timestamp and it is after the current time. This is really useful, at least for me, and also matches a literal reading of the docs. They say (regarding a "++1w" repeater) #+BEGIN_QUOTE Marking this DONE will shift the date by at least one week, but also by as many weeks as it takes to get this date into the future. #+END_QUOTE With a time before the repeater SCHEDULED: <2016-06-19 Sun 21:00 ++1w> you seem to be saying that you don't start working on this task until Sunday evening every week. If you get busy and don't mark it DONE until the next Sunday morning, then you must be talking about the previous instance, not the repeat occurrence which will become available later that day. So it makes sense to increase the timestamp to later that day: SCHEDULED: <2016-06-26 Sun 21:00 ++1w> For another example, suppose you empty the kitchen trash every night: SCHEDULED: <2016-06-19 Sun 22:00 ++1d> If you don't complete that occurrence for two days and then empty the trash on Tuesday morning, you would still want to empty it that night: SCHEDULED: <2016-06-21 Tue 22:00 ++1d> as opposed to skipping Tuesday night and repeating on Wednesday. These examples seem useful to me. But this change could, in theory, lead to the absurd situation of rescheduling a task for just a couple minutes after its completion. But to me that seems the lesser of two evils; you just mark it DONE again, versus the alternative of thinking that you'll be reminded of a task only to forget all about it. If the task is *already* scheduled for later today, this patch does not affect the current behavior--the task will still be rescheduled on the next occurrence on some future day.
From 59328aa0089bb376df86c89128a741a59d41c378 Mon Sep 17 00:00:00 2001 From: Don March <d...@ohspite.net> Date: Sun, 26 Jun 2016 23:35:44 -0700 Subject: [PATCH] Reschedule "++" repeaters on same day if in future * lisp/org.el (org-auto-repeat-maybe): Include a time in a timestamp (hours and minutes) when checking if a repeat occurrence is in the future. --- lisp/org.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index e13e82d..0b102fb 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -13287,8 +13287,8 @@ has been set" (let ((nshiftmax 10) (nshift 0)) (while (or (= nshift 0) - (<= (time-to-days time) - (time-to-days (current-time)))) + (or (time-less-p time (current-time)) + (equal time (current-time)))) (when (= (cl-incf nshift) nshiftmax) (or (y-or-n-p (format "%d repeater intervals were not \ -- 2.8.1