Commit graph

167 commits

Author SHA1 Message Date
Øyvind Stegard
6f1a63da03 org-contacts: Provide ordering when using cycle completion
* contrib/lisp/org-contacts.el (org-contacts-metadata-prefix):
Provide same function for cycle ordering as is used for display ordering
in completion metadata.

When using cycle completion style for contacts, by setting
`completion-cycle-threshold' to some value, the ordering was not consistent
with order of email addresses in contact definition, nor the order
which was used for regular display completion. Fix that by also
supplying sort function for cycle completion in metadata.
2013-06-11 20:43:19 +02:00
Feng Shu
9105e22251 contrib/lisp/org-contacts.el: Add a complex org-contacts template to the file header
* contrib/lisp/org-contacts.el: Add a complex org-contacts template to
the file header, which can help users to know all the org-contacts
properties quickly.
2013-06-04 00:35:28 +02:00
Grégoire Jadi
fa4869123d contrib/lisp/org-contacts.el: Various formatting improvements and bug fixes
* contrib/lisp/org-contacts.el (org-contacts-ignore-property): Improve
formatting and spelling.
(org-contacts-complete-name): Improve formatting.
(org-contacts-vcard-format): Improve formatting and silent byte compiler.
(org-contacts-split-property): Fix a bug where `omit-nulls' were not
forced to `t' when `separators' was nil.
2013-05-31 01:54:19 +02:00
Feng Shu
e6b5811004 contrib/lisp/org-contacts.el: 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.
2013-05-31 01:17:58 +02:00
Grégoire Jadi
a3c24bc7c8 contrib/lisp/org-contacts.el (org-contacts-vcard-format): Silence byte-compiler
* contrib/lisp/org-contacts.el (org-contacts-vcard-format): Silence byte-compiler.
2013-05-09 00:37:54 +02:00
Grégoire Jadi
271ec25b43 contrib/lisp/org-contacts.el: Permit to unload properly `org-contacts'
* contrib/lisp/org-contacts.el (org-contacts-setup-completion-at-point):
Setup `completion-at-point-functions' in a dedicated function so it's
easier to add and to remove it from `message-mode-hook'.
(org-contacts-unload-hook): This function removes all hooks added while
loading `org-contacts' in order to respect Emacs coding conventions.
2013-05-09 00:37:53 +02:00
Rodney Lorrimar
43d6571612 org-contacts: Fix org-contacts-gnus-article-from-goto
* contrib/lisp/org-contacts.el (org-contacts-filter): Add a PROP-MATCH
argument.
(org-contacts-gnus-article-from-get-marker): Search for email as a
property not a tag.

`org-contacts-gnus-article-from-get-marker' seems to assume that the
contact properties exist within the contact's tags as colon-separated
KEY={VALUE} entries.  This isn't the case for me, using org-mode from
git master.

This commit adds a PROP-MATCH argument to `org-contacts-filter' so
that `org-contacts-gnus-article-from-get-marker` can filter by the
EMAIL property.
2013-05-04 18:48:28 +02:00
Rodney Lorrimar
beb76bf435 org-contacts: Use progress-reporter for cache update message
* contrib/lisp/org-contacts.el (org-contacts-db): Use
`make-progress-reporter' instead of `message' for messages. Also
change the sentence to present progressive tense.
2013-05-04 18:47:55 +02:00
Michael Strey
9bd8101c56 contrib/lisp/org-contacts: Introduce the constant `org-contacts-property-values-separators'
* contrib/lisp/org-contacts.el (org-contacts-property-values-separators):
  Definition of a new constant that will be used as default value of
  separators for `org-contacts-split-property'.

* contrib/lisp/org-contacts.el (org-contacts-vcard-format): We are now
  using the default separator in general.

* contrib/lisp/org-contacts.el (org-contacts-show-map): Line break
  corrected.

