From 76dd849d067213f2d62364e1d018caa460c3e127 Mon Sep 17 00:00:00 2001 From: djcb Date: Wed, 17 Feb 2016 19:50:13 +0200 Subject: [PATCH] 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. --- mu4e/mu4e-utils.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mu4e/mu4e-utils.el b/mu4e/mu4e-utils.el index e3c482a9..25105ff6 100644 --- a/mu4e/mu4e-utils.el +++ b/mu4e/mu4e-utils.el @@ -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"