X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=utils%2Fbbdb-wl.el;h=a054e555279adcbf01f8d048a14420cff1770d40;hb=3292cda093d45703dd7adcbf612000796397855d;hp=e225495ebef43ea466acf7abace2c362195bc58f;hpb=4721180044edbcb5f9d6816e56e6800f3a434206;p=elisp%2Fwanderlust.git diff --git a/utils/bbdb-wl.el b/utils/bbdb-wl.el index e225495..a054e55 100644 --- a/utils/bbdb-wl.el +++ b/utils/bbdb-wl.el @@ -17,6 +17,7 @@ ;; bbdb setup. (eval-when-compile + (require 'static) (require 'mime-setup) (require 'elmo-vars) (require 'elmo-util) @@ -38,8 +39,10 @@ "Way to canonicalize full name.") (defun bbdb-wl-canonicalize-spaces-and-dots (string) - (while (string-match " +\\|[\f\t\n\r\v]+\\|\\." 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 @@ -177,15 +180,15 @@ For BBDB 2.33 or earlier." (std11-unfold-string header))) (while (and (setq structure (car structures)) (eq (car structure) 'mailbox)) - (setq fn (funcall bbdb-wl-canonicalize-full-name-function - (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)) @@ -222,15 +225,15 @@ For BBDB 2.34 or later." (std11-unfold-string header-content))) (while (and (setq structure (car structures)) (eq (car structure) 'mailbox)) - (setq fn (funcall bbdb-wl-canonicalize-full-name-function - (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)) @@ -301,7 +304,7 @@ the user confirms the creation." (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 @@ -476,7 +479,7 @@ displaying the record corresponding to the sender of the current message." (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)))))