* contrib/lisp/org-contacts.el (org-contacts-split-property): Correct
  the comment describing the function.  Application of the newly
  defined constant `org-contacts-property-values-separators'.
2013-04-30 11:07:53 +02:00
Michael Strey
1b44df7267 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.
2013-04-30 11:07:00 +02:00
Michael Strey
43d2cdde45 contrib/lisp/org-contacts: Fix two typos in comments
* contrib/lisp/org-contacts.el (org-contacts-db): fix typo in the
  word `matching'.
* contrib/lisp/org-contacts.el (org-contacts-complete-group): fix typo
  in the word `found'.

TINYCHANGE
2013-04-30 11:04:39 +02:00
Feng Shu
68a0286a8f org-contacts.el, add name alias property.
* contrib/lisp/org-contacts.el (org-contacts-alias-property): add new
  varible
  (org-contacts-matcher): add org-contacts-alias-property to this list

Name alias is a very useful feature, especially for CJK users.
2013-04-10 15:17:54 +02:00
Feng Shu
4108493c9d org-contacts.el , fix bugs about 'tel and 'note properties
* contrib/lisp/org-contacts.el (org-contacts-vcard-format): Fix bug by
taking the "tel" and "note" properties into account.
2013-04-07 08:07:23 +02:00
Bastien Guerry
1d70236144 org-contacts.el (org-contacts-matcher): Better matcher
* contrib/lisp/org-contacts.el (org-contacts-matcher): Better matcher.

Thanks to Simon Thum for suggesting this.
2013-04-06 22:58:03 +02:00
Bastien Guerry
bc11ab4130 org-contacts.el (org-contacts-export-as-vcard): Don't use non-existent function `org-install-letbind'
* contrib/lisp/org-contacts.el (org-contacts-export-as-vcard): Don't use
non-existent function `org-install-letbind'.

Thanks to Simon Thum for reporting this.
2013-04-06 22:51:17 +02:00
Feng Shu
cb941d4023 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
2013-04-05 08:40:03 +02:00
Feng Shu
5d5faa5e6b 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
2013-04-05 08:40:03 +02:00
Feng Shu
58afa03d8c 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
2013-04-05 08:40:03 +02:00
Grégoire Jadi
23af13f11a contrib/lisp/org-contacts.el: Silence byte-compiler 2013-03-11 10:20:04 +01:00
Grégoire Jadi
6723942283 contrib/lisp/org-contacts.el: Remove calls to cl functions
* contrib/lisp/org-contacts.el(org-contacts-test-completion-prefix)
(org-contacts-complete-name, org-contacts-db-need-update-p)
(org-contacts-filter): Remove calls to cl functions.
2013-03-11 10:17:31 +01:00
Bastien Guerry
b789764458 contrib/lisp/*el: Fix license information and add "This file is not part..."
Also do some aesthetic code clean-up in org-drill.el.
2013-03-10 17:57:47 +01:00
Bastien Guerry
81129c4c07 org-contacts.el: Fix or add docstrings
* org-contacts.el (org-contacts-db)
(org-contacts-try-completion-prefix)
(org-contacts-all-completions-prefix)
(org-contacts-make-collection-prefix)
(org-contacts-display-sort-function)
(org-contacts-icon-as-string, org-contacts-format-name)
(org-contacts-gnus-insinuate): Fix or add docstring.
2013-03-05 16:38:32 +01:00
Bastien Guerry
4b368d7709 Fix typo. 2013-03-05 07:55:10 +01:00
Frank Terbeck
f6d87ee7f3 contrib/lisp/org-contacts.el: Fix compiler warnings.
TINYCHANGE
2013-03-04 20:41:36 +01:00
Rüdiger Sonderfeld
fb5c9dcec9 orgcontacts.el: Fix date' being broken in org-contacts-anniversaries'.
* contrib/lisp/org-contacts.el: Add defvar for date.  Similar to org.el.

  (org-contacts-anniversaries): Setting date to nil breaks the
  function.  Bug was introduced in 680dc1f24.

Signed-off-by: Rüdiger Sonderfeld <ruediger@c-plusplus.de>
2013-03-03 17:53:15 +01:00
Grégoire Jadi
b34f505d38 contrib/lisp/org-contacts.el (org-contacts-complete-name): Prevent an error when there is no completion available
* contrib/lisp/org-contacts.el (org-contacts-complete-name): Compute the
completion-list a bit earlier to prevent an error when there is no
completion available.
2013-02-28 13:46:33 +01:00
Grégoire Jadi
abbf3a9a25 org-contacts.el: Rename a function to follow emacs-lisp coding conventions
* contrib/lisp/org-contacts.el (org-contacts-db-need-update-p):
  Replace the '?' by a '-p'.

(org-contacts-db): Use the new name.
2013-02-27 22:12:54 +01:00
Grégoire Jadi
1313bd7bb0 org-contacts.el: Let the users decide if they want to use `org-contacts' to complete mail addresses
* contrib/lisp/org-contacts.el (org-contacts-enable-completion): A
  custom boolean variable to enable the completion with
  `org-contacts'. Enabled by default.
2013-02-27 13:28:13 +01:00
Grégoire Jadi
680dc1f24d org-contacts.el: Started to silent byte-compiler
* contrib/lisp/org-contacts.el: Remove some compile-time warnings by adding the proper declarations.

(org-contacts-anniversaries): Hack around an undefined variable
because I wasn't able to understand how this function works.

(org-contacts-wl-get-from-header-content): Check whether the variable
`wl-summary-buffer-elmo-folder' is bound or not.
2013-02-27 13:28:11 +01:00
Grégoire Jadi
a9b2eef66f org-contacts.el: Check if the database need a refresh in a dedicated function
* contrib/lisp/org-contacts.el (org-contacts-db-need-update?): New
  function to determine whether we need to refresh `org-contacts-db'.

(org-contacts-db): Use `org-contacts-db-need-updated?'.
2013-02-27 13:27:00 +01:00
Bastien Guerry
e516efacb6 Merge branch 'maint'
Conflicts:
	lisp/org.el
