Browse Source

Fix bug with anniversaries in org-bbdb.el.

Carsten Dominik 16 years ago
parent
commit
5548357d71
2 changed files with 10 additions and 3 deletions
  1. 3 0
      lisp/ChangeLog
  2. 7 3
      lisp/org-bbdb.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2008-10-06  Carsten Dominik  <dominik@science.uva.nl>
 
+	* org-bbdb.el (org-bbdb-anniversaries): Fix but with 29 Feb/1
+	March.
+	
 	* org.el (org-remove-uniherited-tags): Fix reverse interpretation
 	of the list value o `org-use-tag-inheritance'.
 

+ 7 - 3
lisp/org-bbdb.el

@@ -291,11 +291,15 @@ This is used by Org to re-create the anniversary hash table."
          (y (nth 2 date))  ; year
          (annivs (gethash (list m d) org-bbdb-anniv-hash))
          (text ())
-         split class form rec)
+         split class form rec recs)
     
     ;; we don't want to miss people born on Feb. 29th
-    (when (and (= m 3) (= d 1) (not (calendar-leap-year-p y)))
-      (setq annivs (cons annivs (gethash (list 2 29) org-bbdb-anniv-hash))))
+    (when (and (= m 3) (= d 1)
+               (not (null (gethash (list 2 29) org-bbdb-anniv-hash)))
+               (not (calendar-leap-year-p y)))
+      (setq recs (gethash (list 2 29) org-bbdb-anniv-hash))
+      (while (setq rec (pop recs))
+        (push rec annivs)))
 
     (when annivs
       (while (setq rec (pop annivs))