* contrib/lisp/org-contacts.el (org-contacts-link-store): Store a link
of org-contacts in Org file.
* contrib/lisp/org-contacts.el (org-contacts-link-open): Open contact:
link in Org file.
* contrib/lisp/org-contacts.el (org-contacts-link-complete): Insert a
contact: link with completion of contacts.
* contrib/lisp/org-contacts.el (org-contacts-link-face): Set different
face for contact: link.
* lisp/org.el (org-find-if): Remove function.
(org-key):
* contrib/lisp/org-contacts.el (org-contacts-db-need-update-p):
(org-contacts-filter):
(org-contacts-test-completion-prefix):
(org-contacts-remove-ignored-property-values): Use `cl-find-if'
* lisp/org-compat.el (org-find-if): Mark function as an obsolete alias
for `cl-find-if'.
* lisp/org.el (org-show-context-detail): Change default visibility span
for agenda context.
* lisp/org-agenda.el (org-agenda-goto):
(org-agenda-todo):
(org-agenda-add-note):
(org-agenda-priority):
(org-agenda-set-tags):
(org-agenda-set-property):
(org-agenda-set-effort):
(org-agenda-toggle-archive-tag):
(org-agenda-clock-in): Special visibility is taken care of by
`org-show-context'. Do not hard-code anything else.
* contrib/lisp/org-contacts.el (org-contacts-gnus-article-from-goto):
Special visibility is taken care of by `org-show-context'. Do not
hard-code anything else.
* lisp/org.el (org-make-tags-matcher): Return a function instead of
a sexp. Refactor code.
(org--matcher-tags-todo-only): New variable. Replace `todo-only'
dynamic binding.
(org-scan-tags): Apply changes to `org-make-tags-matcher'.
(org-match-sparse-tree):
(org-map-entries): Use new variable.
* lisp/org-crypt.el (org-encrypt-entries):
(org-decrypt-entries): Use new variable.
* lisp/org-clock.el (org-clock-get-table-data): Apply changes to
`org-make-tags-matcher'.
* lisp/org-agenda.el (org-tags-view): Use new variable.
* org-contacts.el (org-contacts-db): Catch `nextfile'.
When a file in the list returned by the `org-contacts-files' function
doesn't exist and the user selects the option to attempt to remove it
from the `org-agenda-files' list, 'nextfile is thrown. Catch it and
skip processing that file instead of failing.
TINYCHANGE
* contrib/lisp/org-contacts.el (org-contacts-export-as-vcard): Wrap
`org-contacts-export-as-vcard-internal' to prompt for the parameters
when called interactively.
(org-contacts-export-as-vcard-internal): The old function
`org-contacts-export-as-vcard'.
Thanks to Esben Stien for the suggestion.
* contrib/lisp/org-contacts.el (org-contacts-complete-tags-props): New
function that allows the user to retrieve contacts based on tags and
properties.
(org-contacts-complete-functions): Add
org-contacts-complete-tags-props to the completion functions.
(org-contacts-tags-props-prefix): Prefix used to detect the
completion method wished.
Based on the idea and implementation of John Kitchin
* contrib/lisp/org-contacts.el (org-contacts-at-point): New function
used to return the contact at point.
(org-contacts-db): Factorize the construction of the database using
`org-contacts-at-point' and fix a small typo.
* contrib/lisp/org-contacts.el (org-contacts-complete-functions): A
hook that contains the list of functions used to complete contacts.
(org-contacts-message-complete-function): Use the new hook.
Suggested by John Kitchin.
This is required as a plus sign (e.g. +49 for germany) will cause
hexification in the link helper.
contrib/lisp/org-contacts.el: unhexify tel link
TINYCHANGE
* contrib/lisp/org-contacts.el (org-contacts-remove-ignored-property-values):
Use `org-remove-if' and `org-find-if' instead of the unprefixed variants.
* contrib/lisp/org-contacts.el (org-contacts-db-need-update-p):
Check if org-contacts-db cache contains markers with no buffer as well, when
determining if cache should be updated from files.
The function `org-contacts-db-need-update-p' does two checks to determine if the
contacts cache should be updated:
1. If the variable `org-contacts-last-update' is nil.
2. If modification time of any file containing contacts is more recent than
timestamp recorded in `org-contacts-last-update'.
There is another case where an update is required: when marker objects contained
in the contact cache `org-contacts-db' suddenly point to no buffer. If a buffer
containing contacts is killed, but underlying file is not modified, org-contacts
will not detect this, and cached markers that pointed to the now killed buffer
will become "dead" (e.g. have no buffer associated with them). This seems to cause
problems for instance in `org-contacts-anniversaries', which if used as diary
sexp in agenda file, will cause "Bad sexp" errors.
* 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.
* 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.
* 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.
* 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 (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.
* 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.
* 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.
* 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'.
* 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 (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
* 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.