contrib/lisp/org-contacts: Allow org links in properties
commit7a879ecb18795423b7337a5560e42ff0d2fc21b9
authorMichael Strey <mstrey@strey.biz>
Fri, 26 Apr 2013 10:29:55 +0000 (26 12:29 +0200)
committerGrégoire Jadi <gregoire.jadi@gmail.com>
Tue, 30 Apr 2013 09:07:00 +0000 (30 11:07 +0200)
tree191f571c13864607266954a2ad15e3ad9135aeda
parent7fe371ceb2891f415a23b3cfcd6600da806fe788
contrib/lisp/org-contacts: Allow org links in properties

* contrib/lisp/org-contacts.el (org-contacts-split-property):
  Introduce a custom version of split-string that keeps org links
  intact.

* contrib/lisp/org-contacts.el (org-contacts-strip-link): Introduce a
  new function that removes brackets, description, link type and colon
  from an org link string returning the pure link target.

* contrib/lisp/org-contacts.el (provide 'org-contacts): Remove a
  redundant line.

* contrib/lisp/org-contacts.el (org-contacts-complete-group,
  org-contacts-complete-name, org-contacts-view-send-email,
  org-contacts-get-icon, org-contacts-vcard-format): Apply the new
  functions to the already existing functions extracting telephone
  numbers and email addresses from the properties.

Allowed separators for email addresses and phone numbers are `,', `;'
and whitespace.  `:' is not allowed anymore as separator to avoid
confusion with implicit links.

Examples of properties that are possible after those changes:

* Surname, Name
:PROPERTIES:
:EMAIL:    mailto:test2@test.de; [[mailto:name@test.de]] foo@bar.biz
:PHONE:    [[tel:+49 351 4129535]], +491766626196 [[+49 (351) 41295-35]]
:END:

Phone links of the form [[tel:+49 351 412 95-35][My phone number]] or
[[tel:+49 351 41295-35]] are expected.  `-', `/', `(', `)' and
whitespace characters are allowed in telephone numbers.
contrib/lisp/org-contacts.el