summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-10-22 06:24:21 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-10-23 20:43:28 -0400
commit14ac7bef8b3ec21d072304b2dc602361957ff4fa (patch)
treecf2527d0741defd21f2367f7643d83df720a6673
parent824c8c0dba92dd055cef76ada19ab7a9b7b133a8 (diff)
downloadorg-mode-14ac7bef8b3ec21d072304b2dc602361957ff4fa.tar.gz
Fix to the habit consistency graph builder
-rwxr-xr-xlisp/ChangeLog3
-rw-r--r--lisp/org-habit.el8
2 files changed, 7 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 3df8422..777aadd 100755
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -14,6 +14,9 @@
2009-10-22 John Wiegley <jwiegley@gmail.com>
+ * org-habit.el (org-habit-build-graph): Fix to the graph building
+ when last DONE date is earlier than `org-habit-preceding-days'.
+
* org-clock.el (org-resolve-clocks-if-idle): Fix to the way idle
time is reported after the user comes back (but before they
resolve time).
diff --git a/lisp/org-habit.el b/lisp/org-habit.el
index d87b6ad..a9ecf33 100644
--- a/lisp/org-habit.el
+++ b/lisp/org-habit.el
@@ -278,10 +278,10 @@ Habits are assigned colors on the following basis:
(graph (make-string (1+ (- (time-to-days ending)
(time-to-days starting))) ?\ ))
(index 0))
- (if done-dates
- (while (time-less-p (car done-dates) starting)
- (setq last-done-date (car done-dates)
- done-dates (cdr done-dates))))
+ (while (and done-dates
+ (time-less-p (car done-dates) starting))
+ (setq last-done-date (car done-dates)
+ done-dates (cdr done-dates)))
(while (time-less-p day ending)
(let* ((now-days (time-to-days day))
(in-the-past-p (< now-days current-days))