emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] org-contacts.el: add expire feature
@ 2013-05-29 12:35 Feng Shu
  2013-05-29 21:20 ` Daimrod
                   ` (2 more replies)
  0 siblings, 3 replies; 23+ messages in thread
From: Feng Shu @ 2013-05-29 12:35 UTC (permalink / raw)
  To: orgmode

[-- Attachment #1: 0001-contrib-lisp-org-contacts.el-Add-a-feature-which-can.patch --]
[-- Type: text/x-diff, Size: 4561 bytes --]

From e974db131d88acf06bb6b250eac2fae8c7d0a96e Mon Sep 17 00:00:00 2001
From: Feng Shu <tumashu@gmail.com>
Date: Wed, 29 May 2013 20:30:43 +0800
Subject: [PATCH] * contrib/lisp/org-contacts.el:   Add a feature which can
 expire   emails and phones

* test
  :PROPERTIES:
  :EMAIL: test1@gmail.com  test2@gmail.com  test3@gmail.com
  :PHONE:  123456  123457 123458
  :EXPIRE:  test2@gmail.com 123457
  :END:

when completing or exporting to vcard,  the emails and  phones in the
expire property (test2@gmail.com and 123457) will be ignore
---
 contrib/lisp/org-contacts.el |   32 +++++++++++++++++++++++++++-----
 1 个文件被修改,插入 27 行(+),删除 5 行(-)

diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el
index 7b0b603..ae6c6f1 100644
--- a/contrib/lisp/org-contacts.el
+++ b/contrib/lisp/org-contacts.el
@@ -86,6 +86,11 @@ When set to nil, all your Org files will be used."
   :type 'string
   :group 'org-contacts)
 
+(defcustom org-contacts-expire-property "EXPIRE"
+  "Name of the property for emails or phones which will be expired"
+  :type 'string
+  :group 'org-contacts)
+
 
 (defcustom org-contacts-birthday-format "Birthday: %l (%Y)"
   "Format of the anniversary agenda entry.
@@ -476,6 +481,14 @@ A group FOO is composed of contacts with the tag FOO."
 		(completion-table-case-fold completion-list
 					    (not org-contacts-completion-ignore-case))))))))
 
+
+(defun org-contacts-remove-expired-property (expire-list list)
+  "Remove emails or phones in list-expired from list"
+    (while expire-list
+      (setq list (remove (car expire-list) list))
+      (setq expire-list (cdr expire-list)))
+    list)
+
 (defun org-contacts-complete-name (start end string)
   "Complete text at START with a user name and email."
   (let* ((completion-ignore-case org-contacts-completion-ignore-case)
@@ -484,10 +497,17 @@ A group FOO is composed of contacts with the tag FOO."
 		;; The contact name is always the car of the assoc-list
 		;; returned by `org-contacts-filter'.
 		for contact-name = (car contact)
+
+		;; Build the list of the email addresses which has
+		;; been expired
+		for expire-list = (org-contacts-split-property (or
+								(cdr (assoc-string org-contacts-expire-property
+										   (caddr contact))) ""))
 		;; Build the list of the user email addresses.
-		for email-list = (org-contacts-split-property (or
-						(cdr (assoc-string org-contacts-email-property
-								   (caddr contact))) ""))
+		for email-list = (org-contacts-remove-expired-property expire-list
+								       (org-contacts-split-property (or
+												     (cdr (assoc-string org-contacts-email-property
+															(caddr contact))) "")))
 		;; If the user has email addresses…
 		if email-list
 		;; … append a list of USER <EMAIL>.
@@ -869,15 +889,17 @@ to do our best."
 	 (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)))
+	 (expire  (cdr (assoc-string org-contacts-expire-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))))
 	 (head (format "BEGIN:VCARD\nVERSION:3.0\nN:%s\nFN:%s\n" n name))
+	 (expire-list (when expire (setq expire-list (org-contacts-split-property expire))))
 	 emails-list result phones-list)
     (concat head
 	    (when email (progn
-			  (setq emails-list (org-contacts-split-property email))
+			  (setq emails-list (org-contacts-remove-expired-property expire-list (org-contacts-split-property email))) ;
 			  (setq result "")
 			  (while emails-list
 			    (setq result (concat result  "EMAIL:" (org-contacts-strip-link (car emails-list)) "\n"))
@@ -886,7 +908,7 @@ to do our best."
 	    (when addr
 	      (format "ADR:;;%s\n" (replace-regexp-in-string "\\, ?" ";" addr)))
 	    (when tel (progn
-			(setq phones-list (org-contacts-split-property tel))
+			(setq phones-list (org-contacts-remove-expired-property expire-list (org-contacts-split-property tel)))
 			(setq result "")
 			(while phones-list
 			  (setq result (concat result  "TEL:" (org-contacts-strip-link (car phones-list)) "\n"))
-- 
1.7.10.4


[-- Attachment #2: Type: text/plain, Size: 5 bytes --]


-- 

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [PATCH] org-contacts.el: add expire feature
  2013-05-29 12:35 [PATCH] org-contacts.el: add expire feature Feng Shu
@ 2013-05-29 21:20 ` Daimrod
  2013-05-30  0:32   ` Feng Shu
                     ` (2 more replies)
  2013-05-29 21:30 ` [PATCH] org-contacts.el: add expire feature Daimrod
  2013-05-30  0:42 ` [PATCH] org-contacts.el: ignore emails or phones with ignore property Feng Shu
  2 siblings, 3 replies; 23+ messages in thread
From: Daimrod @ 2013-05-29 21:20 UTC (permalink / raw)
  To: Feng Shu; +Cc: orgmode

[-- Attachment #1: Type: text/plain, Size: 5883 bytes --]

Feng Shu <tumashu@gmail.com> writes:

Hello Feng,

Thanks for this interesting feature, here are some remarks:

> From e974db131d88acf06bb6b250eac2fae8c7d0a96e Mon Sep 17 00:00:00 2001
> From: Feng Shu <tumashu@gmail.com>
> Date: Wed, 29 May 2013 20:30:43 +0800
> Subject: [PATCH] * contrib/lisp/org-contacts.el:   Add a feature which can
>  expire   emails and phones

Could you use the org-mode convention for commit messages?[1]

It should be:

#+BEGIN_SRC change-log
  contrib/lisp/org-contacts.el: Add a feature which can expire emails and phones
  
  ,* contrib/lisp/org-contacts.el: Add a feature which can expire
  emails and phones.
  
  ...[rest of the commit message]...
#+END_SRC

> * test
>   :PROPERTIES:
>   :EMAIL: test1@gmail.com  test2@gmail.com  test3@gmail.com
>   :PHONE:  123456  123457 123458
>   :EXPIRE:  test2@gmail.com 123457
>   :END:
>
> when completing or exporting to vcard,  the emails and  phones in the
> expire property (test2@gmail.com and 123457) will be ignore

Since the purpose of this property is to ignore some values when
exporting to vcard, don't you think it would be better to name it IGNORE
or VCARD_IGNORE? (and of course to rename all functions accordingly)

> ---
>  contrib/lisp/org-contacts.el |   32 +++++++++++++++++++++++++++-----
>  1 个文件被修改,插入 27 行(+),删除 5 行(-)
>
> diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el
> index 7b0b603..ae6c6f1 100644
> --- a/contrib/lisp/org-contacts.el
> +++ b/contrib/lisp/org-contacts.el
> @@ -86,6 +86,11 @@ When set to nil, all your Org files will be used."
>    :type 'string
>    :group 'org-contacts)
>  
> +(defcustom org-contacts-expire-property "EXPIRE"
> +  "Name of the property for emails or phones which will be expired"
> +  :type 'string
> +  :group 'org-contacts)
> +
>  
>  (defcustom org-contacts-birthday-format "Birthday: %l (%Y)"
>    "Format of the anniversary agenda entry.
> @@ -476,6 +481,14 @@ A group FOO is composed of contacts with the tag FOO."
>  		(completion-table-case-fold completion-list
>  					    (not org-contacts-completion-ignore-case))))))))
>  
> +
> +(defun org-contacts-remove-expired-property (expire-list list)
> +  "Remove emails or phones in list-expired from list"

Don't forget the dot at the end of the sentence.

> +    (while expire-list
> +      (setq list (remove (car expire-list) list))
> +      (setq expire-list (cdr expire-list)))
> +    list)
> +

