some people put their non-ASCII names in the "From: " line.
when that happens, BBDB will insist on putting all possible encodings
in the AKA list (that's what you get when you use Mule instead of
UNICODE).
the appended patch fixes the offending behavior for me (emacs 21).

-- 
Sam Steingold (http://www.podval.org/~sds) running RedHat7.2 GNU/Linux
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.palestine-central.com/links.html>
There are two ways to write error-free programs; only the third one works.


cd /usr/share/emacs/site-lisp/bbdb-2.34/lisp/
diff -u -b -w -i -B /usr/share/emacs/site-lisp/bbdb-2.34/lisp/bbdb.el.old 
/usr/share/emacs/site-lisp/bbdb-2.34/lisp/bbdb.el
--- /usr/share/emacs/site-lisp/bbdb-2.34/lisp/bbdb.el.old       Tue Jan 15 18:00:58 
2002
+++ /usr/share/emacs/site-lisp/bbdb-2.34/lisp/bbdb.el   Mon Jun  3 15:56:54 2002
@@ -2980,13 +2980,19 @@
                (or gubbish "")))
       (list string ""))))

+(defun bbdb-string= (st1 st2)
+  "Check whether the two (possibly multibyte) strings
+are identical modulo encodings."
+  (string-equal (encode-coding-string st1 'mule-utf-8 t)
+                (encode-coding-string st2 'mule-utf-8 t)))
+
 (defun bbdb-check-alternate-name (possible-name record)
-  (let (aka)
-    (if (setq aka (bbdb-record-aka record))
+  (let ((aka (bbdb-record-aka record)))
+    (when aka
         (let ((down-name (downcase possible-name))
               match)
           (while aka
-            (if (equal down-name (downcase (car aka)))
+          (if (bbdb-string= down-name (downcase (car aka)))
                 (setq match (car aka)
                       aka nil)
                 (setq aka (cdr aka))))
@@ -3068,12 +3074,12 @@
       ;; a good solution.
       (let (down-name old-net)
         (if (and record name
-                 (not (equal (setq down-name (downcase name))
+                 (not (bbdb-string= (setq down-name (downcase name))
                              (and old-name (downcase old-name)))))
             (progn
               (setq old-net (bbdb-record-net record))
               (while old-net
-                (if (equal down-name (downcase (car old-net)))
+                (if (bbdb-string= down-name (downcase (car old-net)))
                     (progn
                       (setq bogon-mode t
                             old-net nil)
@@ -3111,7 +3117,7 @@
         (bbdb-debug (if (bbdb-record-deleted-p record)
                         (error "nasty nasty deleted record nasty.")))
         (if (and name
-                 (not (equal (and name (downcase name))
+                 (not (bbdb-string= (and name (downcase name))
                              (and old-name (downcase old-name))))
                  (or (null bbdb-use-alternate-names)
                      (not (bbdb-check-alternate-name name record)))
@@ -3119,13 +3125,13 @@
                        tmp)
                    (setq fname (car fullname)
                          lname (nth 1 fullname))
-                   (not (and (equal (downcase fname)
-                                    (and (setq tmp
-                                               (bbdb-record-firstname record))
+                   (not (and (bbdb-string=
+                              (downcase fname)
+                              (and (setq tmp (bbdb-record-firstname record))
                                          (downcase tmp)))
-                             (equal (downcase lname)
-                                    (and (setq tmp
-                                               (bbdb-record-lastname record))
+                             (bbdb-string=
+                              (downcase lname)
+                              (and (setq tmp (bbdb-record-lastname record))
                                          (downcase tmp)))))))

             ;; have a message-name, not the same as old name.

Diff finished at Mon Jun  3 15:57:00


_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm

_______________________________________________
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/

Reply via email to