[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] scratch/org-contacts-rebased f07f259 049/118: org-contacts.el, ad

From: Stefan Monnier
Subject: [elpa] scratch/org-contacts-rebased f07f259 049/118: org-contacts.el, add tel property
Date: Fri, 12 Nov 2021 15:37:02 -0500 (EST)

branch: scratch/org-contacts-rebased
commit f07f259abd033b0910de712b79794a85cd94c3ef
Author: Feng Shu <tumashu@gmail.com>
Commit: Bastien Guerry <bzg@altern.org>

    org-contacts.el, add tel property
    * org-contacts.el (org-contacts-tel-property): New variable,
      add tel property
      (org-contacts-vcard-format): Add the ability exporting tel property
 org-contacts.el | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/org-contacts.el b/org-contacts.el
index 5f16d41..8172c80 100644
--- a/org-contacts.el
+++ b/org-contacts.el
@@ -61,6 +61,11 @@ When set to nil, all your Org files will be used."
   :type 'string
   :group 'org-contacts)
+(defcustom org-contacts-tel-property "PHONE"
+  "Name of the property for contact phone number."
+  :type 'string
+  :group 'org-contacts)
 (defcustom org-contacts-address-property "ADDRESS"
   "Name of the property for contact address."
   :type 'string
@@ -839,6 +844,13 @@ to do our best."
            (when addr
              (format "ADR:;;%s\n" (replace-regexp-in-string "\\, ?" ";" addr)))
+           (when tel (progn
+                       (setq phones-list (split-string tel "[,;: ]+"))
+                       (setq result "")
+                       (while phones-list
+                         (setq result (concat result  "TEL:" (car phones-list) 
+                         (setq phones-list (cdr phones-list)))
+                       result))
            (when bday
              (let ((cal-bday (calendar-gregorian-from-absolute 
(org-time-string-to-absolute bday))))
                (format "BDAY:%04d-%02d-%02d\n"

reply via email to

[Prev in Thread] Current Thread [Next in Thread]