* bbdb-wl.el (bbdb-wl-canonicalize-full-name-function): New variable.
authorteranisi <teranisi>
Thu, 30 May 2002 04:50:56 +0000 (04:50 +0000)
committerteranisi <teranisi>
Thu, 30 May 2002 04:50:56 +0000 (04:50 +0000)
(bbdb-wl-canonicalize-spaces-and-dots): New function.
(bbdb-wl-get-addresses-1): Use bbdb-wl-canonicalize-full-name-function.
(bbdb-wl-get-addresses-2): Ditto.

utils/ChangeLog
utils/bbdb-wl.el

index 8b7fb9f..1e064f3 100644 (file)
@@ -1,3 +1,10 @@
+2002-05-30  Yuuichi Teranishi  <teranisi@gohome.org>
+
+       * bbdb-wl.el (bbdb-wl-canonicalize-full-name-function): New variable.
+       (bbdb-wl-canonicalize-spaces-and-dots): New function.
+       (bbdb-wl-get-addresses-1): Use bbdb-wl-canonicalize-full-name-function.
+       (bbdb-wl-get-addresses-2): Ditto.
+
 2002-05-20  Yoichi NAKAYAMA  <yoichi@eken.phys.nagoya-u.ac.jp>
 
        * im-wl.el: wl-draft-send-func -> wl-draft-send-function
index 10e73a7..e225495 100644 (file)
 (defvar bbdb-wl-folder-regexp nil)
 (defvar bbdb-wl-ignore-folder-regexp nil)
 
+(defvar bbdb-wl-canonicalize-full-name-function
+  #'bbdb-wl-canonicalize-spaces-and-dots
+  "Way to canonicalize full name.")
+
+(defun bbdb-wl-canonicalize-spaces-and-dots (string)
+  (while (string-match "  +\\|[\f\t\n\r\v]+\\|\\." string)
+    (setq string (replace-match " " nil t string)))
+  string)
+
 ;;;###autoload
 (defun bbdb-wl-setup ()
   (add-hook 'wl-message-redisplay-hook 'bbdb-wl-get-update-record)
@@ -168,7 +177,8 @@ For BBDB 2.33 or earlier."
                              (std11-unfold-string header)))
            (while (and (setq structure (car structures))
                        (eq (car structure) 'mailbox))
-             (setq fn (std11-full-name-string structure)
+             (setq fn (funcall bbdb-wl-canonicalize-full-name-function
+                               (std11-full-name-string structure))
                    fn (and fn
                            (with-temp-buffer ; to keep raw buffer unibyte.
                              (elmo-set-buffer-multibyte
@@ -212,7 +222,8 @@ For BBDB 2.34 or later."
                                (std11-unfold-string header-content)))
              (while (and (setq structure (car structures))
                          (eq (car structure) 'mailbox))
-               (setq fn (std11-full-name-string structure)
+               (setq fn (funcall bbdb-wl-canonicalize-full-name-function
+                                 (std11-full-name-string structure))
                      fn (and fn
                              (with-temp-buffer ; to keep raw buffer unibyte.
                                (elmo-set-buffer-multibyte