* [patch] add 'tel' and 'note' property
@ 2013-04-05 2:22 Feng Shu
2013-04-05 6:40 ` Bastien
0 siblings, 1 reply; 4+ messages in thread
From: Feng Shu @ 2013-04-05 2:22 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: 0001-Let-org-contacts.el-has-the-ability-which-can-export.patch --]
[-- Type: text/x-diff, Size: 2106 bytes --]
From 94cb96299561618ec237e8cb17cc27bdb38218ac Mon Sep 17 00:00:00 2001
From: Feng Shu <tumashu@gmail.com>
Date: Fri, 5 Apr 2013 09:47:04 +0800
Subject: [PATCH 1/3] 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
---
contrib/lisp/org-contacts.el | 10 ++++++++--
1 个文件被修改,插入 8 行(+),删除 2 行(-)
diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el
index e78b9da..b85ae2d 100644
--- a/contrib/lisp/org-contacts.el
+++ b/contrib/lisp/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
--
1.7.10.4
[-- Attachment #2: 0002-org-contacts.el-add-note-property.patch --]
[-- Type: text/x-diff, Size: 1370 bytes --]
From fee9e6afbf38db8dcf94763d1e07ca2b35342dea Mon Sep 17 00:00:00 2001
From: Feng Shu <tumashu@gmail.com>
Date: Fri, 5 Apr 2013 09:54:06 +0800
Subject: [PATCH 2/3] org-contacts.el, add note property
* org-contacts.el (org-contacts-note-property): New varible which add note property
(org-contacts-vcard-format): Add the ability exporting note property
---
contrib/lisp/org-contacts.el | 6 ++++++
1 个文件被修改,插入 6 行(+)
diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el
index b85ae2d..5f16d41 100644
--- a/contrib/lisp/org-contacts.el
+++ b/contrib/lisp/org-contacts.el
@@ -71,6 +71,11 @@ When set to nil, all your Org files will be used."
:type 'string
:group 'org-contacts)
+(defcustom org-contacts-note-property "NOTE"
+ "Name of the property for contact note."
+ :type 'string
+ :group 'org-contacts)
+
(defcustom org-contacts-birthday-format "Birthday: %l (%Y)"
"Format of the anniversary agenda entry.
The following replacements are available:
@@ -841,6 +846,7 @@ to do our best."
(calendar-extract-month cal-bday)
(calendar-extract-day cal-bday))))
(when nick (format "NICKNAME:%s\n" nick))
+ (when note (format "NOTE:%s\n" note))
"END:VCARD\n\n")))
(defun org-contacts-export-as-vcard (&optional name file to-buffer)
--
1.7.10.4
[-- Attachment #3: 0003-org-contacts.el-add-tel-property.patch --]
[-- Type: text/x-diff, Size: 1585 bytes --]
From 38ef150badd21eb0c5d9159e6444cdeeb1252380 Mon Sep 17 00:00:00 2001
From: Feng Shu <tumashu@gmail.com>
Date: Fri, 5 Apr 2013 09:59:55 +0800
Subject: [PATCH 3/3] 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
---
contrib/lisp/org-contacts.el | 12 ++++++++++++
1 个文件被修改,插入 12 行(+)
diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el
index 5f16d41..8172c80 100644
--- a/contrib/lisp/org-contacts.el
+++ b/contrib/lisp/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."
result))
(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) "\n"))
+ (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"
--
1.7.10.4
[-- Attachment #4: Type: text/plain, Size: 5 bytes --]
--
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [patch] add 'tel' and 'note' property
2013-04-05 2:22 [patch] add 'tel' and 'note' property Feng Shu
@ 2013-04-05 6:40 ` Bastien
2013-04-07 3:16 ` Fix bugs introduced by "[patch] add 'tel' and 'note' property' Feng Shu
0 siblings, 1 reply; 4+ messages in thread
From: Bastien @ 2013-04-05 6:40 UTC (permalink / raw)
To: Feng Shu; +Cc: emacs-orgmode
Applied, thanks.
--
Bastien
^ permalink raw reply [flat|nested] 4+ messages in thread
* Fix bugs introduced by "[patch] add 'tel' and 'note' property'
2013-04-05 6:40 ` Bastien
@ 2013-04-07 3:16 ` Feng Shu
2013-04-07 6:07 ` Bastien
0 siblings, 1 reply; 4+ messages in thread
From: Feng Shu @ 2013-04-07 3:16 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: 0001-PATCH-org-contacts.el-fix-bugs-about-tel-and-note-pr.patch --]
[-- Type: text/x-diff, Size: 1255 bytes --]
From 4eb305cdf2f7c59b8e014514c0409d4da2eb9eab Mon Sep 17 00:00:00 2001
From: Feng Shu <tumashu@gmail.com>
Date: Sun, 7 Apr 2013 11:12:09 +0800
Subject: [PATCH] [PATCH] org-contacts.el , fix bugs about 'tel and 'note
properties
* contrib/lisp/org-contacts.el (org-contacts-vcard-format): fix bug
prvious intruduced ,add 'tel and 'note
---
contrib/lisp/org-contacts.el | 2 ++
1 个文件被修改,插入 2 行(+)
diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el
index f529014..65eeea8 100644
--- a/contrib/lisp/org-contacts.el
+++ b/contrib/lisp/org-contacts.el
@@ -834,6 +834,8 @@ to do our best."
(name (org-contacts-vcard-escape (car contact)))
(n (org-contacts-vcard-encode-name name))
(email (cdr (assoc-string org-contacts-email-property properties)))
+ (tel (cdr (assoc-string org-contacts-tel-property properties)))
+ (note (cdr (assoc-string org-contacts-note-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))))
--
1.7.10.4
[-- Attachment #2: Type: text/plain, Size: 5 bytes --]
--
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: Fix bugs introduced by "[patch] add 'tel' and 'note' property'
2013-04-07 3:16 ` Fix bugs introduced by "[patch] add 'tel' and 'note' property' Feng Shu
@ 2013-04-07 6:07 ` Bastien
0 siblings, 0 replies; 4+ messages in thread
From: Bastien @ 2013-04-07 6:07 UTC (permalink / raw)
To: Feng Shu; +Cc: emacs-orgmode
Hi Feng,
Feng Shu <tumashu@gmail.com> writes:
> From 4eb305cdf2f7c59b8e014514c0409d4da2eb9eab Mon Sep 17 00:00:00 2001
> From: Feng Shu <tumashu@gmail.com>
> Date: Sun, 7 Apr 2013 11:12:09 +0800
> Subject: [PATCH] [PATCH] org-contacts.el , fix bugs about 'tel and 'note
> properties
Applied, thanks.
--
Bastien
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-04-07 6:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-05 2:22 [patch] add 'tel' and 'note' property Feng Shu
2013-04-05 6:40 ` Bastien
2013-04-07 3:16 ` Fix bugs introduced by "[patch] add 'tel' and 'note' property' Feng Shu
2013-04-07 6:07 ` Bastien
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).