The function bbdb-complete-name, bound to the key M-TAB does this for
the name before point.
Mark
>From the bbdb info file:
File: bbdb.info, Node: Mail Sending Interfaces, Prev: News Reading Interfaces, Up:
Interfaces
Mail Sending Interfaces
-----------------------
When sending mail, the keystroke `M-TAB' is bound to the function
`bbdb-complete-name'. This will take the string that you have typed
(from point back to the preceding colon, comma, or the beginning of the
line) and will complete that against the contents of the database.
What you have typed may be an initial subsequence of a person's full
name or network address; if it completes ambiguously, then what you
have typed will be replaced with the common portion of the matches.
Typing `M-TAB' again will show a list of possible completions. If it
completes unambiguously, then an address of the form
`User Name <email-address>' will be inserted. The variable
`bbdb-completion-type' controls whether completion is done on real
names, or network addresses, or both.
You must call the function `bbdb-insinuate-sendmail' to get this key
binding. *Note Installation::
You can control what "real name" is inserted with the `mail-alias'
property: if a record has a `mail-alias' property, then that is used
instead of their `name' field.
If the variable `bbdb-completion-display-record' is true (the
default) then when you successfully complete an address with `M-TAB',
the corresponding record will be appended to the `*BBDB*' buffer. The
buffer will not be displayed if it is not already visible, but the
record will be displayed there.
When sending mail, you can use the command `bbdb-yank-addresses' to
CC the current message to the people currently displayed in the
`*BBDB*' buffer. This is useful if you are in the midst of sending or
replying to a message, and you decide to add some recipients. You can
use one of the `M-x bbdb' commands to display the set of people that
you want to CC the message to, and then execute this command to add
them to the list.
If you are using my `mail-abbrevs.el' package, which uses the
word-abbrev mechanism for mail aliases, then you can store your mail
aliases in the BBDB instead of duplicating the information elsewhere.
If you want a mail alias to be defined for a person, simply add a
`mail-alias' field to their record. You may have multiple aliases for
the same person; simply separate them with commas.
If more than one person has the same mail-alias, then that alias
expands to the addresses of all of those people; in this way you can
maintain mailing lists within the BBDB.
To actually define the aliases which are stored in the BBDB, call the
function `bbdb-define-all-aliases' from your `mail-setup-hook'. This
will search the database, and call `define-mail-alias' to define each
of the resulting aliases.