Re: [PATCH] emacs: Add more front ends for address completion

Subject: Re: [PATCH] emacs: Add more front ends for address completion

Date: Tue, 15 Mar 2022 13:37:28 +0100

To: Utkarsh Singh

Cc: Notmuch mailing list

From: Alexander Adolf


Utkarsh Singh <utkarsh190601@gmail.com> writes:

> [...]     
>>>      `post-completion': Called after a completion candidate has been inserted
>>>      into the buffer.  The second argument is the candidate.  Can be used to
>>>      modify it, e.g. to expand a snippet.
>>> [...]
>>
>> Hm, that sounds like it would functionally be similar to specifying an
>> :exit-function property in completion-extra-properties?
>
> Great!  We can definitely work with this.
> [...]

I'm glad to learn we might be heading in the same direction. AFAIR you
spoke about removing company from notmuch-address.el altogether? That
would be by impetus, too.

EUDC [1], which is part of core Emacs, has just been given the ability
to combine search results from several sources [2].

[1] https://www.gnu.org/software/emacs/manual/html_mono/eudc.html
[2]  https://github.com/emacs-mirror/emacs/commit/0470a4a939772c4bd25123b15f5eadab41f8bee5

I have written experimental code to make EUDC contribute to
completion-at-point, and to make notmuch-address contribute to EUDC
search results. This works in principle, and I get combined search
results from notmuch-address, and the macOS Contacts app in a corfu
pop-over UI in header fields of message-mode. It seems you were looking
for something similar?

With this kind of setup, the overall architecture for email address
completion could be like this:

notmuch-address  \          
           BBDB  |          
           LDAP   > --> EUDC --+
 macOS Contacts  |             |
            ...  /             V
                               |
      +----------<-------------+
      |   
      V                               /  completing-read
      |                              |   corfu          
      + --> completion-at-point --> <    company        
                                     |   ...            
                                      \

This would remove any user interface related code from
notmuch-address.el, an instead convert it into a back-end for EUDC.

Looking forward to your thoughts,

  --alexander
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: