Commit Graph

76 Commits

Author SHA1 Message Date
Aaron Ecay 30b0c09275 contrib: Fix error messages.
* contrib/lisp/ob-eukleides.el (org-babel-execute:eukleides):
* contrib/lisp/ob-oz.el (org-babel-execute:oz):
* contrib/lisp/ob-tcl.el (org-babel-prep-session:tcl):
(org-babel-tcl-evaluate):
* contrib/lisp/org-contacts.el (org-contacts-view-send-email):
* contrib/lisp/org-drill.el (org-drill-hide-heading-at-point):
* contrib/lisp/org-mew.el (org-mew-search):
(org-mew-capture):
* contrib/lisp/org-toc.el (org-toc-forward):
* contrib/lisp/ox-freemind.el (org-freemind--build-node-contents): Fix
formatting of error messages.
2015-01-26 02:54:17 -05:00
Grégoire Jadi 08e7795859 contrib/lisp/org-contacts.el: Allow the user to customize interactively the vcard export
* 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.
2014-07-26 13:36:46 +09:00
Grégoire Jadi 9cf3c4e971 contrib/lisp/org-contacts.el: Fix a bug when contacts don't have an email address
* contrib/lisp/org-contacts.el (org-contacts-complete-tags-props,
org-contacts-complete-group): Fix a bug when contacts don't have an
email address.
2014-07-13 19:34:27 +09:00
Grégoire Jadi a11ce0b456 contrib/lisp/org-contacts.el: Complete contacts using tags and properties
* 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
2014-07-13 19:28:49 +09:00
Grégoire Jadi 9303717691 contrib/lisp/org-contacts.el: Factorize the construction of the database
* 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.
2014-06-17 16:42:08 +09:00
Grégoire Jadi e57c4c6e32 contrib/lisp/org-contacts.el: Add a hook to allow users to plug completion functions
* 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.
2014-06-17 16:41:49 +09:00
Bastien Guerry f8e1745440 Merge branch 'maint'
Conflicts:
	contrib/lisp/org-favtable.el
2014-01-07 14:19:03 +01:00
Bastien Guerry 7d9a883b50 Update copyright years again.
Hint: copyright years are all updated in Emacs.
2014-01-07 14:18:17 +01:00
Bastien Guerry c41f5075ac Merge branch 'maint'
Conflicts:
	contrib/lisp/org-favtable.el
2014-01-05 06:36:11 +01:00
Bastien Guerry 0beda99171 Revert "Update copyright years."
This reverts commit 21105594fc.
2014-01-05 06:28:07 +01:00
Bastien Guerry 096ff7e078 Merge branch 'maint'
Conflicts:
	contrib/lisp/org-favtable.el
2014-01-04 18:58:12 +01:00
Bastien Guerry 21105594fc Update copyright years. 2014-01-04 18:56:11 +01:00
Simon Thum 5f73d93711 un-hexify TEL links in vCard export
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
2013-09-25 14:32:58 +02:00
Aaron Ecay 17b9475f7e org-contacts: use `org-' prefixed variants of cl functions
* contrib/lisp/org-contacts.el (org-contacts-remove-ignored-property-values):
Use `org-remove-if' and `org-find-if' instead of the unprefixed variants.
2013-07-27 01:21:27 -04:00
Øyvind Stegard cc74ae8b7a org-contacts: Ensure contacts cache is updated if it contains markers with no buffer
* 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.
2013-07-20 17:21:37 +02:00
Øyvind Stegard d3fb1812fa 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 e3cc1ca792 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 1399c34e2a 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 c81b905f44 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 d9d9226c92 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 c82b34adb6 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 ccfe83666b 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 40b24a82f4 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 d109e4d83c 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 7a879ecb18 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 7fe371ceb2 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 a5c088f74a 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 ef8e4b57ed 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 46cca57cb9 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 4a8f81153a 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 bf55024ce0 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 61fab323ec 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 bb6237c937 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 5fd7bb0862 contrib/lisp/org-contacts.el: Silence byte-compiler 2013-03-11 10:20:04 +01:00
Grégoire Jadi 02fd5d1c22 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 7513f16182 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 c4ba5cbdb6 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 50fc4c7630 Fix typo. 2013-03-05 07:55:10 +01:00
Frank Terbeck b3f04ec3d2 contrib/lisp/org-contacts.el: Fix compiler warnings.
TINYCHANGE
2013-03-04 20:41:36 +01:00
Rüdiger Sonderfeld b06735aa85 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 e4cebbe40.

Signed-off-by: Rüdiger Sonderfeld <ruediger@c-plusplus.de>
2013-03-03 17:53:15 +01:00
Grégoire Jadi 7d48126665 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 ce6339e292 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 aecccc10d0 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 e4cebbe40e 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 0f76e8ca42 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
Rüdiger Sonderfeld 614a80490f 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 aff4b0b2de 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 5800920c99 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 127bffa9e9 contrib/lisp/org-contacts.el: Delete trailing whitespaces 2013-02-13 18:28:26 +01:00
Grégoire Jadi ec623af862 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