(lambda (addr)
(nth 1 (std11-extract-address-components addr)))
(wl-parse-addresses
- (mapconcat 'identity (elmo-multiple-fields-body-list (list field)) ","))))
+ (mapconcat
+ 'identity
+ (elmo-multiple-fields-body-list (list field) mail-header-separator)
+ ","))))
+
+(defun wl-addrmgr-pickup-entry-list (buffer)
+ "Return a list of address entiry from BUFFER."
+ (when buffer
+ (with-current-buffer buffer
+ (mapcar
+ (lambda (addr)
+ (let ((structure (std11-extract-address-components addr)))
+ (list (cadr structure)
+ (or (car structure) "")
+ (or (car structure) ""))))
+ (wl-parse-addresses
+ (mapconcat
+ 'identity
+ (elmo-multiple-fields-body-list '("to" "cc" "bcc")) ","))))))
+
+(defun wl-addrmgr-merge-entries (base-list append-list)
+ "Return a merged list of address entiry."
+ (dolist (entry append-list)
+ (unless (assoc (car entry) base-list)
+ (setq base-list (nconc base-list (list entry)))))
+ base-list)
;;;###autoload
(defun wl-addrmgr ()
(unless wl-addrmgr-sort-order
(setq wl-addrmgr-sort-order wl-addrmgr-default-sort-order))
(setq wl-addrmgr-draft-buffer buffer)
- (setq wl-addrmgr-list (wl-addrmgr-list))
+ (setq wl-addrmgr-list
+ (wl-addrmgr-merge-entries (wl-addrmgr-list)
+ (wl-addrmgr-pickup-entry-list buffer)))
(wl-addrmgr-draw already-list)
(setq wl-addrmgr-unknown-list already-list)
(wl-addrmgr-goto-top)))
(let ((draft-buffer wl-addrmgr-draft-buffer))
(if (and draft-buffer
(buffer-live-p draft-buffer)
- (null (get-buffer-window draft-buffer)))
+ (null (get-buffer-window draft-buffer 'visible)))
(switch-to-buffer draft-buffer)
(unless (one-window-p)
(delete-window)))
(when (or (null wl-addrmgr-draft-buffer)
(not (buffer-live-p wl-addrmgr-draft-buffer)))
(setq wl-addrmgr-draft-buffer (save-window-excursion
- (wl-draft)
- (current-buffer))))
+ (call-interactively 'wl-draft)
+ (current-buffer))))
(with-current-buffer wl-addrmgr-draft-buffer
(setq from (std11-field-body "From"))
(if from