On Mon Oct 15 2012 Leo wrote: > In BBDB3 (a few months old), duplicates were allowed by default. > So if you typed a substring in a mailer that matches two duplicate > records, it gave you an opportunity to choose.
As I tried to explain, the old code was broken in various ways. Yet comments in the code suggested that by default BBDB should behave the way I implemented it. In that sense, I tried to follow the old code without considering all side effects. > Recent BBDB3 doesn't allow duplicates by default. It does > mail-completion from the first record of the duplicates. The > others are ignored. I guess I start to understand, where your problem is coming from. When BBDB loads the database, bbdb-allow-duplicates is nil, and there are multiple records with the same name, then only the first record with this name is hashed (so that it becomes available for things like completion). While the code relevant for this was broken in BBDB v2, nonetheless it contained fragments of code and comments related to this behavior advertising this as intended behavior. I think the point is: a variable like bbdb-allow-duplicates should only affect the creation of new records as well as possibly issuing a warning if the database contains duplicate records when loaded. But it should not affect the usage of the records present in the database for things like completion. Otherwise things get rather obscured. (You got fooled!) I'll change the code accordingly (unless someone tells me there is a problem I overlooked, or someone proposes a yet better scheme). > > I don't have any real-world scenarios to test here. Do you get what > > you expect to get when bbdb-allow-duplicates is t and you have > > multiple records with the same name? > > Exactly! My BBDB db has records of the same name since a few years ago. In my mail yesterday, I only thought of bbdb-complete-mail being affected by duplicate records. BBDB's MUA interface is actually more subtle. Here I can think of situations where BBDB can get confused and give strange results if, say, a message uses a name matching multiple records, but the email address of the message, does not match any of these records. - Probably, this is a yet more exotic situation than multiple records with the same name. Maybe there are other situations (possibly yet more exotic) affected by this. Roland ------------------------------------------------------------------------------ Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too! http://p.sf.net/sfu/newrelic-dev2dev _______________________________________________ bbdb-info@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bbdb-info BBDB Home Page: http://bbdb.sourceforge.net/