From: kaoru Date: Sat, 7 Oct 2000 18:29:37 +0000 (+0000) Subject: * wl-vars.el (wl-draft-reply-myself-with-argument-list, X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=4cdb3950e227f2703a8ac4171b6a536648ab1065;p=elisp%2Fwanderlust.git * wl-vars.el (wl-draft-reply-myself-with-argument-list, wl-draft-reply-myself-without-argument-list, ): Add variables. * wl-draft.el (wl-draft-reply): Use it. --- diff --git a/wl/ChangeLog b/wl/ChangeLog index 096ebc7..e315a87 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,10 @@ + +2000-10-07 TAKAHASHI Kaoru + + * wl-vars.el (wl-draft-reply-myself-with-argument-list, + wl-draft-reply-myself-without-argument-list, ): Add variables. + * wl-draft.el (wl-draft-reply): Use it. + 2000-10-06 Daiki Ueno * wl-fldmgr.el (wl-fldmgr-add-completion-all-completions): Pass diff --git a/wl/wl-draft.el b/wl/wl-draft.el index 2801cbe..778c61c 100644 --- a/wl/wl-draft.el +++ b/wl/wl-draft.el @@ -275,8 +275,7 @@ the `wl-smtp-features' variable." (defun wl-draft-reply (buf no-arg summary-buf) ; (save-excursion - (let ((r-list (if no-arg wl-draft-reply-without-argument-list - wl-draft-reply-with-argument-list)) + (let (r-list (eword-lexical-analyzer '(eword-analyze-quoted-string eword-analyze-domain-literal eword-analyze-comment @@ -287,52 +286,53 @@ the `wl-smtp-features' variable." to mail-followup-to cc subject in-reply-to references newsgroups from addr-alist) (set-buffer buf) - (if (wl-address-user-mail-address-p - (setq from - (wl-address-header-extract-address (std11-field-body "From")))) - (setq to (mapconcat 'identity (elmo-multiple-field-body "To") ",") - cc (mapconcat 'identity (elmo-multiple-field-body "Cc") ",") - newsgroups (or (std11-field-body "Newsgroups") "")) - (catch 'done - (while r-list - (when (let ((condition (car (car r-list)))) - (cond ((stringp condition) - (std11-field-body condition)) - ((listp condition) - (catch 'done - (while condition - (if (not (std11-field-body (car condition))) - (throw 'done nil)) - (setq condition (cdr condition))) - t)) - ((symbolp condition) - (funcall condition)))) - (let ((r-to-list (nth 0 (cdr (car r-list)))) - (r-cc-list (nth 1 (cdr (car r-list)))) - (r-ng-list (nth 2 (cdr (car r-list))))) - (when (and (member "Followup-To" r-ng-list) - (string= (std11-field-body "Followup-To") "poster")) - (setq r-to-list (cons "From" r-to-list)) - (setq r-ng-list (delete "Followup-To" (copy-sequence r-ng-list)))) - (setq to (wl-concat-list (cons to - (elmo-multiple-fields-body-list - r-to-list)) - ",")) - (setq cc (wl-concat-list (cons cc - (elmo-multiple-fields-body-list - r-cc-list)) - ",")) - (setq newsgroups (wl-concat-list (cons newsgroups - (std11-field-bodies - r-ng-list)) - ","))) - (throw 'done nil)) - (setq r-list (cdr r-list))) - (error "No match field: check your `wl-draft-reply-without-argument-list'"))) + (setq from (wl-address-header-extract-address (std11-field-body "From"))) + (setq r-list + (if (wl-address-user-mail-address-p from) + (if no-arg wl-draft-reply-myself-without-argument-list + wl-draft-reply-myself-with-argument-list) + (if no-arg wl-draft-reply-without-argument-list + wl-draft-reply-with-argument-list))) + (catch 'done + (while r-list + (when (let ((condition (car (car r-list)))) + (cond ((stringp condition) + (std11-field-body condition)) + ((listp condition) + (catch 'done + (while condition + (if (not (std11-field-body (car condition))) + (throw 'done nil)) + (setq condition (cdr condition))) + t)) + ((symbolp condition) + (funcall condition)))) + (let ((r-to-list (nth 0 (cdr (car r-list)))) + (r-cc-list (nth 1 (cdr (car r-list)))) + (r-ng-list (nth 2 (cdr (car r-list))))) + (when (and (member "Followup-To" r-ng-list) + (string= (std11-field-body "Followup-To") "poster")) + (setq r-to-list (cons "From" r-to-list)) + (setq r-ng-list (delete "Followup-To" (copy-sequence r-ng-list)))) + (setq to (wl-concat-list (cons to + (elmo-multiple-fields-body-list + r-to-list)) + ",")) + (setq cc (wl-concat-list (cons cc + (elmo-multiple-fields-body-list + r-cc-list)) + ",")) + (setq newsgroups (wl-concat-list (cons newsgroups + (std11-field-bodies + r-ng-list)) + ","))) + (throw 'done nil)) + (setq r-list (cdr r-list))) + (error "No match field: check your `wl-draft-reply-without-argument-list'")) (setq subject (std11-field-body "Subject")) (setq to (wl-parse-addresses to) cc (wl-parse-addresses cc)) - (with-temp-buffer ; to keep raw buffer unibyte. + (with-temp-buffer ; to keep raw buffer unibyte. (elmo-set-buffer-multibyte default-enable-multibyte-characters) (setq subject (or (and subject (eword-decode-string diff --git a/wl/wl-vars.el b/wl/wl-vars.el index 4e30f65..8e3433c 100644 --- a/wl/wl-vars.el +++ b/wl/wl-vars.el @@ -534,6 +534,8 @@ Prepared candidates are 'wl-draft-send-mail-with-smtp, ("From" . (("From") nil nil))) "Alist of cons cell of ('field-name' . ('fields for To' 'fields for Cc' 'fields for Newsgroups')) +'field-name' is a string. +'fields for ***' is a list of strings. If car of each cons cell exists in original message, cdr of each cons cell is used for draft message. Default is for 'reply-to-author'." @@ -562,6 +564,42 @@ Default is for 'reply-to-all'." (repeat :tag "Fields For Newsgroups" string)))) :group 'wl-draft) +(defcustom wl-draft-reply-myself-with-argument-list + '(("Followup-To" . (("To") ("Cc") ("Followup-To"))) + ("Newsgroups" . (("To") ("Cc") ("Newsgroups"))) + ("From" . (("To") ("Cc") nil))) + "Alist of cons cell of +('field-name' . ('fields for To' 'fields for Cc' 'fields for Newsgroups')) +'field-name' is a string. +'fields for ***' is a list of strings. +If car of each cons cell exists in original message, +cdr of each cons cell is used for draft message. +Default is for 'reply-to-me'." + :type '(repeat (cons (choice (string :tag "Field Name") + (repeat (string :tag "Field Name"))) + (list (repeat :tag "Fields For To" string) + (repeat :tag "Fields For Cc" string) + (repeat :tag "Fields For Newsgroups" string)))) + :group 'wl-draft) + +(defcustom wl-draft-reply-myself-without-argument-list + '(("Followup-To" . (("To") ("Cc") ("Followup-To"))) + ("Newsgroups" . (("To") ("Cc") ("Newsgroups"))) + ("From" . (("To") ("Cc") nil))) + "Alist of cons cell of +('field-name' . ('fields for To' 'fields for Cc' 'fields for Newsgroups')) +'field-name' is a string. +'fields for ***' is a list of strings. +If car of each cons cell exists in original message, +cdr of each cons cell is used for draft message. +Default is for 'followup-to-me'." + :type '(repeat (cons (choice (string :tag "Field Name") + (repeat (string :tag "Field Name"))) + (list (repeat :tag "Fields For To" string) + (repeat :tag "Fields For Cc" string) + (repeat :tag "Fields For Newsgroups" string)))) + :group 'wl-draft) + (defcustom wl-draft-always-delete-myself nil "*Always delete myself from reciepient if non-nil." :type 'boolean