emacs-orgmode
[Top][All Lists]
Advanced

[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: Tassilo Horn
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 22:30:06 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]