org-contacts: check that completion-at-point-functions is bound

This commit is contained in:
Julien Danjou 2011-05-26 14:00:37 +02:00
parent 4f5c58197e
commit 4d5b508f0f

View file

@ -224,11 +224,6 @@ If both match values are nil, return all contacts."
(when (mail-abbrev-in-expansion-header-p)
(org-contacts-complete-name))))
(add-hook 'message-mode-hook
(lambda ()
(add-to-list 'completion-at-point-functions
'org-contacts-message-complete-function)))
(defun org-contacts-gnus-get-name-email ()
"Get name and email address from Gnus message."
(gnus-with-article-headers
@ -403,6 +398,12 @@ This adds `org-contacts-gnus-check-mail-address' and
(add-hook 'gnus-article-prepare-hook 'org-contacts-gnus-check-mail-address)
(add-hook 'gnus-article-prepare-hook 'org-contacts-gnus-store-last-mail))
(when (boundp 'completion-at-point-functions)
(add-hook 'message-mode-hook
(lambda ()
(add-to-list 'completion-at-point-functions
'org-contacts-message-complete-function))))
(defun org-contacts-wl-get-from-header-content ()
"Retrieve the content of the `From' header of an email.
Works from wl-summary-mode and mime-view-mode - that is while viewing email.