all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Bernt Hansen <bernt@norang.ca>
To: emacs-orgmode@gnu.org
Cc: Bernt Hansen <bernt@norang.ca>
Subject: [PATCH v2] Fix agenda display for late scheduled and deadline tasks
Date: Tue, 22 Jun 2010 17:40:16 -0400	[thread overview]
Message-ID: <1277242816-29777-1-git-send-email-bernt@norang.ca> (raw)
In-Reply-To: <36E79B10-2D5D-434D-8C81-22E1FA8BDE4E@gmail.com>

* 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	other threads:[~2010-06-22 21:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-12 16:09 [PATCH] Fix agenda display for late scheduled and deadline tasks Bernt Hansen
2010-06-12 16:13 ` Bernt Hansen
2010-06-16 14:16   ` Bastien
2010-06-21 12:45   ` Matt Lundin
2010-06-21 12:51     ` Bernt Hansen
2010-06-21 13:02       ` Bernt Hansen
2010-06-21 13:06         ` Carsten Dominik
2010-06-21 13:08           ` Bernt Hansen
2010-06-21 13:21             ` Carsten Dominik
2010-06-22 21:40               ` Bernt Hansen [this message]
2010-06-23 15:26                 ` [PATCH v2] " Carsten Dominik
2010-06-23 15:38                   ` Bernt Hansen
2010-06-23 15:42                     ` Carsten Dominik
2010-07-01 13:00                 ` Carsten Dominik
2010-07-01 13:19                   ` Bernt Hansen

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1277242816-29777-1-git-send-email-bernt@norang.ca \
    --to=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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.