[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Orgmode] Re: Bug: Items with repeating timestamps don't appear in the a
From: |
Bernt Hansen |
Subject: |
[Orgmode] Re: Bug: Items with repeating timestamps don't appear in the agenda [6.36trans (release_6.36.509.g9e9b)] |
Date: |
Mon, 05 Jul 2010 17:12:46 -0400 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) |
Tassilo Horn <address@hidden> writes:
> Hi again, Bernt!
>
> I did some debugging.
Thanks. Sorry I've been tied up with work today.
> The reason that the repeating events are not shown is that
> `org-agenda-get-timestamps' doesn't return those repeater events,
> because when it iterates over all timestamps of a file, the test in
> the following `if' always returns t and so we are skipping.
>
> --8<---------------cut here---------------start------------->8---
> (catch :skip
> (and (org-at-date-range-p) (throw :skip nil))
> (org-agenda-skip)
> (if (and (match-end 1)
> (not (= d1 (org-time-string-to-absolute
> (match-string 1) d1 nil
> org-agenda-repeating-timestamp-show-all))))
> (throw :skip nil))
> --8<---------------cut here---------------end--------------->8---
>
> This happens, because `org-time-string-to-absolute' returns the first
> date (the literally written date), not the closest repeating date.
>
> For example, for "<2010-06-28 Mon 22:00 +1w>" (last week's Monday) that
> function returns 733951, although it should return 733958 (last week's
> Monday + 7 days = today), I guess.
>
> The underlined predicate looks suspicious to me:
>
> --8<---------------cut here---------------start------------->8---
> (defun org-time-string-to-absolute (s &optional daynr prefer show-all)
> "Convert a time stamp to an absolute day number.
> 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."
> (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)))))))
> --8<---------------cut here---------------end--------------->8---
>
> Why shouldn't that case trigger when daynr is today? In that case, we
> don't even look at the timestamp s...
This change was my second attempt at fixing the scheduled display when a
weekly TODO entry is missed (ie it's over a week late already). The
agenda display. For the case where we're displaying the scheduled date
for today's agenda I wanted it to reflect how many days late the task is
instead of rolling over on the cyclic repeater.
I don't (yet) understand why your example works on my agenda but not
yours ...
Oh! It's not that the future dates are missing it's the entry for
_today_ that is missing. So yes my commit breaks this and I'll get it
reverted.
Thanks for reporting this issue!
Regards,
Bernt
>
> I deleted the whole underlined predicate, and then the agenda works
> again for me.
>
> Bye,
> Tassilo