From: yoichi Date: Sun, 6 Jun 2004 12:37:34 +0000 (+0000) Subject: * wl-draft.el (wl-draft-forward-make-subject): Extracted from X-Git-Tag: wl-2_11_30~18 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=8244f5d455d203c22e47c4adfa5ddff19bb742b2;p=elisp%2Fwanderlust.git * wl-draft.el (wl-draft-forward-make-subject): Extracted from `wl-draft-forward'. (wl-draft-reply-make-subject): Ditto from `wl-draft-reply'. --- diff --git a/wl/ChangeLog b/wl/ChangeLog index adace6f..35b7280 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,9 @@ +2004-06-06 Yoichi NAKAYAMA + + * wl-draft.el (wl-draft-forward-make-subject): Extracted from + `wl-draft-forward'. + (wl-draft-reply-make-subject): Ditto from `wl-draft-reply'. + 2004-06-04 Yoichi NAKAYAMA * wl-action.el (wl-summary-target-mark-set-action): Stop if diff --git a/wl/wl-draft.el b/wl/wl-draft.el index 9b245e0..f22b691 100644 --- a/wl/wl-draft.el +++ b/wl/wl-draft.el @@ -239,6 +239,30 @@ e.g. (wl-address-delete-user-mail-addresses cc)) (t cc))) +(defsubst wl-draft-strip-subject-regexp (subject regexp) + "Remove REGEXP from SUBJECT string." + (if (string-match regexp subject) + (substring subject (match-end 0)) + subject)) + +(defun wl-draft-forward-make-subject (original-subject) + "Generate subject string for forwarding." + (if wl-forward-subject-prefix + (concat wl-forward-subject-prefix + (wl-draft-strip-subject-regexp + (or original-subject "") + wl-subject-forward-prefix-regexp)) + original-subject)) + +(defun wl-draft-reply-make-subject (original-subject) + "Generate subject string for replying." + (if wl-reply-subject-prefix + (concat wl-reply-subject-prefix + (wl-draft-strip-subject-regexp + (or original-subject "") + wl-subject-re-prefix-regexp)) + original-subject)) + (defun wl-draft-forward (original-subject summary-buf) (let (references parent-folder) (with-current-buffer summary-buf @@ -258,22 +282,13 @@ e.g. (select-window (get-buffer-window summary-buf))) (wl-draft (list (cons 'To "") (cons 'Subject - (concat wl-forward-subject-prefix - (wl-draft-strip-subject-regexp - original-subject - wl-subject-forward-prefix-regexp))) + (wl-draft-forward-make-subject original-subject)) (cons 'References references)) nil nil nil nil parent-folder)) (goto-char (point-max)) (wl-draft-insert-message) (mail-position-on-field "To")) -(defun wl-draft-strip-subject-regexp (subject regexp) - "Remove REGEXP from SUBJECT string." - (if (string-match regexp subject) - (substring subject (match-end 0)) - subject)) - (defun wl-draft-self-reply-p () "Return t when From address in the current message is user's self one or not." (wl-address-user-mail-address-p (or (elmo-field-body "From") ""))) @@ -364,11 +379,7 @@ Reply to author if WITH-ARG is non-nil." (cons (nth 1 (std11-extract-address-components addr)) (if decoder (funcall decoder addr) addr))) cc))) - (and wl-reply-subject-prefix - (setq subject (concat wl-reply-subject-prefix - (wl-draft-strip-subject-regexp - (or subject "") - wl-subject-re-prefix-regexp)))) + (setq subject (wl-draft-reply-make-subject subject)) (setq in-reply-to (std11-field-body "Message-Id")) (setq references (nconc (std11-field-bodies '("References" "In-Reply-To"))