From d2c2602d552ce4de212e9020ba703184b3a64710 Mon Sep 17 00:00:00 2001 From: hmurata Date: Sat, 16 Apr 2005 11:32:39 +0000 Subject: [PATCH] (wl-summary-default-from): Simplify. --- wl/ChangeLog | 4 ++++ wl/wl-summary.el | 41 ++++++++++++++--------------------------- 2 files changed, 18 insertions(+), 27 deletions(-) diff --git a/wl/ChangeLog b/wl/ChangeLog index ccaa38d..eb273ed 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,7 @@ +2005-04-16 Hiroya Murata + + * wl-summary.el (wl-summary-default-from): Simplify. + 2005-04-10 Hiroya Murata * wl-action.el (wl-summary-exec-action-refile): Simplify. diff --git a/wl/wl-summary.el b/wl/wl-summary.el index af3397a..9878554 100644 --- a/wl/wl-summary.el +++ b/wl/wl-summary.el @@ -211,38 +211,25 @@ summary's folder name matches with `wl-summary-showto-folder-regexp' and (2) sender address is yours. See also variable `wl-use-petname'." - (let (retval tos ng) - (unless - (and (eq major-mode 'wl-summary-mode) + (let ((translator (if wl-use-petname + (lambda (string) + (or (funcall wl-summary-get-petname-function string) + (car (std11-extract-address-components string)) + string)) + #'identity)) + to ng) + (or (and (eq major-mode 'wl-summary-mode) (stringp wl-summary-showto-folder-regexp) (string-match wl-summary-showto-folder-regexp (wl-summary-buffer-folder-name)) (wl-address-user-mail-address-p from) (cond - ((setq tos (elmo-message-entity-field wl-message-entity 'to)) - (setq retval - (concat "To:" - (mapconcat - (lambda (to) - (if wl-use-petname - (or - (funcall - wl-summary-get-petname-function to) - (car - (std11-extract-address-components to)) - to) - to)) - tos - ",")))) - ((setq ng (elmo-message-entity-field - wl-message-entity 'newsgroups)) - (setq retval (concat "Ng:" ng))))) - (if wl-use-petname - (setq retval (or (funcall wl-summary-get-petname-function from) - (car (std11-extract-address-components from)) - from)) - (setq retval from))) - retval)) + ((setq to (elmo-message-entity-field wl-message-entity 'to)) + (concat "To:" (mapconcat translator to ","))) + ((setq ng (elmo-message-entity-field wl-message-entity + 'newsgroups)) + (concat "Ng:" ng)))) + (funcall translator from)))) (defun wl-summary-simple-from (string) (if wl-use-petname -- 1.7.10.4