branch: scratch/org-contacts-rebased
commit 02808bbf797a8917b1cecd88bae84efb45c09d80
Author: Feng Shu <[email protected]>
Commit: Bastien Guerry <[email protected]>
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: [email protected]; [email protected], [email protected] [email protected]
:END:
The export result is like:
BEGIN:VCARD
VERSION:3.0
N:Name;;;
FN:Name
EMAIL:[email protected]
EMAIL:[email protected]
EMAIL:[email protected]
EMAIL:[email protected]
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