From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: [PATCH v2] Fix agenda display for late scheduled and deadline tasks Date: Tue, 22 Jun 2010 17:40:16 -0400 Message-ID: <1277242816-29777-1-git-send-email-bernt@norang.ca> References: <36E79B10-2D5D-434D-8C81-22E1FA8BDE4E@gmail.com> Return-path: Received: from [140.186.70.92] (port=32907 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ORBCh-0001z6-Sm for emacs-orgmode@gnu.org; Tue, 22 Jun 2010 17:40:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ORBCg-0001Sb-MP for emacs-orgmode@gnu.org; Tue, 22 Jun 2010 17:40:23 -0400 Received: from mho-02-ewr.mailhop.org ([204.13.248.72]:60486) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ORBCg-0001SW-KP for emacs-orgmode@gnu.org; Tue, 22 Jun 2010 17:40:22 -0400 Received: from cpe000102d0fe75-cm0012256ecbde.cpe.net.cable.rogers.com ([99.239.148.180] helo=mail.norang.ca) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1ORBCf-0006G1-Qj for emacs-orgmode@gnu.org; Tue, 22 Jun 2010 21:40:21 +0000 In-Reply-To: <36E79B10-2D5D-434D-8C81-22E1FA8BDE4E@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Cc: Bernt Hansen * lisp/org.el (org-time-string-to-absolute): Ignore the cyclic repeater when displaying items on today's agenda date. If you have a weekly task and miss the date the agenda view will show more than a week late now instead of resetting on the cyclic repeating date. This makes it much more obvious when you missed a repeating task after the repeater. --- Here's a new version of this patch which I think addresses Matt's issue and it's simpler which is always a bonus. The patch is available at git://git.norang.ca/org-mode.git fix-agenda-late-tasks -Bernt lisp/org.el | 21 +++++++++++---------- 1 files changed, 11 insertions(+), 10 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 2628152..4ebf31d 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -14700,16 +14700,17 @@ If there is a specifyer for a cyclic time stamp, get the closest date to DAYNR. PREFER and SHOW-ALL are passed through to `org-closest-date'. the variable date is bound by the calendar when this is called." - (cond - ((and daynr (string-match "\\`%%\\((.*)\\)" s)) - (if (org-diary-sexp-entry (match-string 1 s) "" date) - daynr - (+ daynr 1000))) - ((and daynr (string-match "\\+[0-9]+[dwmy]" s)) - (org-closest-date s (if (and (boundp 'daynr) (integerp daynr)) daynr - (time-to-days (current-time))) (match-string 0 s) - prefer show-all)) - (t (time-to-days (apply 'encode-time (org-parse-time-string s)))))) + (let ((today (calendar-absolute-from-gregorian (calendar-current-date)))) + (cond + ((and daynr (string-match "\\`%%\\((.*)\\)" s)) + (if (org-diary-sexp-entry (match-string 1 s) "" date) + daynr + (+ daynr 1000))) + ((and daynr (not (eq daynr today)) (string-match "\\+[0-9]+[dwmy]" s)) + (org-closest-date s (if (and (boundp 'daynr) (integerp daynr)) daynr + (time-to-days (current-time))) (match-string 0 s) + prefer show-all)) + (t (time-to-days (apply 'encode-time (org-parse-time-string s))))))) (defun org-days-to-iso-week (days) "Return the iso week number." -- 1.7.1.359.gd0b8d