Fix agenda display for late scheduled and deadline tasks

* lisp/org.el (org-time-string-to-absolute): Ignore cyclic repeater
when displaying items on todays agenda date.

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.
This commit is contained in:
Bernt Hansen 2010-06-23 02:40:16 +00:00 committed by Carsten Dominik
parent 3308155e23
commit 516640aff9
1 changed files with 11 additions and 10 deletions

View File

@ -14756,16 +14756,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."