From: yoichi Date: Fri, 1 Nov 2002 04:46:54 +0000 (+0000) Subject: * wl-address.el (wl-address-make-completion-entry): Extracted from X-Git-Tag: wl-2_11_1~71 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b0f2b27227c1a4401b3df8b8b49362b1b8fcf69;p=elisp%2Fwanderlust.git * wl-address.el (wl-address-make-completion-entry): Extracted from `wl-address-make-completion-list'. (wl-address-enable-strict-loading): New variable. (wl-address-make-completion-list): Revive petname duplication inquiry, and enable it if `wl-address-enable-strict-loading'. (Note: this should be fixed in future. Ref: [wl:10773],[wl:10455]) This change will be go into wl-2_10 too. --- diff --git a/wl/ChangeLog b/wl/ChangeLog index 1f5c1f9..2d747be 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,12 @@ +2002-11-01 Tomotaka SUWA + + * wl-address.el (wl-address-make-completion-entry): Extracted from + `wl-address-make-completion-list'. + (wl-address-enable-strict-loading): New variable. + (wl-address-make-completion-list): Revive petname duplication + inquiry, and enable it if `wl-address-enable-strict-loading'. + (Note: this should be fixed in future. Ref: [wl:10773],[wl:10455]) + 2002-10-29 Yuuichi Teranishi * wl-message.el (wl-message-get-original-buffer): Avoid diff --git a/wl/wl-address.el b/wl/wl-address.el index 2ca14ba..dfa2a72 100644 --- a/wl/wl-address.el +++ b/wl/wl-address.el @@ -46,6 +46,7 @@ (defvar wl-address-list nil) (defvar wl-address-completion-list nil) (defvar wl-address-petname-hash nil) +(defvar wl-address-enable-strict-loading t) (defvar wl-address-ldap-search-hash nil) @@ -288,28 +289,33 @@ Matched address lists are append to CL." (setq addr-tuple (car address-list)) (setq cl (cons - (cons (nth 0 addr-tuple) - (if (or (string= (nth 2 addr-tuple) "") - (string-match ".*:.*;$" (nth 0 addr-tuple))) - (nth 0 addr-tuple) - (concat - (wl-address-quote-specials - (nth 2 addr-tuple)) " <"(nth 0 addr-tuple)">"))) + (wl-address-make-completion-entry 0 addr-tuple) cl)) ;; nickname completion. - (setq cl - (cons - (cons (nth 1 addr-tuple) - (if (or (string= (nth 2 addr-tuple) "") - (string-match ".*:.*;$" (nth 0 addr-tuple))) - (nth 0 addr-tuple) - (concat - (wl-address-quote-specials - (nth 2 addr-tuple)) " <"(nth 0 addr-tuple)">"))) - cl)) + (if wl-address-enable-strict-loading + (unless (or (equal (nth 1 addr-tuple) (nth 0 addr-tuple)) + ;; already exists + (assoc (nth 1 addr-tuple) cl)) + (setq cl + (cons + (wl-address-make-completion-entry 1 addr-tuple) + cl))) + (setq cl + (cons + (wl-address-make-completion-entry 1 addr-tuple) + cl))) (setq address-list (cdr address-list))) cl)) +(defun wl-address-make-completion-entry (index addr-tuple) + (cons (nth index addr-tuple) + (if (or (string= (nth 2 addr-tuple) "") + (string-match ".*:.*;$" (nth 0 addr-tuple))) + (nth 0 addr-tuple) + (concat + (wl-address-quote-specials + (nth 2 addr-tuple)) " <"(nth 0 addr-tuple)">")))) + (defun wl-complete-field-body-or-tab () (interactive) (let ((case-fold-search t)