From mboxrd@z Thu Jan 1 00:00:00 1970 From: Don March Subject: Re: [PATCH] Reschedule "++" repeaters on same day if in future Date: Thu, 30 Jun 2016 19:07:13 -0400 Message-ID: References: <87poqy27p5.fsf@saiph.selenimh> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=001a113fd41c5db78c053686efe9 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44320) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bIl3b-0000jH-Ip for emacs-orgmode@gnu.org; Thu, 30 Jun 2016 19:07:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bIl3W-0006Km-FA for emacs-orgmode@gnu.org; Thu, 30 Jun 2016 19:07:38 -0400 Received: from mail-it0-f52.google.com ([209.85.214.52]:38104) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bIl3W-0006Kg-9r for emacs-orgmode@gnu.org; Thu, 30 Jun 2016 19:07:34 -0400 Received: by mail-it0-f52.google.com with SMTP id h190so4179617ith.1 for ; Thu, 30 Jun 2016 16:07:34 -0700 (PDT) Received: from mail-io0-f173.google.com (mail-io0-f173.google.com. [209.85.223.173]) by smtp.gmail.com with ESMTPSA id e91sm4855377itd.8.2016.06.30.16.07.33 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Jun 2016 16:07:33 -0700 (PDT) Received: by mail-io0-f173.google.com with SMTP id f30so86050297ioj.2 for ; Thu, 30 Jun 2016 16:07:33 -0700 (PDT) In-Reply-To: <87poqy27p5.fsf@saiph.selenimh> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Don March , emacs-orgmode@gnu.org --001a113fd41c5db78c053686efe9 Content-Type: text/plain; charset=UTF-8 Nicolas Goaziou writes: > Don March 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 wrote: > Hello, > > Don March 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 --001a113fd41c5db78c053686efe9 Content-Type: text/x-patch; charset=US-ASCII; name="0001-Reschedule-repeaters-on-same-day-if-in-future.patch" Content-Disposition: attachment; filename="0001-Reschedule-repeaters-on-same-day-if-in-future.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_iq2x7gcw0 RnJvbSA1YjVmZTliNTAyOGQyMDc0YzMwZjI3MWRiYzJkNjM5ODRkYTJmZjE5IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBEb24gTWFyY2ggPGRvbkBvaHNwaXRlLm5ldD4KRGF0ZTogU3Vu LCAyNiBKdW4gMjAxNiAyMzozNTo0NCAtMDcwMApTdWJqZWN0Oi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