From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tassilo Horn 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 22:30:06 +0200 Message-ID: <87iq4ty8mp.fsf@thinkpad.tsdh.de> References: <87k4padxyn.fsf@thinkpad.tsdh.de> <87hbke2j8y.fsf@gollum.intra.norang.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=58165 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OVsJ1-0007Kc-Fr for emacs-orgmode@gnu.org; Mon, 05 Jul 2010 16:30:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OVsJ0-0000O8-1Q for emacs-orgmode@gnu.org; Mon, 05 Jul 2010 16:30:19 -0400 Received: from lo.gmane.org ([80.91.229.12]:60363) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OVsIz-0000Np-Nk for emacs-orgmode@gnu.org; Mon, 05 Jul 2010 16:30:18 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OVsIx-0003CB-EE for emacs-orgmode@gnu.org; Mon, 05 Jul 2010 22:30:15 +0200 Received: from p54af1de6.dip0.t-ipconnect.de ([84.175.29.230]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 05 Jul 2010 22:30:15 +0200 Received: from tassilo by p54af1de6.dip0.t-ipconnect.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 05 Jul 2010 22:30:15 +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: emacs-orgmode@gnu.org Cc: Bernt Hansen Hi again, Bernt! I did some debugging. 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... I deleted the whole underlined predicate, and then the agenda works again for me. Bye, Tassilo