From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: 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 Message-ID: <87wrt91vld.fsf@gollum.intra.norang.ca> References: <87k4padxyn.fsf@thinkpad.tsdh.de> <87hbke2j8y.fsf@gollum.intra.norang.ca> <87iq4ty8mp.fsf@thinkpad.tsdh.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=57864 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OVsyA-0008Up-Gl for emacs-orgmode@gnu.org; Mon, 05 Jul 2010 17:12:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OVsy9-0005sW-8D for emacs-orgmode@gnu.org; Mon, 05 Jul 2010 17:12:50 -0400 Received: from mho-02-ewr.mailhop.org ([204.13.248.72]:52474) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OVsy9-0005sS-5p for emacs-orgmode@gnu.org; Mon, 05 Jul 2010 17:12:49 -0400 In-Reply-To: <87iq4ty8mp.fsf@thinkpad.tsdh.de> (Tassilo Horn's message of "Mon\, 05 Jul 2010 22\:30\:06 +0200") 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: Tassilo Horn Cc: emacs-orgmode@gnu.org Tassilo Horn 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