1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-11-23 07:18:53 +00:00

BBDB/iCal anniversaries: Use user-defined format

This commit is contained in:
Carsten Dominik 2009-06-22 21:59:21 +02:00
parent e7da07cba5
commit 48bdf22482

View File

@ -362,24 +362,24 @@ This is used by Org to re-create the anniversary hash table."
(defun org-bbdb-format-vevent (key recs)
(let (rec categ)
(while (setq rec (pop recs))
(setq categ (or (nth 2 rec) org-bbdb-default-anniversary-format))
(princ (format "BEGIN:VEVENT
UID: ANNIV-%4i%02i%02i-%s
DTSTART:%4i%02i%02i
SUMMARY:%s\n"
(nth 0 rec)
(nth 0 key)
(nth 1 key)
SUMMARY:%s
DESCRIPTION:%s
CATEGORIES:%s
RRULE:FREQ=YEARLY
END:VEVENT\n"
(nth 0 rec) (nth 0 key) (nth 1 key)
(mapconcat 'identity
(org-split-string (nth 1 rec) "[^a-zA-Z0-90]+")
"-")
(nth 0 rec)
(nth 0 key)
(nth 1 key)
(nth 1 rec)))
(if (setq categ (nth 2 rec))
(princ (format "CATEGORIES:%s\n" (upcase categ))))
(princ "RRULE:FREQ=YEARLY
END:VEVENT\n"))))
(nth 0 rec) (nth 0 key) (nth 1 key)
(nth 1 rec)
(concat (capitalize categ) " " (nth 1 rec))
categ))))
(maphash 'org-bbdb-format-vevent org-bbdb-anniv-hash))
(provide 'org-bbdb)