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
1 changed files with 4 additions and 3 deletions

View File

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