Re: [PATCH] implement a capf for address completion

Subject: Re: [PATCH] implement a capf for address completion

Date: Tue, 06 Aug 2024 07:30:30 -0300

To: Antoine Beaupré, notmuch@notmuchmail.org

Cc: Antoine Beaupré

From: David Bremner


Antoine Beaupré <anarcat@debian.org> writes:

>
> Now, it seems to me a simple fix is to implement a proper
> capf (`completion-at-point-function') for notmuch. And that, in turn,
> is actually pretty simple compared to the code hidden underneath
> `notmuch-address-expand-name', which not only finds completion
> candidates, but also does the whole trouble of editing the buffer.

Disclaimer: I have not looked at 'capf' before today.

Did you see the note at the end of docstring for completion-at-point
functions

    NOTE: These functions should be cheap to run since they’re sometimes
    run from ‘post-command-hook’; and they should ideally only choose
    which kind of completion table to use, and not pre-filter it based
    on the current text between START and END (e.g., they should not
    obey ‘completion-styles’).

I'm not sure how expensive #notmuch-address-options is with the
defaults, but calling it from post-command-hook does sound like it could
be problematic.

A second question I have about this change is how can we test
completion? It is quite complex already, and I'm nervous about breakage.
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: