Hi Tassilo,

attached is a patch which fixes it for me in GNU Emacs 22,
but it is not perfect as it possibly fails for names which
cannot be converted to unibyte ...

Anyway, please test it.

Bye Robert

=== modified file 'lisp/bbdb.el'
--- lisp/bbdb.el        2007-11-08 20:36:49 +0000
+++ lisp/bbdb.el        2007-11-25 22:52:47 +0000
@@ -3223,6 +3223,18 @@
       (setq old-nets (cdr old-nets)))
     redundant-addr))
 
+(defun bbdb-name-normalize (n)
+  "Normalizes a name, i.e. downcase and unibyte converion."
+  (when n 
+    (setq n (downcase n))
+    (if (functionp 'string-make-unibyte)
+       (funcall 'string-make-unibyte n)
+      n)))
+
+(defun bbdb-name= (a b)
+  "Return t if two names are equal after normalizing them."
+  (string= (bbdb-name-normalize a) (bbdb-name-normalize b)))
+
 
 (defun bbdb-annotate-message-sender (from &optional loudly create-p
                                           prompt-to-create-p)
@@ -3264,14 +3276,12 @@
       ;; corresponding to a person who has a real-name which is the same
       ;; as the network-address of someone in the db already.  This is not
       ;; a good solution.
-      (let (down-name old-net)
-        (if (and record name
-                 (not (equal (setq down-name (downcase name))
-                             (and old-name (downcase old-name)))))
+      (let (old-net)
+        (if (and record name (not (bbdb-name= name old-name)))
             (progn
               (setq old-net (bbdb-record-net record))
               (while old-net
-                (if (equal down-name (downcase (car old-net)))
+                (if (bbdb-name= name (car old-net))
                     (progn
                       (setq bogon-mode t
                             old-net nil)
@@ -3312,8 +3322,7 @@
         (bbdb-debug (if (bbdb-record-deleted-p record)
                         (error "nasty nasty deleted record nasty.")))
         (if (and name
-                 (not (equal (and name (downcase name))
-                             (and old-name (downcase old-name))))
+                 (not (bbdb-name= name old-name))
                  (or (null bbdb-use-alternate-names)
                      (not (bbdb-check-alternate-name name record)))
                  (let ((fullname (bbdb-divide-name name))

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/

Reply via email to