emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Justus-dev@Piater.name
To: Nicolas Goaziou <n.goaziou@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Patch: org-agenda-skip-deadline-prewarning-if-scheduled prior to scheduled date
Date: Wed, 17 Oct 2012 16:29:32 +0200	[thread overview]
Message-ID: <87y5j5cgtv.fsf@pc130-c703.uibk.ac.at> (raw)
In-Reply-To: <87zk3lmelw.fsf@gmail.com> (Nicolas Goaziou's message of "Wed, 17 Oct 2012 15:07:23 +0200")

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

  reply	other threads:[~2012-10-17 14:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-17  7:56 Patch: org-agenda-skip-deadline-prewarning-if-scheduled prior to scheduled date Justus-dev
2012-10-17 13:07 ` Nicolas Goaziou
2012-10-17 14:29   ` Justus-dev [this message]
2012-10-25 13:36     ` Nicolas Goaziou
2012-10-26 11:16   ` Justus-bulk
2012-10-28 10:20     ` Nicolas Goaziou
2012-10-28 12:27       ` Justus-bulk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y5j5cgtv.fsf@pc130-c703.uibk.ac.at \
    --to=justus-dev@piater.name \
    --cc=emacs-orgmode@gnu.org \
    --cc=n.goaziou@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).