Gnus development mailing list
 help / color / mirror / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: Arash Esbati <arash@gnu.org>
Cc: ding@gnus.org
Subject: Re: In-buffer completion of EBDB mail addresses with corfu
Date: Thu, 19 Oct 2023 07:29:07 -0700	[thread overview]
Message-ID: <87sf668z4c.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <m234y7ozht.fsf@macmutant.fritz.box> (Arash Esbati's message of "Thu, 19 Oct 2023 09:14:22 +0200")

Arash Esbati <arash@gnu.org> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> The other option is to set (the variable) `ebdb-complete-mail' to the
>> symbol 'capf. This will put a pre-defined list of "name <email>" strings
>> into the completion-at-point-functions hook. Then TAB should offer those
>> strings for completion, using corfu.
>>
>> The search is less powerful because it doesn't use a dynamic lookup, but
>> it should still be fine to use.
>>
>> Let me know how that works!
>
> Thanks for your response.  I added
>
>   (setq ebdb-complete-mail 'capf)
>
> to my .gnus, but I think this is not enough.  IIUC, I need:
>
>   (setq ebdb-complete-mail 'capf)
>   (require 'ebdb-message)
>
> Then this is the value of `completion-at-point-functions' in this
> buffer:
>
>   completion-at-point-functions is a variable defined in ‘minibuffer.el’.
>
>   Its value is
>   (ebdb-mail-dwim-completion-at-point-function
>    message-completion-function t)
>
> Now I hit 'C-c C-f C-t' and enter ', TAB' after your "name <email>" and
> get some space added with "No match" in the echo area.  So it doesn't
> seem to work.  Or am I missing something?

I'm not completely clear what you're doing here -- you enter a full name
and email, then a comma, then TAB? EBDB will only look back as far as
the nearest comma for completion. In this case it will send in a blank
string, which should offer all emails in your EBDB database for
completion. Have you created any records? Are there strings in
`ebdb-dwim-completion-cache'?

> And while we're at it: I suggest to autoload the functions
> `ebdb-insinuate-message', `ebdb-insinuate-mail' and
> `ebdb-message-auto-update' and let users add things like:
>
>   (add-hook 'message-mode-hook #'ebdb-insinuate-message)
>   (add-hook 'message-send-hook #'ebdb-message-auto-update)
>
>   (add-hook 'mail-setup-hook #'ebdb-insinuate-mail)
>   (add-hook 'mail-send-hook #'ebdb-message-auto-update)
>
> to their init file, depending on what they're using.

That's not a bad idea. Having them `require' libraries to activate
behavior isn't very Emacsy. That would be a pretty annoying change for
existing users, though...


  reply	other threads:[~2023-10-19 14:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-18 20:24 Arash Esbati
2023-10-19  4:14 ` Eric Abrahamsen
2023-10-19  7:14   ` Arash Esbati
2023-10-19 14:29     ` Eric Abrahamsen [this message]
2023-10-20  6:41       ` Arash Esbati
2023-10-20 15:08         ` Eric Abrahamsen
2023-10-21  9:09           ` Arash Esbati
2023-10-21 18:32             ` Eric Abrahamsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sf668z4c.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=arash@gnu.org \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).