From mboxrd@z Thu Jan 1 00:00:00 1970 From: Justus-dev@Piater.name Subject: Re: Patch: org-agenda-skip-deadline-prewarning-if-scheduled prior to scheduled date Date: Wed, 17 Oct 2012 16:29:32 +0200 Message-ID: <87y5j5cgtv.fsf@pc130-c703.uibk.ac.at> References: <87wqypedlk.fsf@pc130-c703.uibk.ac.at> <87zk3lmelw.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:45905) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOUcy-0007fA-0X for emacs-orgmode@gnu.org; Wed, 17 Oct 2012 10:29:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TOUcp-0000uE-Tr for emacs-orgmode@gnu.org; Wed, 17 Oct 2012 10:29:43 -0400 Received: from lmr1.uibk.ac.at ([138.232.1.142]:45529 helo=smtp.uibk.ac.at) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOUcp-0000u2-K0 for emacs-orgmode@gnu.org; Wed, 17 Oct 2012 10:29:35 -0400 In-Reply-To: <87zk3lmelw.fsf@gmail.com> (Nicolas Goaziou's message of "Wed, 17 Oct 2012 15:07:23 +0200") 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nicolas Goaziou Cc: emacs-orgmode@gnu.org Nicolas, Many thanks for your comments, I will heed them all. But first one more request for comments that I forgot to include in my original message: Computing the difference between two dates in the presence of repeating dates is a subtle affair. Here, in computing the difference between deadline (d2) and scheduled date (ds), (min (- d2 (org-time-string-to-absolute ds d1 'past show-all (current-buffer) pos)) org-deadline-warning-days) I simply followed the time-to-deadline computation of the current TODO item from a few lines above: (setq ... d2 (org-time-string-to-absolute (match-string 1) d1 'past show-all (current-buffer) pos) diff (- d2 d1)) I sort-of see what this org-time-string-to-absolute call does, but I do not fully understand its implications. It would be good for someone who does to verify that my code indeed rightly follows the same logic. It appears to work for me with various repeating and non-repeating TODOs with dates in past and future, but I certainly did not exhaustively test all possible combinations of sensible and nonsensical combinations of non/repeating scheduled and deadline dates, show-all, and so on. Cheers, Justus -- Intelligent and Interactive Systems https://iis.uibk.ac.at/ Institute of Computer Science, University of Innsbruck, Austria