From c3b151d30a45f32679a166ac9fb220f85ad39dd0 Mon Sep 17 00:00:00 2001 From: Simon Thum Date: Sat, 27 Oct 2012 18:25:24 +0200 Subject: [PATCH 3/3] add telephone capability to org-contacts Signed-off-by: Simon Thum --- contrib/lisp/org-contacts.el | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el index 30b9ed0..dba717f 100644 --- a/contrib/lisp/org-contacts.el +++ b/contrib/lisp/org-contacts.el @@ -64,6 +64,16 @@ If set to nil, all your Org files will be used." :type 'string :group 'org-contacts) +(defcustom org-contacts-private-telephone-property "TEL" + "Name of the property for contact private/home telephone." + :type 'string + :group 'org-contacts) + +(defcustom org-contacts-work-telephone-property "WORKTEL" + "Name of the property for contact work/office telephone." + :type 'string + :group 'org-contacts) + (defcustom org-contacts-birthday-property "BIRTHDAY" "Name of the property for contact birthday date." :type 'string @@ -565,11 +575,15 @@ Org-contacts does not specify how to encode the name. So we try to do our best." (email (org-contacts-vcard-escape (cdr (assoc-string org-contacts-email-property properties)))) (bday (org-contacts-vcard-escape (cdr (assoc-string org-contacts-birthday-property properties)))) (addr (cdr (assoc-string org-contacts-address-property properties))) + (telpriv (org-contacts-vcard-escape (cdr (assoc-string org-contacts-private-telephone-property properties)))) + (telwork (org-contacts-vcard-escape (cdr (assoc-string org-contacts-work-telephone-property properties)))) (nick (org-contacts-vcard-escape (cdr (assoc-string org-contacts-nickname-property properties)))) (head (format "BEGIN:VCARD\nVERSION:3.0\nN:%s\nFN:%s\n" n name))) (concat head (when email (format "EMAIL:%s\n" email)) + (when telpriv (format "TEL;TYPE=HOME,VOICE:%s\n" telpriv)) + (when telwork (format "TEL;TYPE=WORK,VOICE:%s\n" telwork)) (when addr (format "ADR:;;%s\n" (replace-regexp-in-string "\\, ?" ";" addr))) (when bday -- 1.7.8.6