From 58afa03d8c547346c05e83fe13d10340f02fe9a1 Mon Sep 17 00:00:00 2001 From: Feng Shu Date: Fri, 5 Apr 2013 09:47:04 +0800 Subject: [PATCH] Let org-contacts.el has the ability which can export email-address list * org-contacts.el (org-contacts-vcard-format): let the function work with email-address list. The org-contact file is : * Name :PROPERTIES: :EMAIL: name1@test.org; name2@test.org, name3@test.org name4@test.org :END: The export result is like: BEGIN:VCARD VERSION:3.0 N:Name;;; FN:Name EMAIL:name1@test.org EMAIL:name2@test.org EMAIL:name3@test.org EMAIL:name4@test.org END:VCARD --- org-contacts.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/org-contacts.el b/org-contacts.el index e78b9da..b85ae2d 100644 --- a/org-contacts.el +++ b/org-contacts.el @@ -819,13 +819,19 @@ to do our best." (let* ((properties (caddr contact)) (name (org-contacts-vcard-escape (car contact))) (n (org-contacts-vcard-encode-name name)) - (email (org-contacts-vcard-escape (cdr (assoc-string org-contacts-email-property properties)))) + (email (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))) (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 email (progn + (setq emails-list (split-string email "[,;: ]+")) + (setq result "") + (while emails-list + (setq result (concat result "EMAIL:" (car emails-list) "\n")) + (setq emails-list (cdr emails-list))) + result)) (when addr (format "ADR:;;%s\n" (replace-regexp-in-string "\\, ?" ";" addr))) (when bday