diff --git a/org-contacts.el b/org-contacts.el index f4d9cd7..4b21d26 100644 --- a/org-contacts.el +++ b/org-contacts.el @@ -169,9 +169,10 @@ If both match values are nil, return all contacts." (when (not (fboundp 'completion-table-case-fold)) ;; That function is new in Emacs 24... - (defun completion-table-case-fold (table string pred action) - (let ((completion-ignore-case t)) - (complete-with-action action table string pred)))) + (defun completion-table-case-fold (table &optional dont-fold) + (lambda (string pred action) + (let ((completion-ignore-case (not dont-fold))) + (complete-with-action action table string pred))))) (defun org-contacts-complete-name (&optional start) "Complete text at START with a user name and email." @@ -226,9 +227,7 @@ If both match values are nil, return all contacts." ;; If the user has an email address, append USER . if email collect (org-contacts-format-email contact-name email)) ", "))))) - (list start end (if org-contacts-completion-ignore-case - (apply-partially #'completion-table-case-fold completion-list) - completion-list)))) + (list start end (completion-table-case-fold completion-list (not org-contacts-completion-ignore-case))))) (defun org-contacts-message-complete-function () "Function used in `completion-at-point-functions' in `message-mode'."