[this is a followup to my report of this bug last week, with some more insight]
I have a few records with multiple net addresses, but each net address has a common prefix. The desired behavior is for bbdb-complete-name to complete the primary net address first, but bbdb chooses one of the net addresses randomly. E.g. say I have the record "Bob Smith" [EMAIL PROTECTED], [EMAIL PROTECTED] When I bbdb-complete-name on "bobs" the [EMAIL PROTECTED] is completed first. This seems to happen randomly, probably because the order of bbdb-hashtable is random. Attempts to minimize my .bbdb down to a small test case failed -- I can send my whole .bbdb privately if desired. However, this might be a simple fix. I notice this code in bbdb-complete-name that looks like it tries to address this problem: ;; This is to pick the primary mail address by default, unless ;; it's not a valid expansion of 'pattern' above. ;; ;; There is a small amount of non-obviousness here; if, for ;; example, I type ronan<M-TAB>, should this fill in ;; "[EMAIL PROTECTED]", or the primary email record ;; for "Ronan Waide"? Possibly yet another tuning parameter. Oop. (and (stringp completion) yeah-yeah-this-one only-one-p ... However, it is easy to tell from the code prior that yeah-yeah-this-one and only-one-p will never be true at the same time, so this code will never execute. Emacs : GNU Emacs 21.1.1 (i386-debian-linux-gnu, X toolkit, Xaw3d scroll bars) of 2001-10-25 on raven, modified by Debian Package: BBDB 2.33 current state: ============== (setq emacs-version "21.1.1" bbdb-version-date "$Date: 2001/11/19 21:37:47 $" bbdb-file-format 6 bbdb-no-duplicates-p nil bbdb-address-editing-function 'bbdb-address-edit-default bbdb-address-formatting-alist '((bbdb-address-is-continental . bbdb-format-address-continental) (nil . bbdb-format-address-default)) bbdb-addresses-label-list '("Home" "Office" "Mobile" "Other" "Forwarder" "Work") bbdb-after-change-hook '(bbdb/gnus-score-invalidate-alist) bbdb-after-read-db-hook nil bbdb-always-add-addresses nil bbdb-auto-notes-alist nil bbdb-auto-notes-ignore nil bbdb-auto-notes-ignore-all nil bbdb-auto-revert-p nil bbdb-canonical-hosts "cs\\.cmu\\.edu\\|ri\\.cmu\\.edu\\|edrc\\.cmu\\.edu\\|andrew\\.cmu\\.edu\\|mcom\\.com\\|netscape\\.com\\|cenatls\\.cena\\.dgac\\.fr\\|cenaath\\.cena\\.dgac\\.fr\\|irit\\.fr\\|enseeiht\\.fr\\|inria\\.fr\\|cs\\.uiuc\\.edu\\|xemacs\\.org" bbdb-canonicalize-net-hook 'my-bbdb-canonicalize-net-hook bbdb-canonicalize-redundant-nets-p t bbdb-case-fold-search t bbdb-change-hook '(bbdb-timestamp-hook) bbdb-check-zip-codes-p t bbdb-complete-name-allow-cycling t bbdb-complete-name-full-completion 5 bbdb-complete-name-hooks '(ding) bbdb-completion-display-record nil bbdb-completion-type nil bbdb-continental-zip-regexp "^\\s *[A-Z][A-Z]?\\s *-\\s *[0-9][0-9][0-9]" bbdb-create-hook '(bbdb-creation-date-hook) bbdb-default-area-code nil bbdb-default-country "Emacs" bbdb-default-domain nil bbdb-default-label-list '("Home" "Office" "Mobile" "Other") bbdb-define-all-aliases-field 'mail-alias bbdb-dial-local-prefix nil bbdb-dial-local-prefix-alist '(((if bbdb-default-area-code (format "(%03d)" bbdb-default-area-code) "") "") ) bbdb-dial-long-distance-prefix nil bbdb-display-layout nil bbdb-display-layout-alist '((one-line (order phones mail-alias net notes) (name-end . 24) (toggle . t)) (multi-line (indention . 14) (toggle . t)) (pop-up-multi-line (indention . 14))) bbdb-dwim-net-address-allow-redundancy t bbdb-electric-p nil bbdb-elided-display nil bbdb-expand-mail-aliases t bbdb-extract-address-component-handler 'message bbdb-extract-address-component-ignore-regexp "\\(\\(undisclosed\\|unlisted\\)[^,]*recipients\\)\\|no To-header on input" bbdb-extract-address-component-regexps '(("\"\\([^\"]*\\)\"\\s-*<\\([^>]+\\)>" (bbdb-clean-username (match-string 1 adstring) ) 2) ("\"\\([^\"]*\\)\"\\s-*<\\([^>]+\\)>" (bbdb-clean-username (match-string 1 adstring) ) 2) ("\\(\\b[^<,]*\\b\\)\\s-*<\\([^>]+\\)>" 1 2) ("<\\([^>]+\\)>" nil 2) ("\\(\\b[^<\",()]+\\b\\)\\s-*(\\([^)]+\\))" 2 1) ("\\b\\(\\([^@]+\\.[^@]+\\)@[0-9a-z._-]+\\)\\b" (bbdb-clean-username (match-string 2 adstring) ) 1) ("\\b\\(\\([0-9a-z._-+]+\\)@[0-9a-z._-]+\\)\\b" nil 1) ("\\b\\([0-9a-z._-]+\\)\\b" nil 1)) bbdb-extract-address-components-func 'bbdb-rfc822-addresses bbdb-file "~/.bbdb" bbdb-file-remote nil bbdb-file-remote-save-always t bbdb-finger-buffer-name "*finger*" bbdb-finger-host-field 'finger-host bbdb-get-addresses-headers '((authors "From" "Resent-From" "Reply-To") (recipients "Resent-To" "Resent-CC" "To" "CC" "BCC") ) bbdb-get-only-first-address-p t bbdb-gui t bbdb-hashtable-size 1021 bbdb-ignore-most-messages-alist nil bbdb-ignore-selected-messages-confirmation nil bbdb-ignore-some-messages-alist nil bbdb-info-file nil bbdb-initialize-hook nil bbdb-legal-zip-codes '("^$" "^[ \n]*[0-9][0-9]?[0-9]?[0-9]?[0-9]?[0-9]?[ \n]*$" "^[ \n]*\\([0-9][0-9][0-9][0-9][0-9]\\)[ \n]*-?[ \n]*\\([0-9][0-9][0-9][0-9]?\\)[ \n]*$" "^[ \n]*\\([A-Za-z0-9]+\\)[ \n]+\\([A-Za-z0-9]+\\)[ \n]*$" "^[ \n]*\\([A-Z]+\\)[ \n]*-?[ \n]*\\([0-9]+ ?[A-Z]*\\)[ \n]*$" "^[ \n]*\\([A-Z]+\\)[ \n]*-?[ \n]*\\([0-9]+\\)[ \n]+\\([0-9]+\\)[ \n]*$") bbdb-list-hook '(bbdb-fontify-buffer) bbdb-load-hook nil bbdb-message-caching-enabled t bbdb-message-marker-field 'mark-char bbdb-mode-hook nil bbdb-modem-device "/dev/modem" bbdb-modem-dial nil bbdb-new-nets-always-primary nil bbdb-north-american-phone-numbers-p t bbdb-notes-default-separator ", " bbdb-notes-sort-order '((notes . 0) (www . 1) (ftp . 2) (gopher . 3) (telnet . 4) (mail-alias . 5) (mail-folder . 6) (lpr . 7) (creation-date . 1000) (timestamp . 1001)) bbdb-notice-auto-save-file nil bbdb-notice-hook nil bbdb-offer-save 'always-save bbdb-phones-label-list '("Home" "Office" "Mobile" "Other" "Work" "FAX (personal)" "FAX (bank)") bbdb-pop-up-display-layout 'one-line bbdb-pop-up-elided-display nil bbdb-pop-up-target-lines 1 bbdb-quiet-about-name-mismatches 0 bbdb-readonly-p nil bbdb-refile-notes-default-merge-function 'bbdb-refile-notes-default-merge-function bbdb-refile-notes-generate-alist '((creation-date . bbdb-refile-notes-string-least) (timestamp . bbdb-refile-notes-string-most) ) bbdb-save-db-timeout nil bbdb-send-mail-style nil bbdb-silent-running nil bbdb-snarf-web-prop 'www bbdb-sound-files ["/usr/demo/SOUND/sounds/touchtone.0.au" "/usr/demo/SOUND/sounds/touchtone.1.au" "/usr/demo/SOUND/sounds/touchtone.2.au" "/usr/demo/SOUND/sounds/touchtone.3.au" "/usr/demo/SOUND/sounds/touchtone.4.au" "/usr/demo/SOUND/sounds/touchtone.5.au" "/usr/demo/SOUND/sounds/touchtone.6.au" "/usr/demo/SOUND/sounds/touchtone.7.au" "/usr/demo/SOUND/sounds/touchtone.8.au" "/usr/demo/SOUND/sounds/touchtone.9.au" "/usr/demo/SOUND/sounds/touchtone.pound.au" "/usr/demo/SOUND/sounds/touchtone.star.au"] bbdb-sound-player "/usr/demo/SOUND/play" bbdb-time-display-format "%d %b %Y" bbdb-update-records-mode 'annotating bbdb-use-alternate-names t bbdb-use-pop-up t bbdb-user-mail-names "^matt\\.armstrong@openwave\\.com\\|matt@\\([^\\.]*\\.\\)?phone\\.com\\|matt\\(+.*\\)?@lickey\\.com\\|matta@bluemug\\.com$" bbdb-write-file-hooks '(bbdb-write-file-hook-fn) bbdb/gnus-lines-and-from-length 18 bbdb/gnus-score-default nil bbdb/gnus-score-field 'gnus-score bbdb/gnus-split-crosspost-default nil bbdb/gnus-split-default-group "mail.misc" bbdb/gnus-split-myaddr-regexp "^matt$\\|^matt@\\([-a-z0-9]+\\.\\)*lickey.com$" bbdb/gnus-split-nomatch-function nil bbdb/gnus-split-private-field 'gnus-private bbdb/gnus-split-public-field 'gnus-public bbdb/gnus-summary-in-bbdb-format-letter "b" bbdb/gnus-summary-known-poster-mark "+" bbdb/gnus-summary-mark-known-posters t bbdb/gnus-summary-prefer-bbdb-data t bbdb/gnus-summary-prefer-real-names t bbdb/gnus-summary-show-bbdb-names t bbdb/gnus-summary-user-format-letter "B" bbdb/gnus-update-records-mode 'annotating bbdb/mail-auto-create-p t bbdb/news-auto-create-p nil bbdb/vm-set-auto-folder-alist-field 'vm-folder features '(cl-specs edebug reporter vc-cvs bbdb-hooks dired enriched noutline outline easy-mmode vc vc-sccs inf-ruby ruby-mode etags debug gnus-bcklg gnus-draft gnus-agent nnvirtual gnus-cus gnus-topic gnus-score score-mode flow-fill dabbrev newcomment view bbdb-gui sort smiley gnus-cite gnus-async gnus-dup gnus-ml gnus-msg nndraft nnmh gnus-cache nnfolder byte-opt bytecomp byte-compile nnml bbdb-gnus gnus-art mm-uu binhex uudecode mm-view gnus-sum gnus-group gnus-undo nnmail mail-source format-spec bbdb-snarf mail-extr bbdb-com mailabbrev sendmail nntp nnoo gnus-start message rfc822 mml easymenu mml-sec mml-smime smime comint ring dig mml1991 mml2015 gpg mm-decode mm-bodies mm-encode mailcap mail-parse rfc2045 rfc2231 rfc2047 qp ietf-drums mailheader canlock gnus-range gnus-spec gnus-int gnus-win gnus gnus-ems gnus-util time-date parse-time nnheader mail-utils mm-util mule-util mail-prsvr wid-edit flyspell ispell p4-menu protbuf generic-x typematic rsz-mini p4 bbdb-autoloads bbdb timezone ctypes tempo pp skeleton autoinsert jit-lock font-lock regexp-opt time uniquify gnuserv-compat gnuserv devices advice advice-preload cl cl-19 msb iswitchb autorevert paren pager jka-compr filladapt generic pcmpl-auto eshell-auto tooltip image tool-bar disp-table fontset ediff-hook vc-hooks lisp-float-type lisp-mode page menu-bar timer select scroll-bar mldrag mouse facemenu faces cus-face frame misc-lang vietnamese tibetan thai lao korean japanese hebrew greek romanian slovak czech european ethiopic devanagari indian cyrillic chinese case-table help overlay md5 base64 format mule env backquote custom widget x-toolkit) ) -- matt _______________________________________________ [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/bbdb-info BBDB Home Page: http://bbdb.sourceforge.net/