The patch below gives some minor improvements for bbdb-complete-mail.

- Cycle even if the record contains only one mail address, yet
  bbdb-dwim-mail gives us something different from what we have.
  For example, a message header "JOHN SMITH <[email protected]>" may be
  replaced by "John Smith <[email protected]>".

- Search correctly for RFC 822 addresses containing a full name.

The latter change revealed another unexpected surprise with BBDB:

Part of BBDB (yes, even v2) has allowed the possibility that a mail
address in a record is not just a plain "[email protected]". But the
record of, say, Johnathan Smith may also contain an RFC 822 address
such as "John Smith <[email protected]>". 

Jognathan Smith
       phone (home): (123) 456-7890
               mail: [email protected], John Smith <[email protected]>,
                     Joe Smith <[email protected]>

Obviously, this comes handy, if you want to use different mail
addresses in a record with different real names. But this feature
has been implemented rather incompletely. To make this work
properly, the hash table should always use canonical addresses such
as [email protected]. But currently BBDB puts "John Smith
<[email protected]>" in the hash table which makes it really impossible
to find [email protected] in this table. (A hash table does not allow to
search for a regexp.)

Would it be useful if the canonical mail address "[email protected]"
contained in full mail address "John Smith <[email protected]>" was
recognized properly throughout BBDB? This will require many calls of
`mail-extract-address-components' upon startup and elsewhere, too. I
do not expect this to become a serious bottleneck. But I'd have to
look through the code a bit more carefully to identify all spots
that need to be changed. Oh well...

2012-07-31  Roland Winkler  <[email protected]>
        * lisp/bbdb-com.el (bbdb-complete-mail): When a single record
        matches, analyze more carefully which mail address to use.  Cycle
        even if the record contains only one mail address, yet
        bbdb-dwim-mail gives us something different from what we have.
        Search correctly for RFC 822 addresses containing a full name.

BBDB is available at
http://savannah.nongnu.org/projects/bbdb/
To check it out, use
git clone git://git.savannah.nongnu.org/bbdb.git

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
[email protected]
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/

Reply via email to