This is not very idiomatic elisp, I would write something more like:
#+BEGIN_SRC emacs-lisp
  (remove-if (lambda (el)
               (member el expire-list)) 
             list)
#+END_SRC

>  (defun org-contacts-complete-name (start end string)
>    "Complete text at START with a user name and email."
>    (let* ((completion-ignore-case org-contacts-completion-ignore-case)
> @@ -484,10 +497,17 @@ A group FOO is composed of contacts with the tag FOO."
>  		;; The contact name is always the car of the assoc-list
>  		;; returned by `org-contacts-filter'.
>  		for contact-name = (car contact)
> +
> +		;; Build the list of the email addresses which has
> +		;; been expired
> +		for expire-list = (org-contacts-split-property (or
> +								(cdr (assoc-string org-contacts-expire-property
> +										   (caddr contact))) ""))
>  		;; Build the list of the user email addresses.
> -		for email-list = (org-contacts-split-property (or
> -						(cdr (assoc-string org-contacts-email-property
> -								   (caddr contact))) ""))
> +		for email-list = (org-contacts-remove-expired-property expire-list
> +								       (org-contacts-split-property (or
> +												     (cdr (assoc-string org-contacts-email-property
> +															(caddr contact))) "")))
>  		;; If the user has email addresses…
>  		if email-list
>  		;; … append a list of USER <EMAIL>.
> @@ -869,15 +889,17 @@ to do our best."
>  	 (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)))
> +	 (expire  (cdr (assoc-string org-contacts-expire-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))))
>  	 (head (format "BEGIN:VCARD\nVERSION:3.0\nN:%s\nFN:%s\n" n name))
> +	 (expire-list (when expire (setq expire-list (org-contacts-split-property expire))))
>  	 emails-list result phones-list)
>      (concat head
>  	    (when email (progn
> -			  (setq emails-list (org-contacts-split-property email))
> +			  (setq emails-list (org-contacts-remove-expired-property expire-list (org-contacts-split-property email))) ;

There is a leading semi-colon.                                                                                        ^^^^

>  			  (setq result "")
>  			  (while emails-list
>  			    (setq result (concat result  "EMAIL:" (org-contacts-strip-link (car emails-list)) "\n"))
> @@ -886,7 +908,7 @@ to do our best."
>  	    (when addr
>  	      (format "ADR:;;%s\n" (replace-regexp-in-string "\\, ?" ";" addr)))
>  	    (when tel (progn
> -			(setq phones-list (org-contacts-split-property tel))
> +			(setq phones-list (org-contacts-remove-expired-property expire-list (org-contacts-split-property tel)))
>  			(setq result "")
>  			(while phones-list
>  			  (setq result (concat result  "TEL:" (org-contacts-strip-link (car phones-list)) "\n"))
> -- 
> 1.7.10.4

[1] http://orgmode.org/worg/org-contribute.html#sec-5

-- 
Daimrod/Greg

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] org-contacts.el: add expire feature
  2013-05-29 12:35 [PATCH] org-contacts.el: add expire feature Feng Shu
  2013-05-29 21:20 ` Daimrod
@ 2013-05-29 21:30 ` Daimrod
  2013-05-29 23:15   ` Feng Shu
  2013-05-30  0:42 ` [PATCH] org-contacts.el: ignore emails or phones with ignore property Feng Shu
  2 siblings, 1 reply; 23+ messages in thread
From: Daimrod @ 2013-05-29 21:30 UTC (permalink / raw)
  To: Feng Shu; +Cc: orgmode

[-- Attachment #1: Type: text/plain, Size: 1310 bytes --]

Feng Shu <tumashu@gmail.com> writes:

>  (defun org-contacts-complete-name (start end string)
>    "Complete text at START with a user name and email."
>    (let* ((completion-ignore-case org-contacts-completion-ignore-case)
> @@ -484,10 +497,17 @@ A group FOO is composed of contacts with the tag FOO."
>  		;; The contact name is always the car of the assoc-list
>  		;; returned by `org-contacts-filter'.
>  		for contact-name = (car contact)
> +
> +		;; Build the list of the email addresses which has
> +		;; been expired
> +		for expire-list = (org-contacts-split-property (or
> +								(cdr (assoc-string org-contacts-expire-property
> +										   (caddr contact))) ""))
>  		;; Build the list of the user email addresses.
> -		for email-list = (org-contacts-split-property (or
> -						(cdr (assoc-string org-contacts-email-property
> -								   (caddr contact))) ""))
> +		for email-list = (org-contacts-remove-expired-property expire-list
> +								       (org-contacts-split-property (or
> +												     (cdr (assoc-string org-contacts-email-property
> +															(caddr contact))) "")))

I forgot to ask, why do you also modify org-contacts-complete-name? This
function isn't used to export to VCARD, but to complete the email in
Gnus.

-- 
Daimrod/Greg

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] org-contacts.el: add expire feature
  2013-05-29 21:30 ` [PATCH] org-contacts.el: add expire feature Daimrod
@ 2013-05-29 23:15   ` Feng Shu
  0 siblings, 0 replies; 23+ messages in thread
From: Feng Shu @ 2013-05-29 23:15 UTC (permalink / raw)
  To: emacs-orgmode

Daimrod <daimrod@gmail.com> writes:

> Feng Shu <tumashu@gmail.com> writes:
>
>>  (defun org-contacts-complete-name (start end string)
>>    "Complete text at START with a user name and email."
>>    (let* ((completion-ignore-case org-contacts-completion-ignore-case)
>> @@ -484,10 +497,17 @@ A group FOO is composed of contacts with the tag FOO."
>>  		;; The contact name is always the car of the assoc-list
>>  		;; returned by `org-contacts-filter'.
>>  		for contact-name = (car contact)
>> +
>> +		;; Build the list of the email addresses which has
>> +		;; been expired
>> +		for expire-list = (org-contacts-split-property (or
>> +								(cdr (assoc-string org-contacts-expire-property
>> +										   (caddr contact))) ""))
>>  		;; Build the list of the user email addresses.
>> -		for email-list = (org-contacts-split-property (or
>> -						(cdr (assoc-string org-contacts-email-property
>> -								   (caddr contact))) ""))
>> +		for email-list = (org-contacts-remove-expired-property expire-list
>> +								       (org-contacts-split-property (or
>> +												     (cdr (assoc-string org-contacts-email-property
>> +															(caddr contact))) "")))
>
> I forgot to ask, why do you also modify org-contacts-complete-name? This
> function isn't used to export to VCARD, but to complete the email in
> Gnus.

I want to ignore the emails which have been expired when I complete in
the gnus

-- 

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] org-contacts.el: add expire feature
  2013-05-29 21:20 ` Daimrod
@ 2013-05-30  0:32   ` Feng Shu
  2013-05-30  0:38   ` Feng Shu
  2013-05-30 17:37   ` Karl Voit
  2 siblings, 0 replies; 23+ messages in thread
From: Feng Shu @ 2013-05-30  0:32 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 53 bytes --]

Daimrod <daimrod@gmail.com> writes:

updated patch;


[-- Attachment #2: 0001-Add-a-feature-which-can-ignore-emails-or-phones-with.patch --]
[-- Type: text/x-diff, Size: 4822 bytes --]

From b0851e4c48e4c2e67fd8aafdf04951e764e07ccf Mon Sep 17 00:00:00 2001
From: Feng Shu <tumashu@gmail.com>
Date: Wed, 29 May 2013 20:30:43 +0800
Subject: [PATCH] Add a feature, which can ignore emails or phones with
 property

* contrib/lisp/org-contacts.el (org-contacts-ignore-property): New variable.
(org-contacts-remove-ignored-property-values): New function, which
remove all ignore-list's elements from list.
(org-contacts-complete-name): When completing, ignore the
values which has been included into the ignore property.
(org-contacts-vcard-format): Don't export the values which has
been included into the ignore property.

If emails or phones is included into the ignore property, they will
not show in complete buffer. When the contact is exported to vcard,
they will be ignored too.
---
 contrib/lisp/org-contacts.el |   31 ++++++++++++++++++++++++++-----
 1 个文件被修改,插入 26 行(+),删除 5 行(-)

diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el
index 7b0b603..1be0ac9 100644
--- a/contrib/lisp/org-contacts.el
+++ b/contrib/lisp/org-contacts.el
@@ -86,6 +86,11 @@ When set to nil, all your Org files will be used."
   :type 'string
   :group 'org-contacts)
 
+(defcustom org-contacts-ignore-property "IGNORE"
+  "Name of the property,  which values will be ignored when complete or export to vcard."
+  :type 'string
+  :group 'org-contacts)
+
 
 (defcustom org-contacts-birthday-format "Birthday: %l (%Y)"
   "Format of the anniversary agenda entry.
@@ -476,6 +481,13 @@ A group FOO is composed of contacts with the tag FOO."
 		(completion-table-case-fold completion-list
 					    (not org-contacts-completion-ignore-case))))))))
 
+
+(defun org-contacts-remove-ignored-property-values (ignore-list list)
+  "Remove all ignore-list's elements from list."
+  (remove-if (lambda (el)
+	       (member el ignore-list)) 
+             list))
+
 (defun org-contacts-complete-name (start end string)
   "Complete text at START with a user name and email."
   (let* ((completion-ignore-case org-contacts-completion-ignore-case)
@@ -484,10 +496,17 @@ A group FOO is composed of contacts with the tag FOO."
 		;; The contact name is always the car of the assoc-list
 		;; returned by `org-contacts-filter'.
 		for contact-name = (car contact)
+
+		;; Build the list of the email addresses which has
+		;; been expired
+		for ignore-list = (org-contacts-split-property (or
+								(cdr (assoc-string org-contacts-ignore-property
+										   (caddr contact))) ""))
 		;; Build the list of the user email addresses.
-		for email-list = (org-contacts-split-property (or
-						(cdr (assoc-string org-contacts-email-property
-								   (caddr contact))) ""))
+		for email-list = (org-contacts-remove-ignored-property-values ignore-list
+									      (org-contacts-split-property (or
+													    (cdr (assoc-string org-contacts-email-property
+															       (caddr contact))) "")))
 		;; If the user has email addresses…
 		if email-list
 		;; … append a list of USER <EMAIL>.
@@ -869,15 +888,17 @@ to do our best."
 	 (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)))
+	 (ignore  (cdr (assoc-string org-contacts-ignore-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))))
 	 (head (format "BEGIN:VCARD\nVERSION:3.0\nN:%s\nFN:%s\n" n name))
+	 (ignore-list (when ignore (setq ignore-list (org-contacts-split-property ignore))))
 	 emails-list result phones-list)
     (concat head
 	    (when email (progn
-			  (setq emails-list (org-contacts-split-property email))
+			  (setq emails-list (org-contacts-remove-ignored-property-values ignore-list (org-contacts-split-property email)))
 			  (setq result "")
 			  (while emails-list
 			    (setq result (concat result  "EMAIL:" (org-contacts-strip-link (car emails-list)) "\n"))
@@ -886,7 +907,7 @@ to do our best."
 	    (when addr
 	      (format "ADR:;;%s\n" (replace-regexp-in-string "\\, ?" ";" addr)))
 	    (when tel (progn
-			(setq phones-list (org-contacts-split-property tel))
+			(setq phones-list (org-contacts-remove-ignored-property-values ignore-list (org-contacts-split-property tel)))
 			(setq result "")
 			(while phones-list
 			  (setq result (concat result  "TEL:" (org-contacts-strip-link (car phones-list)) "\n"))
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [PATCH] org-contacts.el: add expire feature
  2013-05-29 21:20 ` Daimrod
  2013-05-30  0:32   ` Feng Shu
@ 2013-05-30  0:38   ` Feng Shu
  2013-05-30 10:36     ` Daimrod
  2013-05-30 17:37   ` Karl Voit
  2 siblings, 1 reply; 23+ messages in thread
From: Feng Shu @ 2013-05-30  0:38 UTC (permalink / raw)
  To: emacs-orgmode

Daimrod <daimrod@gmail.com> writes:

>
> This is not very idiomatic elisp, I would write something more like:
> #+BEGIN_SRC emacs-lisp
>   (remove-if (lambda (el)
>                (member el expire-list)) 
>              list)
> #+END_SRC

Thanks!

Is this possible?

 test1@g  =  test1@gmail.com

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] org-contacts.el: ignore emails or phones with ignore property
  2013-05-29 12:35 [PATCH] org-contacts.el: add expire feature Feng Shu
  2013-05-29 21:20 ` Daimrod
  2013-05-29 21:30 ` [PATCH] org-contacts.el: add expire feature Daimrod
@ 2013-05-30  0:42 ` Feng Shu
  2 siblings, 0 replies; 23+ messages in thread
From: Feng Shu @ 2013-05-30  0:42 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 16 bytes --]


updated patch


[-- Attachment #2: 0001-Add-a-feature-which-can-ignore-emails-or-phones-with.patch --]
[-- Type: text/x-diff, Size: 4822 bytes --]

From b0851e4c48e4c2e67fd8aafdf04951e764e07ccf Mon Sep 17 00:00:00 2001
From: Feng Shu <tumashu@gmail.com>
Date: Wed, 29 May 2013 20:30:43 +0800
Subject: [PATCH] Add a feature, which can ignore emails or phones with
 property

* contrib/lisp/org-contacts.el (org-contacts-ignore-property): New variable.
(org-contacts-remove-ignored-property-values): New function, which
remove all ignore-list's elements from list.
(org-contacts-complete-name): When completing, ignore the
values which has been included into the ignore property.
(org-contacts-vcard-format): Don't export the values which has
been included into the ignore property.

If emails or phones is included into the ignore property, they will
not show in complete buffer. When the contact is exported to vcard,
they will be ignored too.
---
 contrib/lisp/org-contacts.el |   31 ++++++++++++++++++++++++++-----
 1 个文件被修改,插入 26 行(+),删除 5 行(-)

diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el
index 7b0b603..1be0ac9 100644
--- a/contrib/lisp/org-contacts.el
+++ b/contrib/lisp/org-contacts.el
@@ -86,6 +86,11 @@ When set to nil, all your Org files will be used."
   :type 'string
   :group 'org-contacts)
 
+(defcustom org-contacts-ignore-property "IGNORE"
+  "Name of the property,  which values will be ignored when complete or export to vcard."
+  :type 'string
+  :group 'org-contacts)
+
 
 (defcustom org-contacts-birthday-format "Birthday: %l (%Y)"
   "Format of the anniversary agenda entry.
@@ -476,6 +481,13 @@ A group FOO is composed of contacts with the tag FOO."
 		(completion-table-case-fold completion-list
 					    (not org-contacts-completion-ignore-case))))))))
 
+
+(defun org-contacts-remove-ignored-property-values (ignore-list list)
+  "Remove all ignore-list's elements from list."
+  (remove-if (lambda (el)
+	       (member el ignore-list)) 
+             list))
+
 (defun org-contacts-complete-name (start end string)
   "Complete text at START with a user name and email."
   (let* ((completion-ignore-case org-contacts-completion-ignore-case)
@@ -484,10 +496,17 @@ A group FOO is composed of contacts with the tag FOO."
 		;; The contact name is always the car of the assoc-list
 		;; returned by `org-contacts-filter'.
 		for contact-name = (car contact)
+
+		;; Build the list of the email addresses which has
+		;; been expired
+		for ignore-list = (org-contacts-split-property (or
+								(cdr (assoc-string org-contacts-ignore-property
+										   (caddr contact))) ""))
 		;; Build the list of the user email addresses.
-		for email-list = (org-contacts-split-property (or
-						(cdr (assoc-string org-contacts-email-property
-								   (caddr contact))) ""))
+		for email-list = (org-contacts-remove-ignored-property-values ignore-list
+									      (org-contacts-split-property (or
+													    (cdr (assoc-string org-contacts-email-property
+															       (caddr contact))) "")))
 		;; If the user has email addresses…
 		if email-list
 		;; … append a list of USER <EMAIL>.
@@ -869,15 +888,17 @@ to do our best."
 	 (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)))
+	 (ignore  (cdr (assoc-string org-contacts-ignore-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))))
 	 (head (format "BEGIN:VCARD\nVERSION:3.0\nN:%s\nFN:%s\n" n name))
+	 (ignore-list (when ignore (setq ignore-list (org-contacts-split-property ignore))))
 	 emails-list result phones-list)
     (concat head
 	    (when email (progn
-			  (setq emails-list (org-contacts-split-property email))
+			  (setq emails-list (org-contacts-remove-ignored-property-values ignore-list (org-contacts-split-property email)))
 			  (setq result "")
 			  (while emails-list
 			    (setq result (concat result  "EMAIL:" (org-contacts-strip-link (car emails-list)) "\n"))
@@ -886,7 +907,7 @@ to do our best."
 	    (when addr
 	      (format "ADR:;;%s\n" (replace-regexp-in-string "\\, ?" ";" addr)))
 	    (when tel (progn
-			(setq phones-list (org-contacts-split-property tel))
+			(setq phones-list (org-contacts-remove-ignored-property-values ignore-list (org-contacts-split-property tel)))
 			(setq result "")
 			(while phones-list
 			  (setq result (concat result  "TEL:" (org-contacts-strip-link (car phones-list)) "\n"))
-- 
1.7.10.4


[-- Attachment #3: Type: text/plain, Size: 6 bytes --]



-- 

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [PATCH] org-contacts.el: add expire feature
  2013-05-30  0:38   ` Feng Shu
@ 2013-05-30 10:36     ` Daimrod
  2013-05-30 10:49       ` Feng Shu
  2013-05-30 11:32       ` Feng Shu
  0 siblings, 2 replies; 23+ messages in thread
From: Daimrod @ 2013-05-30 10:36 UTC (permalink / raw)
  To: Feng Shu; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 699 bytes --]

Feng Shu <tumashu@gmail.com> writes:

> Daimrod <daimrod@gmail.com> writes:
>
>>
>> This is not very idiomatic elisp, I would write something more like:
>> #+BEGIN_SRC emacs-lisp
>>   (remove-if (lambda (el)
>>                (member el expire-list)) 
>>              list)
>> #+END_SRC
>
> Thanks!
>
> Is this possible?
>
>  test1@g  =  test1@gmail.com

Yes, you could do it like this:
#+BEGIN_SRC emacs-lisp
  (remove-if (lambda (el)
               (find-if (lambda (x)
                          (string-match-p x el))
                        expire-list))
             list)
#+END_SRC

This way you can use regular expressions in the ignore list.

-- 
Daimrod/Greg

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] org-contacts.el: add expire feature
  2013-05-30 10:36     ` Daimrod
@ 2013-05-30 10:49       ` Feng Shu
  2013-05-30 11:32       ` Feng Shu
  1 sibling, 0 replies; 23+ messages in thread
From: Feng Shu @ 2013-05-30 10:49 UTC (permalink / raw)
  To: Daimrod; +Cc: emacs-orgmode

Daimrod <daimrod@gmail.com> writes:

> Feng Shu <tumashu@gmail.com> writes:
>
>> Daimrod <daimrod@gmail.com> writes:
>>
>>>
>>> This is not very idiomatic elisp, I would write something more like:
>>> #+BEGIN_SRC emacs-lisp
>>>   (remove-if (lambda (el)
>>>                (member el expire-list)) 
>>>              list)
>>> #+END_SRC
>>
>> Thanks!
>>
>> Is this possible?
>>
>>  test1@g  =  test1@gmail.com
>
> Yes, you could do it like this:
> #+BEGIN_SRC emacs-lisp
>   (remove-if (lambda (el)
>                (find-if (lambda (x)
>                           (string-match-p x el))
>                         expire-list))
>              list)
> #+END_SRC
>
> This way you can use regular expressions in the ignore list.

It's very power,I will copy it! 
Thanks!

-- 

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] org-contacts.el: add expire feature
  2013-05-30 10:36     ` Daimrod
  2013-05-30 10:49       ` Feng Shu
@ 2013-05-30 11:32       ` Feng Shu
  2013-05-30 23:59         ` Daimrod
  1 sibling, 1 reply; 23+ messages in thread
From: Feng Shu @ 2013-05-30 11:32 UTC (permalink / raw)
  To: Daimrod; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 833 bytes --]

Daimrod <daimrod@gmail.com> writes:

> Feng Shu <tumashu@gmail.com> writes:
>
>> Daimrod <daimrod@gmail.com> writes:
>>
>>>
>>> This is not very idiomatic elisp, I would write something more like:
>>> #+BEGIN_SRC emacs-lisp
>>>   (remove-if (lambda (el)
>>>                (member el expire-list)) 
>>>              list)
>>> #+END_SRC
>>
>> Thanks!
>>
>> Is this possible?
>>
>>  test1@g  =  test1@gmail.com
>
> Yes, you could do it like this:
> #+BEGIN_SRC emacs-lisp
>   (remove-if (lambda (el)
>                (find-if (lambda (x)
>                           (string-match-p x el))
>                         expire-list))
>              list)
> #+END_SRC
>
> This way you can use regular expressions in the ignore list.

Hi Daimrod!
This is the 3 updated patch, if possible, please include it to master.

Thanks for your help!


[-- Attachment #2: 0001-Add-a-feature-which-can-ignore-emails-or-phones-with.patch --]
[-- Type: text/x-diff, Size: 4980 bytes --]

From 362bf0657a0a270416d5e9b51aaba868ad963439 Mon Sep 17 00:00:00 2001
From: Feng Shu <tumashu@gmail.com>
Date: Wed, 29 May 2013 20:30:43 +0800
Subject: [PATCH] Add a feature, which can ignore emails or phones with
 property

* contrib/lisp/org-contacts.el (org-contacts-ignore-property): New variable.
(org-contacts-remove-ignored-property-values): New function, which
remove all ignore-list's elements from list.
(org-contacts-complete-name): When completing, ignore the
values which has been included into the ignore property.
(org-contacts-vcard-format): Don't export the values which has
been included into the ignore property.

If emails or phones is included into the ignore property, they will
not show in complete buffer. When the contact is exported to vcard,
they will be ignored too.
---
 contrib/lisp/org-contacts.el |   34 +++++++++++++++++++++++++++++-----
 1 个文件被修改,插入 29 行(+),删除 5 行(-)

diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el
index 7b0b603..2aee0f6 100644
--- a/contrib/lisp/org-contacts.el
+++ b/contrib/lisp/org-contacts.el
@@ -86,6 +86,11 @@ When set to nil, all your Org files will be used."
   :type 'string
   :group 'org-contacts)
 
+(defcustom org-contacts-ignore-property "IGNORE"
+  "Name of the property,  which values will be ignored when complete or export to vcard."
+  :type 'string
+  :group 'org-contacts)
+
 
 (defcustom org-contacts-birthday-format "Birthday: %l (%Y)"
   "Format of the anniversary agenda entry.
@@ -476,6 +481,16 @@ A group FOO is composed of contacts with the tag FOO."
 		(completion-table-case-fold completion-list
 					    (not org-contacts-completion-ignore-case))))))))
 
+
+(defun org-contacts-remove-ignored-property-values (ignore-list list)
+  "Remove all ignore-list's elements from list and you can use
+   regular expressions in the ignore list."
+    (remove-if (lambda (el)
+               (find-if (lambda (x)
+                          (string-match-p x el))
+                        ignore-list))
+             list))
+
 (defun org-contacts-complete-name (start end string)
   "Complete text at START with a user name and email."
   (let* ((completion-ignore-case org-contacts-completion-ignore-case)
@@ -484,10 +499,17 @@ A group FOO is composed of contacts with the tag FOO."
 		;; The contact name is always the car of the assoc-list
 		;; returned by `org-contacts-filter'.
 		for contact-name = (car contact)
+
+		;; Build the list of the email addresses which has
+		;; been expired
+		for ignore-list = (org-contacts-split-property (or
+								(cdr (assoc-string org-contacts-ignore-property
+										   (caddr contact))) ""))
 		;; Build the list of the user email addresses.
-		for email-list = (org-contacts-split-property (or
-						(cdr (assoc-string org-contacts-email-property
-								   (caddr contact))) ""))
+		for email-list = (org-contacts-remove-ignored-property-values ignore-list
+									      (org-contacts-split-property (or
+													    (cdr (assoc-string org-contacts-email-property
+															       (caddr contact))) "")))
 		;; If the user has email addresses…
 		if email-list
 		;; … append a list of USER <EMAIL>.
@@ -869,15 +891,17 @@ to do our best."
 	 (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)))
+	 (ignore  (cdr (assoc-string org-contacts-ignore-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))))
 	 (head (format "BEGIN:VCARD\nVERSION:3.0\nN:%s\nFN:%s\n" n name))
+	 (ignore-list (when ignore (setq ignore-list (org-contacts-split-property ignore))))
 	 emails-list result phones-list)
     (concat head
 	    (when email (progn
-			  (setq emails-list (org-contacts-split-property email))
+			  (setq emails-list (org-contacts-remove-ignored-property-values ignore-list (org-contacts-split-property email)))
 			  (setq result "")
 			  (while emails-list
 			    (setq result (concat result  "EMAIL:" (org-contacts-strip-link (car emails-list)) "\n"))
@@ -886,7 +910,7 @@ to do our best."
 	    (when addr
 	      (format "ADR:;;%s\n" (replace-regexp-in-string "\\, ?" ";" addr)))
 	    (when tel (progn
-			(setq phones-list (org-contacts-split-property tel))
+			(setq phones-list (org-contacts-remove-ignored-property-values ignore-list (org-contacts-split-property tel)))
 			(setq result "")
 			(while phones-list
 			  (setq result (concat result  "TEL:" (org-contacts-strip-link (car phones-list)) "\n"))
-- 
1.7.10.4


[-- Attachment #3: Type: text/plain, Size: 8 bytes --]





-- 

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [PATCH] org-contacts.el: add expire feature
  2013-05-29 21:20 ` Daimrod
  2013-05-30  0:32   ` Feng Shu
  2013-05-30  0:38   ` Feng Shu
@ 2013-05-30 17:37   ` Karl Voit
  2013-05-30 22:56     ` Feng Shu
  2013-05-31  0:05     ` Daimrod
  2 siblings, 2 replies; 23+ messages in thread
From: Karl Voit @ 2013-05-30 17:37 UTC (permalink / raw)
  To: emacs-orgmode

* Daimrod <daimrod@gmail.com> wrote:
>
> Feng Shu <tumashu@gmail.com> writes:
>
>> * test
>>   :PROPERTIES:
>>   :EMAIL: test1@gmail.com  test2@gmail.com  test3@gmail.com
>>   :PHONE:  123456  123457 123458
>>   :EXPIRE:  test2@gmail.com 123457
>>   :END:
>>
>> when completing or exporting to vcard,  the emails and  phones in the
>> expire property (test2@gmail.com and 123457) will be ignore

This is a very good patch, fixing an issue I also do have currently.

> Since the purpose of this property is to ignore some values when
> exporting to vcard, don't you think it would be better to name it IGNORE
> or VCARD_IGNORE? (and of course to rename all functions accordingly)

I totally agree.

At first, I could not follow Feng Shu's explanation because I
thought that some (meta-) data gets expired after a certain period
of time. But then I realized that he meant that these things expired
in the past.

From the user point of view, I also do think that renaming the
property from :EXPIRE: to :IGNORE: would be better in terms of
understanding its purpose and how it works.

(If you do tend to keep the wording, I would at least rename it to
:EXPIRED: which emphasizes the fact that these things expired in the
past.)

-- 
mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML to Org-mode:
       > get Memacs from https://github.com/novoid/Memacs <

https://github.com/novoid/extract_pdf_annotations_to_orgmode + more on github

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] org-contacts.el: add expire feature
  2013-05-30 17:37   ` Karl Voit
@ 2013-05-30 22:56     ` Feng Shu
  2013-05-31  9:38       ` Karl Voit
  2013-05-31  0:05     ` Daimrod
  1 sibling, 1 reply; 23+ messages in thread
From: Feng Shu @ 2013-05-30 22:56 UTC (permalink / raw)
  To: emacs-orgmode

Karl Voit <devnull@Karl-Voit.at> writes:

> * Daimrod <daimrod@gmail.com> wrote:
>>
>> Feng Shu <tumashu@gmail.com> writes:
>>
>>> * test
>>>   :PROPERTIES:
>>>   :EMAIL: test1@gmail.com  test2@gmail.com  test3@gmail.com
>>>   :PHONE:  123456  123457 123458
>>>   :EXPIRE:  test2@gmail.com 123457
>>>   :END:
>>>
>>> when completing or exporting to vcard,  the emails and  phones in the
>>> expire property (test2@gmail.com and 123457) will be ignore
>
> This is a very good patch, fixing an issue I also do have currently.
>
>> Since the purpose of this property is to ignore some values when
>> exporting to vcard, don't you think it would be better to name it IGNORE
>> or VCARD_IGNORE? (and of course to rename all functions accordingly)
>
> I totally agree.
>

I have changed it to "IGNORE"
> At first, I could not follow Feng Shu's explanation because I
> thought that some (meta-) data gets expired after a certain period
> of time. But then I realized that he meant that these things expired
> in the past.
>
> From the user point of view, I also do think that renaming the
> property from :EXPIRE: to :IGNORE: would be better in terms of
> understanding its purpose and how it works.
>
> (If you do tend to keep the wording, I would at least rename it to
> :EXPIRED: which emphasizes the fact that these things expired in the
> past.)

-- 

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] org-contacts.el: add expire feature
  2013-05-30 11:32       ` Feng Shu
@ 2013-05-30 23:59         ` Daimrod
  2013-05-31  4:22           ` Feng Shu
  0 siblings, 1 reply; 23+ messages in thread
From: Daimrod @ 2013-05-30 23:59 UTC (permalink / raw)
  To: Feng Shu; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 369 bytes --]

Feng Shu <tumashu@gmail.com> writes:

> Hi Daimrod!
> This is the 3 updated patch, if possible, please include it to master.

It's merged and pushed. I've also pushed another commit to fix the
formatting in some parts of the code and I've found a bug in
`org-contacts-split-property', but it should be fixed now.

> Thanks for your help!

-- 
Daimrod/Greg

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] org-contacts.el: add expire feature
  2013-05-30 17:37   ` Karl Voit
  2013-05-30 22:56     ` Feng Shu
@ 2013-05-31  0:05     ` Daimrod
  2013-05-31  9:42       ` Handling outdated contact information (was: [PATCH] org-contacts.el: add expire feature) Karl Voit
  1 sibling, 1 reply; 23+ messages in thread
From: Daimrod @ 2013-05-31  0:05 UTC (permalink / raw)
  To: Karl Voit; +Cc: news1142, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 198 bytes --]

Karl Voit <devnull@Karl-Voit.at> writes:

Hi Karl,

> This is a very good patch, fixing an issue I also do have currently.

I am curious, what was the issue?

Regards,

-- 
Daimrod/Greg

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] org-contacts.el: add expire feature
  2013-05-30 23:59         ` Daimrod
@ 2013-05-31  4:22           ` Feng Shu
  0 siblings, 0 replies; 23+ messages in thread
From: Feng Shu @ 2013-05-31  4:22 UTC (permalink / raw)
  To: Daimrod; +Cc: emacs-orgmode

Daimrod <daimrod@gmail.com> writes:

> Feng Shu <tumashu@gmail.com> writes:
>
>> Hi Daimrod!
>> This is the 3 updated patch, if possible, please include it to master.
>
> It's merged and pushed. I've also pushed another commit to fix the
> formatting in some parts of the code and I've found a bug in
> `org-contacts-split-property', but it should be fixed now.

Thanks! 

Now I want to code a function:
(defun org-contacts-add-value-to-ignore-property (value)
  "Create agenda view for contacts matching NAME."
  (interactive (list (read-string "Ignored email or phone: ")))

...

)


1. find a contact which email or phone property include the value ,If the
   result is two or more different contacts, message: "Two or more
   contacts, abort!".
  
2. add the value to the ignore property of  the result contact


Any suggestion?

Thanks!
>
>> Thanks for your help!

-- 

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] org-contacts.el: add expire feature
  2013-05-30 22:56     ` Feng Shu
@ 2013-05-31  9:38       ` Karl Voit
  0 siblings, 0 replies; 23+ messages in thread
From: Karl Voit @ 2013-05-31  9:38 UTC (permalink / raw)
  To: emacs-orgmode

* Feng Shu <tumashu@gmail.com> wrote:
>
> I have changed it to "IGNORE"

Thank you very much!

It will help your users to learn and understand this cool feature!

-- 
mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML to Org-mode:
       > get Memacs from https://github.com/novoid/Memacs <

https://github.com/novoid/extract_pdf_annotations_to_orgmode + more on github

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Handling outdated contact information (was: [PATCH] org-contacts.el: add expire feature)
  2013-05-31  0:05     ` Daimrod
@ 2013-05-31  9:42       ` Karl Voit
  2013-05-31 11:00         ` Handling outdated contact information Daimrod
  2013-05-31 13:15         ` Feng Shu
  0 siblings, 2 replies; 23+ messages in thread
From: Karl Voit @ 2013-05-31  9:42 UTC (permalink / raw)
  To: emacs-orgmode

* Daimrod <daimrod@gmail.com> wrote:
>
> Hi Karl,

Hi Daimrod!

>> This is a very good patch, fixing an issue I also do have currently.
>
> I am curious, what was the issue?

Sure: I do use contacts.org by myself and I tend to collect data
about people and never delete any. For example, previously used
phone numbers are quite handy in order to get a connection between
old text messages or phone call logs and a person.

However, I do not want to mess up current phone numbers with old
ones.

With this ignore feature, I am able to address this issue (in the
future). For now, I do not export contact information from Org-mode
to somewhere else (except: lbdb -> mutt). In the future, I plan to
add a workflow that gets contact information form Org-mode (my
central point of information) to my phone and so forth.

-- 
mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML to Org-mode:
       > get Memacs from https://github.com/novoid/Memacs <

https://github.com/novoid/extract_pdf_annotations_to_orgmode + more on github

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: Handling outdated contact information
  2013-05-31  9:42       ` Handling outdated contact information (was: [PATCH] org-contacts.el: add expire feature) Karl Voit
@ 2013-05-31 11:00         ` Daimrod
  2013-05-31 12:12           ` Feng Shu
  2013-05-31 13:15         ` Feng Shu
  1 sibling, 1 reply; 23+ messages in thread
From: Daimrod @ 2013-05-31 11:00 UTC (permalink / raw)
  To: Karl Voit; +Cc: news1142, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 977 bytes --]

Karl Voit <devnull@Karl-Voit.at> writes:

> * Daimrod <daimrod@gmail.com> wrote:
>>
>> Hi Karl,
>
> Hi Daimrod!
>
>>> This is a very good patch, fixing an issue I also do have currently.
>>
>> I am curious, what was the issue?
>
> Sure: I do use contacts.org by myself and I tend to collect data
> about people and never delete any. For example, previously used
> phone numbers are quite handy in order to get a connection between
> old text messages or phone call logs and a person.
>
> However, I do not want to mess up current phone numbers with old
> ones.
>
> With this ignore feature, I am able to address this issue (in the
> future). For now, I do not export contact information from Org-mode
> to somewhere else (except: lbdb -> mutt). In the future, I plan to
> add a workflow that gets contact information form Org-mode (my
> central point of information) to my phone and so forth.

I see, thanks for the explanation.

-- 
Daimrod/Greg

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: Handling outdated contact information
  2013-05-31 11:00         ` Handling outdated contact information Daimrod
@ 2013-05-31 12:12           ` Feng Shu
  0 siblings, 0 replies; 23+ messages in thread
From: Feng Shu @ 2013-05-31 12:12 UTC (permalink / raw)
  To: emacs-orgmode

Daimrod <daimrod@gmail.com> writes:

> Karl Voit <devnull@Karl-Voit.at> writes:
>
>> * Daimrod <daimrod@gmail.com> wrote:
>>>
>>> Hi Karl,
>>
>> Hi Daimrod!
>>
>>>> This is a very good patch, fixing an issue I also do have currently.
>>>
>>> I am curious, what was the issue?
>>
>> Sure: I do use contacts.org by myself and I tend to collect data
>> about people and never delete any. For example, previously used
>> phone numbers are quite handy in order to get a connection between
>> old text messages or phone call logs and a person.
>>
>> However, I do not want to mess up current phone numbers with old
>> ones.
>>
>> With this ignore feature, I am able to address this issue (in the
>> future). For now, I do not export contact information from Org-mode
>> to somewhere else (except: lbdb -> mutt). In the future, I plan to
>> add a workflow that gets contact information form Org-mode (my
>> central point of information) to my phone and so forth.
>

I use SSHdroid in my android phone, and use keybinding  F12 to  pull vcf
file to my phone.  In my phone, I use VcardIO update my contacts


#+begin_src emacs-lisp
(global-set-key (kbd "<f12>") '(lambda () (interactive) 
                                            (progn (org-mobile-push)
                                                          (org-contacts-export-as-vcard)
                                                          (shell-command
                                                          "scp
                                                          ~/Documents/org-mobile/*
                                                          root@192.168.1.234:/sdcard/org-mobile/")
#+end_src emacs-lisp

> I see, thanks for the explanation.

-- 

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: Handling outdated contact information
  2013-05-31  9:42       ` Handling outdated contact information (was: [PATCH] org-contacts.el: add expire feature) Karl Voit
  2013-05-31 11:00         ` Handling outdated contact information Daimrod
@ 2013-05-31 13:15         ` Feng Shu
  2013-05-31 21:41           ` Org-mode contacts to Android (was: Handling outdated contact information) Karl Voit
  1 sibling, 1 reply; 23+ messages in thread
From: Feng Shu @ 2013-05-31 13:15 UTC (permalink / raw)
  To: emacs-orgmode

Karl Voit <devnull@Karl-Voit.at> writes:

> * Daimrod <daimrod@gmail.com> wrote:
>>
>> Hi Karl,
>
> Hi Daimrod!
>
>>> This is a very good patch, fixing an issue I also do have currently.
>>
>> I am curious, what was the issue?
>
> Sure: I do use contacts.org by myself and I tend to collect data
> about people and never delete any. For example, previously used
> phone numbers are quite handy in order to get a connection between
> old text messages or phone call logs and a person.
>
> However, I do not want to mess up current phone numbers with old
> ones.
>
> With this ignore feature, I am able to address this issue (in the
> future). For now, I do not export contact information from Org-mode
> to somewhere else (except: lbdb -> mutt). In the future, I plan to
> add a workflow that gets contact information form Org-mode (my
> central point of information) to my phone and so forth.

If you use android phone, you can write a  function
"org-contacts-export-to-sqlite3" which can export org-contacts  to android contacts.db

-- 

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Org-mode contacts to Android (was: Handling outdated contact information)
  2013-05-31 13:15         ` Feng Shu
@ 2013-05-31 21:41           ` Karl Voit
  2013-05-31 22:28             ` Org-mode contacts to Android Feng Shu
  0 siblings, 1 reply; 23+ messages in thread
From: Karl Voit @ 2013-05-31 21:41 UTC (permalink / raw)
  To: emacs-orgmode

* Feng Shu <tumashu@gmail.com> wrote:
> Karl Voit <devnull@Karl-Voit.at> writes:
>
>> In the future, I plan to add a workflow that gets contact
>> information form Org-mode (my central point of information) to my
>> phone and so forth.
>
> If you use android phone, you can write a  function
> "org-contacts-export-to-sqlite3" which can export org-contacts  to
> android contacts.db

Yes, I am using Android on my phone.

No, I am not able to write a sqlite3 export in ELISP because I don't
know ELISP (yet) :-(

However, why should I? You mentioned your VCard export method in
another email here. This sounds reasonable to me. I guess, I have to
test this method on my Android as well some time.

-- 
mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML to Org-mode:
       > get Memacs from https://github.com/novoid/Memacs <

https://github.com/novoid/extract_pdf_annotations_to_orgmode + more on github

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: Org-mode contacts to Android
  2013-05-31 21:41           ` Org-mode contacts to Android (was: Handling outdated contact information) Karl Voit
@ 2013-05-31 22:28             ` Feng Shu
  2013-06-01  0:23               ` Feng Shu
  0 siblings, 1 reply; 23+ messages in thread
From: Feng Shu @ 2013-05-31 22:28 UTC (permalink / raw)
  To: emacs-orgmode

Karl Voit <devnull@Karl-Voit.at> writes:

> * Feng Shu <tumashu@gmail.com> wrote:
>> Karl Voit <devnull@Karl-Voit.at> writes:
>>
>>> In the future, I plan to add a workflow that gets contact
>>> information form Org-mode (my central point of information) to my
>>> phone and so forth.
>>
>> If you use android phone, you can write a  function
>> "org-contacts-export-to-sqlite3" which can export org-contacts  to
>> android contacts.db
>
> Yes, I am using Android on my phone.
>
> No, I am not able to write a sqlite3 export in ELISP because I don't
> know ELISP (yet) :-(
>
> However, why should I? You mentioned your VCard export method in
> another email here. This sounds reasonable to me. I guess, I have to
> test this method on my Android as well some time.

The reason:
1. speed: very slow when import vcf to android(>100 contacts)
2. automatic: If we export to db directly, we only need update db to
   android phone,and don't need to run Vcardio in the phone 


Maybe we can do like this:

org-contacts -> vcf file ---vcf to sqlite3 command--> db --> push to android!


-- 

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: Org-mode contacts to Android
  2013-05-31 22:28             ` Org-mode contacts to Android Feng Shu
@ 2013-06-01  0:23               ` Feng Shu
  0 siblings, 0 replies; 23+ messages in thread
From: Feng Shu @ 2013-06-01  0:23 UTC (permalink / raw)
  To: emacs-orgmode

Feng Shu <tumashu@gmail.com> writes:

> Karl Voit <devnull@Karl-Voit.at> writes:
>
>> * Feng Shu <tumashu@gmail.com> wrote:
>>> Karl Voit <devnull@Karl-Voit.at> writes:
>>>
>>>> In the future, I plan to add a workflow that gets contact
>>>> information form Org-mode (my central point of information) to my
>>>> phone and so forth.
>>>
>>> If you use android phone, you can write a  function
>>> "org-contacts-export-to-sqlite3" which can export org-contacts  to
>>> android contacts.db
>>
>> Yes, I am using Android on my phone.
>>
>> No, I am not able to write a sqlite3 export in ELISP because I don't
>> know ELISP (yet) :-(
>>
>> However, why should I? You mentioned your VCard export method in
>> another email here. This sounds reasonable to me. I guess, I have to
>> test this method on my Android as well some time.
>
> The reason:
> 1. speed: very slow when import vcf to android(>100 contacts)
> 2. automatic: If we export to db directly, we only need update db to
>    android phone,and don't need to run Vcardio in the phone 
>
>
> Maybe we can do like this:
>
> org-contacts -> vcf file ---vcf to sqlite3 command--> db --> push to android!

I'm very interested in integrating org and android phone effectively, 
so I want to share the solutions with others who are using android phone and 
org-mode!

I changed my setting again for unstable WIFI connection!

Integrating android phone with org  has many details to resolve:
1. speed(import vcf, import org file to org-mobile and so on)
2. WIFI problem!
3. Battery (I think this should be pay more attention when we use WIFI, 
   I use android app: Better Wifi on/off)
4. maximum possible automation. 

This is my new solution:

1. I use botsync, pull all my agenda.org to my phone by  sshd in computer
2. Change the keybinding "g" in the agenda buffer, 

#+begin_src emacs-lisp
(org-defkey org-agenda-mode-map "g" (lambda () (interactive)
                                      (org-agenda-redo t)
                                      (org-contacts-export-as-vcard)
                                      (org-mobile-push)))
#+end_src



-- 

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2013-06-01  0:24 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-29 12:35 [PATCH] org-contacts.el: add expire feature Feng Shu
2013-05-29 21:20 ` Daimrod
2013-05-30  0:32   ` Feng Shu
2013-05-30  0:38   ` Feng Shu
2013-05-30 10:36     ` Daimrod
2013-05-30 10:49       ` Feng Shu
2013-05-30 11:32       ` Feng Shu
2013-05-30 23:59         ` Daimrod
2013-05-31  4:22           ` Feng Shu
2013-05-30 17:37   ` Karl Voit
2013-05-30 22:56     ` Feng Shu
2013-05-31  9:38       ` Karl Voit
2013-05-31  0:05     ` Daimrod
2013-05-31  9:42       ` Handling outdated contact information (was: [PATCH] org-contacts.el: add expire feature) Karl Voit
2013-05-31 11:00         ` Handling outdated contact information Daimrod
2013-05-31 12:12           ` Feng Shu
2013-05-31 13:15         ` Feng Shu
2013-05-31 21:41           ` Org-mode contacts to Android (was: Handling outdated contact information) Karl Voit
2013-05-31 22:28             ` Org-mode contacts to Android Feng Shu
2013-06-01  0:23               ` Feng Shu
2013-05-29 21:30 ` [PATCH] org-contacts.el: add expire feature Daimrod
2013-05-29 23:15   ` Feng Shu
2013-05-30  0:42 ` [PATCH] org-contacts.el: ignore emails or phones with ignore property Feng Shu

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).