emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] [PATCH v2] Fix agenda display for late scheduled and deadline


From: Bernt Hansen
Subject: [Orgmode] [PATCH v2] Fix agenda display for late scheduled and deadline tasks
Date: Tue, 22 Jun 2010 17:40:16 -0400

* lisp/org.el (org-time-string-to-absolute):

  Ignore the cyclic repeater when displaying items on today's agenda
  date.  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.
---
Here's a new version of this patch which I think addresses Matt's issue and 
it's simpler 
which is always a bonus.

The patch is available at git://git.norang.ca/org-mode.git fix-agenda-late-tasks

-Bernt


 lisp/org.el |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 2628152..4ebf31d 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -14700,16 +14700,17 @@ 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."
-  (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))
-    (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))))))
+  (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)))))))
 
 (defun org-days-to-iso-week (days)
   "Return the iso week number."
-- 
1.7.1.359.gd0b8d




reply via email to

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