From: Tassilo Horn <tassilo@member.fsf.org>
To: emacs-orgmode@gnu.org
Cc: Bernt Hansen <bernt@norang.ca>
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 [thread overview]
Message-ID: <87iq4ty8mp.fsf@thinkpad.tsdh.de> (raw)
In-Reply-To: 87hbke2j8y.fsf@gollum.intra.norang.ca
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
next prev parent reply other threads:[~2010-07-05 20:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-05 10:28 Bug: Items with repeating timestamps don't appear in the agenda [6.36trans (release_6.36.509.g9e9b)] Tassilo Horn
2010-07-05 12:41 ` Bernt Hansen
2010-07-05 13:19 ` Tassilo Horn
2010-07-05 17:55 ` Tassilo Horn
2010-07-05 19:43 ` Bernt Hansen
2010-07-05 20:30 ` Tassilo Horn [this message]
2010-07-05 21:12 ` Bernt Hansen
2010-07-05 21:16 ` Bernt Hansen
2010-07-05 21:28 ` Carsten Dominik
2010-07-06 6:48 ` Tassilo Horn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87iq4ty8mp.fsf@thinkpad.tsdh.de \
--to=tassilo@member.fsf.org \
--cc=bernt@norang.ca \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).