Nicolas Goaziou <m...@nicolasgoaziou.fr> writes:

> Don March <d...@donmarch.net> writes:

>> 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 [...]

> ISYM [2016-06-26 at 07:00].

Yes :) Thanks for understanding anyway. (and ITYM "ITYM", maybe?)

> You should merge both `or'. Also, (equal time (current-time)) is always
> nil since they don't have the same structure.

You're right about both things.  I updated the patch, and also added an
example to the manual.  If that's not what you had it mind, let me know
or feel free to edit.


On Thu, Jun 30, 2016 at 8:16 AM, Nicolas Goaziou <m...@nicolasgoaziou.fr> wrote:
> Hello,
>
> Don March <d...@donmarch.net> writes:
>
>> 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
>
> ISYM [2016-06-26 at 07:00].
>
>>     SCHEDULED: <2016-06-26 Sun 21:00 ++1w>
>>
>> but instead it becomes
>>
>>     SCHEDULED: <2016-07-03 Sun 21:00 ++1w>
>
> With the correction above, it makes sense, indeed.
>
>> -                                  (<= (time-to-days time)
>> -                                      (time-to-days (current-time))))
>> +                                  (or (time-less-p time (current-time))
>> +                                      (equal time (current-time))))
>
> You should merge both `or'. Also, (equal time (current-time)) is always
> nil since they don't have the same structure.
>
> You could write instead
>
>   (while (or (= nshift 0)
>              (not (time-less-p (current-time) time)))
>     ...)
>
> It would be nice to add an explanation along with an example about that
> in the manual, too. WDYT?
>
> Thank you for your patch.
>
> Regards,
>
> --
> Nicolas Goaziou
From 5b5fe9b5028d2074c30f271dbc2d63984da2ff19 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 the time in a
  timestamp (hours and minutes) when checking if a repeat occurrence is
  in the future.
* doc/org.texi (Repeated Tasks): Document repeat occurrences with a time
  in the timestamp.
---
 doc/org.texi | 7 +++++++
 lisp/org.el  | 3 +--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/doc/org.texi b/doc/org.texi
index ae9a738..9d8eb8f 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -6412,6 +6412,13 @@ special repeaters  @samp{++} and @samp{.+}.  For example:
    but also by as many weeks as it takes to get this date into
    the future.  However, it stays on a Sunday, even if you called
    and marked it done on Saturday.
+** TODO Empty kitchen trash
+   DEADLINE: <2008-02-08 Fri 20:00 ++1d>
+   Marking this DONE will shift the date by at least one day, and
+   also by as many days as it takes to get the timestamp into the
+   future.  Since there is a time in the timestamp, the next
+   deadline in the future will be on today's date if you
+   complete the task before 20:00.
 ** TODO Check the batteries in the smoke detectors
    DEADLINE: <2005-11-01 Tue .+1m>
    Marking this DONE will shift the date to one month after
diff --git a/lisp/org.el b/lisp/org.el
index e13e82d..c266709 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -13287,8 +13287,7 @@ has been set"
 			(let ((nshiftmax 10)
 			      (nshift 0))
 			  (while (or (= nshift 0)
-				     (<= (time-to-days time)
-					 (time-to-days (current-time))))
+				     (time-less-p time (current-time)))
 			    (when (= (cl-incf nshift) nshiftmax)
 			      (or (y-or-n-p
 				   (format "%d repeater intervals were not \
-- 
2.8.1

Reply via email to