bbdb-canonicalize-address uses eq, not equal, to decide when to
terminate the loop.

My hook always modifies the address string but does converge on a
canonical one.  The eq test was always failing even when the addresses
were "the same".  This seems a bit draconian for an end user hook.
The hook worked for some old version of bbdb (that maybe only ran the
hook once?).

Anyway, the attached patch changes it to use equal.  I think equal and
eq are essentially the same speed when the two objects are the same
string object, so most folks won't notice.

--- orig-bbdb.el	2002-11-05 09:37:24.000000000 -0700
+++ bbdb.el	2002-11-05 09:53:54.000000000 -0700
@@ -2984,8 +2984,7 @@
 
 (defun bbdb-canonicalize-address (net)
   ;; call the bbdb-canonicalize-net-hook repeatedly until it returns a
-  ;; value eq to the value passed in.  This implies that it can't
-  ;; destructively modify the string.
+  ;; value equal to the value passed in.
 
   ;; Hysterical Raisins: This is a function, not a hook. In order to
   ;; make this hook a hook, we'll quietly convert a single function
@@ -2998,8 +2997,8 @@
   ;; Now, do the hook run. Note, if you mess up, it's possible that
   ;; BBDB will get stuck here oscillating between various definitions
   ;; of the canonical address.
-  (while (not (eq net (setq net (run-hook-with-args
-                                 'bbdb-canonicalize-net-hook net)))))
+  (while (not (equal net (setq net (run-hook-with-args
+				    'bbdb-canonicalize-net-hook net)))))
 
   net)
 

Reply via email to