2013-02-26 16:14:03 +01:00
Bastien Guerry
f71963d38a Merge branch 'maint'
Conflicts:
	contrib/oldexp/org-exp.el
	lisp/org.el
2013-02-26 14:36:36 +01:00
Rüdiger Sonderfeld
3f1509bfa2 org-contacts: Fix Agenda format.
* contrib/lisp/org-contacts.el: Use `org-agenda-prefix-format' to
  format entry instead of unused org-agenda-format.

Signed-off-by: Rüdiger Sonderfeld <ruediger@c-plusplus.de>
2013-02-14 21:41:25 +01:00
Grégoire Jadi
8e9ac123b1 Do not complete when it's not necessary
* contrib/lisp/org-contacts.el (org-contacts-message-complete-function):
  Remove `completion-in-region--postch' from `post-command-hook'
  because it doesn't (seem?) do anything really useful.
2013-02-14 21:23:10 +01:00
Grégoire Jadi
d630e91dee Add caching mecanism
* contrib/lisp/org-contacts.el: Add a caching mecanism around
  `org-contacts-filter'.
2013-02-14 21:21:44 +01:00
Bastien Guerry
fb87d0eac0 contrib/lisp/org-contacts.el: Delete trailing whitespaces 2013-02-13 18:28:26 +01:00
Grégoire Jadi
50d8ec9752 Improve completion-at-point' for org-contacts.el' in mail
* org-contacts.el: Improve the completion part:
- When a group is found, it now replaces the name of the group by the
  addresses of the member of the group rather than appending the
  addresses.
- One can now complete on all part of an address and not only on the
  beginning of the name.
2013-02-13 18:27:49 +01:00
Bastien Guerry
93f982e3ba Merge branch 'maint' 2013-02-13 11:38:28 +01:00
Daniel Clemente
010b2ec38a org-contacts.el (org-contacts-format-name): New function
* org-contacts.el (org-contacts-format-name): New function.
(org-contacts-format-email): Use the new function.

TINYCHANGE
2013-01-02 10:22:25 +01:00
Bastien Guerry
dcd8af90c9 Merge branch 'maint'
Conflicts:
	contrib/lisp/htmlize.el
	etc/schema/od-manifest-schema-v1.2-os.rnc
	etc/schema/od-schema-v1.2-os.rnc
	lisp/org-exp-blocks.el
2013-01-01 16:06:17 +01:00
Bastien Guerry
8bf8565c46 Update copyright years.
Happy new year!
2013-01-01 16:04:24 +01:00
Bastien Guerry
1b6cff5ac7 contrib/lisp/org-contacts.el: Fix indentation of the file 2012-12-22 19:07:10 +01:00
Bastien Guerry
7fcd20bcff contrib/lisp/org-contacts.el: Docstring fixes and small code clean up
* org-contacts.el (org-contacts)
(org-contacts-birthday-format, org-contacts-complete-name)
(org-contacts-wl-get-name-email)
(org-contacts-template-wl-name)
(org-contacts-view-send-email, org-contacts-vcard-escape)
(org-contacts-vcard-format, org-contacts-export-as-vcard)
(org-contacts-show-map): Docstring fixes and small code clean
up.
2012-12-22 19:05:28 +01:00
Bastien Guerry
c0f4677a74 contrib/lisp/org-contacts.el: Require 'org-agenda.
Thanks to Christopher Schmidt for pointing this.
2012-10-26 14:49:09 +02:00
Bastien Guerry
ad7f57a603 Fix error messages: don't use a dot at the end 2012-09-28 17:47:48 +02:00
Achim Gratz
72d2cafa36 add a missing require for gnus-util
* lisp/org-gnus.el: Add a missing require for gnus-util.

* contrib/lisp/org-contacts.el: Add a missing require for gnus-util.
2012-09-06 19:54:28 +02:00
Ilya Shlyakhter
dcd313e66d Tags/properties matcher: Fixed issues with todo-only matches
lisp/org.el (org-scan-tags): Require todo-only argument, and document
that it should be the same one set by make-org-tags-matcher.
Fix documentation to explain that todo-only is really
not-done-todo-only.

(org-make-tags-matcher): If todo part of matcher starts with /!,
matcher now always checks that the TODO keyword is present and
is a not-done state.  This matters e.g. for org-map-entries
which unlike org-scan-tags does not do its own separate todo-only
filtering.  Added docs to explain matcher dependencies.

(org-map-entries): Make sure todo-only is correctly passed from
org-make-tags-matcher to org-scan-tags.

* lisp/org-clock.el: (org-clock-get-table-data): Make sure todo-only
does not leak when it is set by make-org-tags-macher.

* lisp/org-crypt.el: (org-encrypt-entries, org-decrypt-entries): Make
sure todo-only is correctly passed from org-make-tags-matcher to
org-scan-tags.

* contrib/lisp/contacts.el: (org-contacts-filter) : Make sure todo-only
is correctly passed from org-make-tags-matcher to org-scan-tags.
2012-03-23 13:42:06 +01:00
David Maus
c297cb009f Merge branch 'maint' 2012-03-14 06:00:49 +01:00
Tassilo Horn
938ca34558 Add missing word to org-contacts y-or-n-p question
* org-contacts.el (org-contacts-check-mail-address): Add missing word
to y-or-n-p question.
2012-03-14 05:46:04 +01:00
Eric Schulte
5526110aac Merge branch 'origin-maint'
Conflicts:
	contrib/lisp/org-mac-link-grabber.el
	doc/org.texi
	lisp/org-odt.el
	testing/lisp/test-ob.el
2012-02-19 09:36:13 -07:00