X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=wl%2Fwl-address.el;h=259ae2b7c43b9cbf97827a4700030a427947a467;hb=4dde1c502febe1d48ff9375d4548b6428234fb4e;hp=ad5711a9c78d3e816855ed14bd33cfd5dcd5e7ab;hpb=b9b9d404a0912f6ee172f2adfe249823af297bcd;p=elisp%2Fwanderlust.git diff --git a/wl/wl-address.el b/wl/wl-address.el index ad5711a..259ae2b 100644 --- a/wl/wl-address.el +++ b/wl/wl-address.el @@ -119,6 +119,7 @@ Returns matched uniq string list." (setq type (car (car entry)) values (mapcar (function wl-ldap-alias-safe-string) (cdr (car entry))) + values (elmo-flatten values) entry (cdr entry)) (if (string-match "::?$" type) (setq type (substring type 0 (match-beginning 0)))) @@ -134,15 +135,13 @@ Returns matched uniq string list." (defun wl-ldap-alias-safe-string (str) "Modify STR for alias. Replace space/tab in STR into '_' char. -Replace '@' in STR into '/' char." +Replace '@' in STR into list of mailbox and sub-domains." (while (string-match "[^_a-zA-Z0-9+@%.!\\-/]+" str) (setq str (concat (substring str 0 (match-beginning 0)) "_" (substring str (match-end 0))))) (if (string-match "\\(@\\)[^/@]+" str) - (setq str (concat (substring str 0 (match-beginning 1)) - "/" - (substring str (match-end 1))))) + (setq str (split-string str "[@\\.]"))) str) (defun wl-ldap-register-dn-string (hash dn &optional str dn-list) @@ -158,7 +157,8 @@ Replace '@' in STR into '/' char." (if (string-match "[a-z]+=\\(.*\\)" str) (wl-ldap-alias-safe-string (wl-match-string 1 str)))) - (split-string dn ","))))) + (split-string dn "[ \t]*,[ \t]*"))))) + (setq dn-list (elmo-flatten dn-list)) ;; prepare candidate for uniq str (if str (setq str (concat str wl-ldap-alias-sep (car dn-list)) @@ -280,9 +280,11 @@ Matched address lists are append to CL." (completing-read "To: " cl) (read-string "To: ")))) +(defconst wl-address-specials-regexp "[]\"(),.:;<>@[\\]") + (defun wl-address-quote-specials (word) "Make quoted string of WORD if needed." - (if (assq 'specials (std11-lexical-analyze word)) + (if (string-match wl-address-specials-regexp word) (prin1-to-string word) word)) @@ -547,7 +549,7 @@ Refresh `wl-address-list', `wl-address-completion-list', and (forward-line)) ret)))) -(defsubst wl-address-get-petname-1 (string) +(defun wl-address-get-petname-1 (string) (let ((address (downcase (wl-address-header-extract-address string)))) (elmo-get-hash-val address wl-address-petname-hash)))