瀏覽代碼

* lisp/org-agenda.el (org-agenda-get-deadlines):
(org-agenda-get-scheduled):
* lisp/org.el (org-time-string-to-seconds):
For deadline and scheduled agenda display ignore the cyclic repeater
when calculating how many days late the task is. If you have a weekly
task and miss the date the agenda view will show more than a week late
now instead of resetting on the cyclic repeating date. This makes it
much more obvious when you missed a repeating task after the repeater.

Thanks to Bernt Hansen for this patch.

Bastien Guerry 15 年之前
父節點
當前提交
14b689946d
共有 2 個文件被更改,包括 8 次插入6 次删除
  1. 2 2
      lisp/org-agenda.el
  2. 6 4
      lisp/org.el

+ 2 - 2
lisp/org-agenda.el

@@ -4573,7 +4573,7 @@ be skipped."
 	      pos (1- (match-beginning 1))
 	      d2 (org-time-string-to-absolute
 		  (match-string 1) d1 'past
-		  org-agenda-repeating-timestamp-show-all)
+		  org-agenda-repeating-timestamp-show-all t)
 	      diff (- d2 d1)
 	      wdays (if suppress-prewarning
 			(let ((org-deadline-warning-days suppress-prewarning))
@@ -4675,7 +4675,7 @@ FRACTION is what fraction of the head-warning time has passed."
 	      pos (1- (match-beginning 1))
 	      d2 (org-time-string-to-absolute
 		  (match-string 1) d1 'past
-		  org-agenda-repeating-timestamp-show-all)
+		  org-agenda-repeating-timestamp-show-all t)
 	      diff (- d2 d1))
 	(setq pastschedp (and todayp (< diff 0)))
 	;; When to show a scheduled item in the calendar:

+ 6 - 4
lisp/org.el

@@ -14684,18 +14684,20 @@ days in order to avoid rounding problems."
 (defun org-time-string-to-seconds (s)
   (org-float-time (org-time-string-to-time s)))
 
-(defun org-time-string-to-absolute (s &optional daynr prefer show-all)
+(defun org-time-string-to-absolute (s &optional daynr prefer show-all ignore-cyclic)
   "Convert a time stamp to an absolute day number.
-If there is a specifyer for a cyclic time stamp, get the closest date to
+If there is a specifier 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."
+the variable date is bound by the calendar when this is called.
+IGNORE-CYCLIC ignores cyclic repeaters so the returned absolute date
+is based on the original date."
   (cond
    ((and daynr (string-match "\\`%%\\((.*)\\)" s))
     (if (org-diary-sexp-entry (match-string 1 s) "" date)
 	daynr
       (+ daynr 1000)))
-   ((and daynr (string-match "\\+[0-9]+[dwmy]" s))
+   ((and (not ignore-cyclic) daynr (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))