From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [PATCH] Reschedule "++" repeaters on same day if in future Date: Thu, 30 Jun 2016 14:16:06 +0200 Message-ID: <87poqy27p5.fsf@saiph.selenimh> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58017) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bIatF-0002bd-2x for emacs-orgmode@gnu.org; Thu, 30 Jun 2016 08:16:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bIatB-00046J-RN for emacs-orgmode@gnu.org; Thu, 30 Jun 2016 08:16:16 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:59570) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bIatB-00046A-KG for emacs-orgmode@gnu.org; Thu, 30 Jun 2016 08:16:13 -0400 In-Reply-To: (Don March's message of "Mon, 27 Jun 2016 02:49:09 -0400") 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 Cc: emacs-orgmode@gnu.org 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