Gnus development mailing list
 help / color / mirror / Atom feed
* message-completion-alist and message-expand-name
@ 2016-05-17  4:01 Eric Abrahamsen
  0 siblings, 0 replies; only message in thread
From: Eric Abrahamsen @ 2016-05-17  4:01 UTC (permalink / raw)
  To: ding

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





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-05-17  4:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-17  4:01 message-completion-alist and message-expand-name Eric Abrahamsen

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).