From 9eef3177dc401b49a902fcbcbdf86dc1d63865d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Jadi?= Date: Wed, 27 Feb 2013 13:31:12 +0100 Subject: [PATCH] org-contacts.el: Add a custom variable to let others functions complete in `message-mode' * contrib/lisp/org-contacts.el (org-contacts-complete-exclusive): a custom boolean variable to let others functions complete in `message-mode'. (org-contacts-complete-group, org-contacts-complete-name): Use `org-contacts-complete-exclusive'. --- contrib/lisp/org-contacts.el | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el index 8674533..8189da2 100644 --- a/contrib/lisp/org-contacts.el +++ b/contrib/lisp/org-contacts.el @@ -138,6 +138,12 @@ This overrides `org-email-link-description-format' if set." :group 'org-contacts :type 'boolean) +(defcustom org-contacts-complete-exclusive t + "Determine whether `org-contacts-message-complete-function' +should be the only function to complete or not." + :group 'org-contacts + :type 'boolean) + ;; Decalre external functions and variables (declare-function wl-summary-message-number "ext:wl-summary" ()) (declare-function wl-address-header-extract-address "ext:wl-address") @@ -421,7 +427,10 @@ A group FOO is composed of contacts with the tag FOO." ", "))) ;; We haven't found the correct group (completion-table-case-fold completion-list - (not org-contacts-completion-ignore-case)))))))) + (not org-contacts-completion-ignore-case))) + :exclusive (if org-contacts-complete-exclusive + 'yes + 'no)))))) (defun org-contacts-complete-name (start end string) "Complete text at START with a user name and email." @@ -445,7 +454,10 @@ A group FOO is composed of contacts with the tag FOO." (org-contacts-make-collection-prefix (org-contacts-all-completions-prefix string - (remove-duplicates completion-list :test #'equalp))))))) + (remove-duplicates completion-list :test #'equalp))) + :exclusive (if org-contacts-complete-exclusive + 'yes + 'no))))) (defun org-contacts-message-complete-function (&optional start) "Function used in `completion-at-point-functions' in `message-mode'." -- 1.7.10.4