Revert "org-agenda.el: Fix handling of one-time delays"

* lisp/org-agenda.el (org-agenda-get-scheduled): Revert changes from
39c656870, which introduced a regression that prevents repeating tasks
from appearing for future dates.

The regression, reported in late February, seems likely to affect more
users than the one-time delay handling fixed by 39c656870
(org-agenda.el: Fix handling of one-time delays, 2020-02-01).  As we
don't have a proposed fix at the moment, let's revert 39c656870.

Reported-by: Gustavo Barros <gusbrs.2016@gmail.com>
  <87imjqdtpo.fsf@gmail.com>
This commit is contained in:
Kyle Meyer 2020-04-12 01:41:28 -04:00
parent a5cb52b4f8
commit 1de7eabf25
1 changed files with 7 additions and 23 deletions

View File

@ -6298,10 +6298,6 @@ scheduled items with an hour specification like [h]h:mm."
(org-agenda--timestamp-to-absolute deadline))
org-scheduled-delay-days))
(t 0))))
(diff-r (abs (- repeat current)))
(ddays-once (or (and (string-match "--\\([0-9]+\\)[hdwmy]" s)
(string-to-number (match-string 1 s)))
0))
(ddays
(cond
;; Nullify delay when a repeater triggered already
@ -6320,25 +6316,13 @@ scheduled items with an hour specification like [h]h:mm."
(unless (and todayp
habitp
(bound-and-true-p org-habit-show-all-today))
(when (or
;; no one-time delay, not repeated delay
(and (not ddays-once) (not (= ddays diff-r)))
;; one-time delay, but not for today
(and ddays-once
(not (= diff diff-r))
(= ddays-once diff-r))
;; normal delay, but already in the past
(and (> ddays 0) (< diff ddays))
;; a habit, but past `org-habit-scheduled-past-days'
(> diff (or (and habitp org-habit-scheduled-past-days)
org-scheduled-past-days))
;; schedule in the future
(> schedule current)
;; no delay, not scheduled today, no deadline for today
(and (= ddays 0)
(/= current schedule)
(/= current today)
(/= current repeat)))
(when (or (and (> ddays 0) (< diff ddays))
(> diff (or (and habitp org-habit-scheduled-past-days)
org-scheduled-past-days))
(> schedule current)
(and (/= current schedule)
(/= current today)
(/= current repeat)))
(throw :skip nil)))
;; Possibly skip done tasks.
(when (and donep