(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 (and string (string-match " +\\|[\f\t\n\r\v]+\\|\\." string))
+ (setq string (replace-match " " nil t string)))
+ (and string (string-match "^ " 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)
(setq fn (std11-full-name-string structure)
fn (and fn
(with-temp-buffer ; to keep raw buffer unibyte.
- (elmo-set-buffer-multibyte
+ (set-buffer-multibyte
default-enable-multibyte-characters)
(eword-decode-string
(decode-mime-charset-string
fn wl-mime-charset))))
+ fn (funcall bbdb-wl-canonicalize-full-name-function fn)
ad (std11-address-string structure))
;; ignore uninteresting addresses, this is kinda gross!
(when (or (not (stringp uninteresting-senders))
(std11-unfold-string header-content)))
(while (and (setq structure (car structures))
(eq (car structure) 'mailbox))
- (setq fn (std11-full-name-string structure)
+ (setq fn (std11-full-name-string structure)
fn (and fn
(with-temp-buffer ; to keep raw buffer unibyte.
- (elmo-set-buffer-multibyte
+ (set-buffer-multibyte
default-enable-multibyte-characters)
(eword-decode-string
(decode-mime-charset-string
fn wl-mime-charset))))
+ fn (funcall bbdb-wl-canonicalize-full-name-function fn)
ad (std11-address-string structure))
;; ignore uninteresting addresses, this is kinda gross!
(when (or (not (stringp uninteresting-senders))
(string-match (bbdb-user-mail-names) addr))
(setq from (or (std11-field-body "To") from)))
(with-temp-buffer ; to keep raw buffer unibyte.
- (elmo-set-buffer-multibyte
+ (set-buffer-multibyte
default-enable-multibyte-characters)
(setq from (eword-decode-string
(decode-mime-charset-string
(defun bbdb-extract-field-value (field)
(let ((value (bbdb-wl-extract-field-value-internal field)))
(with-temp-buffer ; to keep raw buffer unibyte.
- (elmo-set-buffer-multibyte
+ (set-buffer-multibyte
default-enable-multibyte-characters)
(and value
(eword-decode-string value)))))