summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ¼diger Sonderfeld <ruediger@c-plusplus.de>2011-04-30 18:16:35 +0200
committerJulien Danjou <julien@danjou.info>2011-05-03 10:14:49 +0200
commita35b4a7db9eba0204313353e17a655bc6d47a574 (patch)
tree76cf7e0d08f0b6a561d562628c6617a4a49e345c
parentf0f103394c4a0429f261bfc6e4becac8c9e17f1e (diff)
downloadorg-mode-a35b4a7db9eba0204313353e17a655bc6d47a574.tar.gz
org-contacts: added custom org-contacts-birthday-format
Signed-off-by: RĂ¼diger Sonderfeld <ruediger@c-plusplus.de> Signed-off-by: Julien Danjou <julien@danjou.info>
-rw-r--r--contrib/lisp/org-contacts.el13
1 files changed, 12 insertions, 1 deletions
diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el
index e8c4807..06137d7 100644
--- a/contrib/lisp/org-contacts.el
+++ b/contrib/lisp/org-contacts.el
@@ -59,6 +59,16 @@ If set to nil, all your Org files will be used."
:type 'string
:group 'org-contacts)
+(defcustom org-contacts-birthday-format "Birthday: %l (%Y)"
+ "Format of the anniversary agenda entry. The following replacements are available:
+
+ %h - Heading name
+ %l - Link to the heading
+ %y - Number of year
+ %Y - Number of year (ordinal)"
+ :type 'string
+ :group 'org-contacts)
+
(defcustom org-contacts-last-read-mail-property "LAST_READ_MAIL"
"Name of the property for contact last read email link storage."
:type 'string
@@ -263,6 +273,7 @@ Format is a string matching the following format specification:
%Y - Number of year (ordinal)"
(let ((calendar-date-style 'american)
(entry ""))
+ (unless format (setq format org-contacts-birthday-format))
(loop for contact in (org-contacts-filter)
for anniv = (let ((anniv (cdr (assoc-string
(or field org-contacts-birthday-property)
@@ -272,7 +283,7 @@ Format is a string matching the following format specification:
(org-time-string-to-absolute anniv))))
;; Use `diary-anniversary' to compute anniversary.
if (and anniv (apply 'diary-anniversary anniv))
- collect (format-spec (or format "Birthday: %l (%Y)")
+ collect (format-spec format
`((?l . ,(org-with-point-at (cadr contact) (org-store-link nil)))
(?h . ,(car contact))
(?y . ,(- (calendar-extract-year date)