mu4e: allow mu4e-compose-complete-ignore-address-regexp nil

Though it shouldn't, some users have
mu4e-compose-complete-ignore-address-regexp at nil, which gives errors
with the new contacts code. Be a bit more tolerant.
This commit is contained in:
djcb
2016-02-17 19:50:13 +02:00
parent bdaa9c1aec
commit 76dd849d06

View File

@ -650,13 +650,14 @@ or (rfc822-string . CONTACT) otherwise."
(setq contact (funcall mu4e-contact-rewrite-function contact))) (setq contact (funcall mu4e-contact-rewrite-function contact)))
(when contact (when contact
(let ((name (plist-get contact :name)) (let ((name (plist-get contact :name))
(mail (plist-get contact :mail))) (mail (plist-get contact :mail))
(unless (and mail (ignore-rx (or mu4e-compose-complete-ignore-address-regexp "")))
(string-match mu4e-compose-complete-ignore-address-regexp mail)) (unless (and mail (not (string-match ignore-rx mail)))
(cons (cons
(if name (format "%s <%s>" (mu4e~rfc822-quoteit name) mail) mail) (if name (format "%s <%s>" (mu4e~rfc822-quoteit name) mail) mail)
contact))))) contact)))))
(defun mu4e~sort-contacts (contacts) (defun mu4e~sort-contacts (contacts)
"Destructively sort contacts (only for cycling) in order of "Destructively sort contacts (only for cycling) in order of
'mostly likely contact'.t See the code for the detail" 'mostly likely contact'.t See the code for the detail"