Hello, as I had announced in the "message.el email address completion refactoring" thread, attached below are two patches, adding a new EUDC backend each; the first patch for ecomplete, and the second for mailabbrev. The ecomplete backend uses ecomplete's types as attributes. Quoting from lisp/ecomplete.el: ---------------------------- Begin Quote ----------------------------- ;; ecomplete stores matches in a file that looks like this: ;; ;; ((mail ;; ("larsi@gnus.org" 38154 1516109510 "Lars Ingebrigtsen ") ;; ("kfogel@red-bean.com" 10 1516065455 "Karl Fogel ") ;; ... ;; )) ----------------------------- End Quote ------------------------------ This example shows a type of "mail". Users are free to use whatever ecomplete types they wish. EUDC will look up in those types for which a mapping to EUDC attribute names exists in the variable `eudc-ecomplete-attributes-translation-alist`. The ecomplete search function implements a substring match on the last element of each entry. The mailabbrev backend looks at name, firstname, and email attributes in the query only (this is hardcoded), since mailabbrev does not support attributes at all. mailabbrev parses the user's .mailrc file (as is used by /usr/bin/mail and /usr/bin/mailx) for 'alias' and 'source' entries. Quoting from lisp/mail/mailabbrev.el: ---------------------------- Begin Quote ----------------------------- ;; alias someone "John Doe " [...] ;; Aliases in the mailrc file may be nested. If you define aliases like ;; alias group1 fred ethel ;; alias group2 larry curly moe ;; alias everybody group1 group2 ;; Then when you type "everybody" on the To: line, it will be expanded to ;; fred, ethyl, larry, curly, moe [...] ;; This code also understands the "source" .mailrc command, for reading ;; aliases from some other file as well. ----------------------------- End Quote ------------------------------ The mailabbrev search function does exact matching on the alias names only. When a mailrc alias defines a distribution list, the EUDC result will contain a single match, whose email attribute (the one and only attribute in this case) contains a comma-separated list of RFC 5322 formatted email recipients on the list. This may not seem ideal when using the EUDC query form, but was the only way of getting mailabbrev distribution lists working with the function `eudc-expand-inline`. If several, individual results were returned for a distribution list, they would show nicely in the results view of the EUDC query form, but when calling `eudc-expand-inline` for a distribution list, the recipients of the list are shown as individual matches, and the user is prompted to select one of them. Kind of "defeats the purpose" of a distribution list. I thus decided to give precedence to `eudc-expand-inline`, and return distribution list aliases as comma-separated lists. I have also added ERT tests for both backends, and some email address formatting code in EUDC core, which I had contributed earlier. Looking forward to your thoughts, --alexander