summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrégoire Jadi <gregoire.jadi@gmail.com>2013-02-28 11:45:36 +0100
committerGrégoire Jadi <gregoire.jadi@gmail.com>2013-02-28 13:46:33 +0100
commit7d48126665fe00ccc6bae2e95dd4df29cdfb2fa1 (patch)
tree2801e134b674d9baa8426d28688aefeceaf17bf4
parent8f3a109a2177a759bda2d7550b79cef6c0183bc7 (diff)
downloadorg-mode-7d48126665fe00ccc6bae2e95dd4df29cdfb2fa1.tar.gz
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.
-rw-r--r--contrib/lisp/org-contacts.el10
1 files changed, 5 insertions, 5 deletions
diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el
index 9045087..4ffe360 100644
--- a/contrib/lisp/org-contacts.el
+++ b/contrib/lisp/org-contacts.el
@@ -439,13 +439,13 @@ A group FOO is composed of contacts with the tag FOO."
if email-list
;; … append a list of USER <EMAIL>.
nconc (loop for email in email-list
- collect (org-contacts-format-email contact-name email)))))
+ collect (org-contacts-format-email contact-name email))))
+ (completion-list (org-contacts-all-completions-prefix
+ string
+ (remove-duplicates completion-list :test #'equalp))))
(when completion-list
(list start end
- (org-contacts-make-collection-prefix
- (org-contacts-all-completions-prefix
- string
- (remove-duplicates completion-list :test #'equalp)))))))
+ (org-contacts-make-collection-prefix completion-list)))))
(defun org-contacts-message-complete-function (&optional start)
"Function used in `completion-at-point-functions' in `message-mode'."