function.
* wl-refile.el (wl-refile-guess-by-history): Use it.
* wl-draft.el (wl-draft-delete-myself-from-cc): Ditto.
(wl-draft-make-mail-followup-to): Ditto and fix logic.
2004-05-23 Yoichi NAKAYAMA <yoichi@geiin.org>
+ * wl-address.el (wl-address-delete-user-mail-addresses): New
+ function.
+ * wl-refile.el (wl-refile-guess-by-history): Use it.
+ * wl-draft.el (wl-draft-delete-myself-from-cc): Ditto.
+ (wl-draft-make-mail-followup-to): Ditto and fix logic.
+
* wl-draft.el (wl-draft-edit-string): To judge sender address,
use wl-address-user-mail-address-p.
(forward-line))
(nreverse ret)))))
-(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)))
-
-(defsubst wl-address-get-petname (string)
- (or (wl-address-get-petname-1 string)
- string))
-
-(defsubst wl-address-user-mail-address-p (address)
- "Judge whether ADDRESS is user's or not."
- (member (downcase (wl-address-header-extract-address address))
- (or (mapcar 'downcase wl-user-mail-address-list)
- (list (downcase
- (wl-address-header-extract-address
- wl-from))))))
(defsubst wl-address-header-extract-address (str)
"Extracts a real e-mail address from STR and return it.
(wl-match-string 1 str))
(t "")))
+
+(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)))
+
+(defsubst wl-address-get-petname (string)
+ (or (wl-address-get-petname-1 string)
+ string))
+
+(defsubst wl-address-user-mail-address-p (address)
+ "Judge whether ADDRESS is user's or not."
+ (member (downcase (wl-address-header-extract-address address))
+ (or (mapcar 'downcase wl-user-mail-address-list)
+ (list (downcase
+ (wl-address-header-extract-address
+ wl-from))))))
+
+(defsubst wl-address-delete-user-mail-addresses (address-list)
+ "Delete user mail addresses from list by side effect.
+Deletion is done by using `elmo-list-delete'."
+ (let ((myself (or wl-user-mail-address-list
+ (list (wl-address-header-extract-address wl-from)))))
+ (elmo-list-delete myself address-list
+ (lambda (elem list)
+ (elmo-delete-if
+ (lambda (item) (string= (downcase elem)
+ (downcase item)))
+ list)))))
+
(defmacro wl-address-concat-token (string token)
(` (cond
((eq 'quoted-string (car (, token)))
(list (concat wl-draft-mime-bcc-field-name ":")))))))
(defun wl-draft-make-mail-followup-to (recipients)
- (if (elmo-list-member
- (or wl-user-mail-address-list
- (list (wl-address-header-extract-address wl-from)))
- recipients)
- (let ((rlist (elmo-list-delete
- (or wl-user-mail-address-list
- (list (wl-address-header-extract-address wl-from)))
- recipients
- (lambda (elem list)
- (elmo-delete-if
- (lambda (item) (string= (downcase elem)
- (downcase item)))
- list)))))
- (if (elmo-list-member rlist (mapcar 'downcase
- wl-subscribed-mailing-list))
- rlist
- (append rlist (list (wl-address-header-extract-address
- wl-from)))))
- recipients))
+ (let ((rlist (wl-address-delete-user-mail-addresses recipients)))
+ (if (elmo-list-member rlist (mapcar 'downcase
+ wl-subscribed-mailing-list))
+ rlist
+ (append rlist (list (wl-address-header-extract-address
+ wl-from))))))
(defun wl-draft-delete-myself-from-cc (to cc)
- (let ((myself (or wl-user-mail-address-list
- (list (wl-address-header-extract-address wl-from)))))
- (cond (wl-draft-always-delete-myself ; always-delete option
- (elmo-list-delete myself cc
- (lambda (elem list)
- (elmo-delete-if
- (lambda (item) (string= (downcase elem)
- (downcase item)))
- list))))
- ((elmo-list-member (append to cc) ; subscribed mailing-list
- (mapcar 'downcase wl-subscribed-mailing-list))
- (elmo-list-delete myself cc
- (lambda (elem list)
- (elmo-delete-if
- (lambda (item) (string= (downcase elem)
- (downcase item)))
- list))))
- (t cc))))
+ (cond (wl-draft-always-delete-myself ; always-delete option
+ (wl-address-delete-user-mail-addresses cc))
+ ((elmo-list-member (append to cc) ; subscribed mailing-list
+ (mapcar 'downcase wl-subscribed-mailing-list))
+ (wl-address-delete-user-mail-addresses cc))
+ (t cc)))
(defun wl-draft-forward (original-subject summary-buf)
(let (references parent-folder)
(elmo-message-entity-field entity 'to) ","
(elmo-message-entity-field entity 'cc)))))
ret-val)
- (setq tocc-list (elmo-list-delete
- (or wl-user-mail-address-list
- (list (wl-address-header-extract-address wl-from)))
- tocc-list))
+ (setq tocc-list (wl-address-delete-user-mail-addresses tocc-list))
(while tocc-list
(if (setq ret-val (cdr (assoc (car tocc-list) wl-refile-alist)))
(setq tocc-list nil)