Henrik Enberg wrote:

> There seem to be a bug in related to `bbdb-canonicalize-net-hook'.

> I think that either the name or the behavior should be changed to
> reflect what works and what doesn't work.  

This is an historical artifact.  In the deep dark past, all `hook'
variables were just setq, and `hooks' variables were lists, so the
name fit eight years ago.

However, changing it so that it takes a list of functions shouldn't be
that hard.  We could just pass the address through all of them.

Of course, we'd still need backwards compatability for all the
old-timers who can't change.

Putting my money where my mouth is, below is a lightly tested
replacement for `bbdb-canonicalize-address'.  It's not as pretty as
the original, but it's still fine.

(defun bbdb-canonicalize-address (net)
  ;; call the bbdb-canonicalize-net-hook repeatedly until it returns a
  ;; value equal to the value passed in.  This implies that it can't
  ;; destructively modify the string.
  (let ((hooks (if (listp bbdb-canonicalize-net-hook)
                   bbdb-canonicalize-net-hook
                 (list bbdb-canonicalize-net-hook))))
    (while (not (equal net (progn (mapcar '(lambda (func)
                                             (setq net (funcall func net)))
                                          hooks)
                                  net))))
    net))

-- 
Colin

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

Reply via email to