Gnus development mailing list
 help / color / mirror / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: ding@gnus.org
Subject: message-completion-alist and message-expand-name
Date: Tue, 17 May 2016 12:01:58 +0800	[thread overview]
Message-ID: <87mvnp8h8p.fsf@ericabrahamsen.net> (raw)

Hi,

I'm working on a contact management package, and trying to make it work
with message-mode header completion.

Right now, it looks like header completion works at two levels: First
the header point is in is looked up in `message-completion-alist', and
the function found in that alist is called.

In the To/Cc/Bcc/etc headers, the function that's found is
`message-expand-name'. That function looks in the variable
`message-expand-name-databases', and tries to use a completion function
from there.

`message-expand-name-databases' is a customization option, which is a
bit deceptive since `message-expand-name' only checks for the values of
'eudc and 'bbdb, and ignores anything else in there.

Right now, if I want my contacts package to provide mail completion in
message-mode, I seem to have three options:

1. Use a hook to override the binding of TAB in message-mode.
2. Use a hook to fudge `message-completion-alist' so that completion in
   To/Cc/Bcc headers calls my own completion function instead of
   `message-expand-name'.
3. Change `message-expand-name' so that it will check an alist of
   arbitrary values, and use whichever one is fboundp. Then add '(mypkg
   . mypkg-complete-name) to `message-expand-name-databases'.

Does anyone have any thoughts on this? I think option three makes the
most logical sense -- after all, I want `message-expand-name' to expand
a name, and having my own function in `message-expand-name-databases'
seems like TRT. Hardcoding to 'eudc or 'bbdb seems like an unnecessary
restriction.

If that seems to make sense, I can make a patch to message.el...

Thanks,
Eric





                 reply	other threads:[~2016-05-17  4:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=87mvnp8h8p.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --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).