Add function for filtering contacts. #383

thomasf opened this Issue Mar 1, 2014 · 1 comment


None yet
2 participants

thomasf commented Mar 1, 2014

mu4e-compose-complete-ignore-address-regexp.too limited for dealing with situations where people have changed a part of their names and maybe e-mail address while other people might have updated either name or e-mail address in their address books.
It is needed to optionally filter on name and address in combination.

I've implemented something like this, but I need some discussion before going for a pull-request.
What I do in mu4e~fill-contacts is:

  (dolist (contact contacts)
    (let* ((mycontact (processcontact contact))
           (name (plist-get mycontact :name))
           (mail (plist-get mycontact :mail)))

Where processcontact is a function which given a contact, delivers a contact back.
It's pretty efficient. I've got 4000 contacts and I don't see the difference in performance.
With processcontact I can weed out typo's, old e-mail addresses and non-company standard addresses. It's mainly a big (cond .....) expression matching regexps and (re)setting :mail and :name properties.
If anyone agrees with this approach, my next step is to make it a Customizable thing.
I'll make a pull-request then.
The identity processcontact would be something like:

 (defun processcontact (contact)
    (let ((name (plist-get contact :name))
          (mail (plist-get contact :mail))
      (list :name name :mail mail)

jhelberg pushed a commit to jhelberg/mu that referenced this issue Mar 28, 2014

@djcb djcb closed this in d2915b7 Apr 6, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment