* wl-draft.el (wl-draft-forward-make-subject): Extracted from
authoryoichi <yoichi>
Sun, 6 Jun 2004 12:37:34 +0000 (12:37 +0000)
committeryoichi <yoichi>
Sun, 6 Jun 2004 12:37:34 +0000 (12:37 +0000)
`wl-draft-forward'.
(wl-draft-reply-make-subject): Ditto from `wl-draft-reply'.

wl/ChangeLog
wl/wl-draft.el

index adace6f..35b7280 100644 (file)
@@ -1,3 +1,9 @@
+2004-06-06  Yoichi NAKAYAMA  <yoichi@geiin.org>
+
+       * 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  <yoichi@geiin.org>
 
        * wl-action.el (wl-summary-target-mark-set-action): Stop if
index 9b245e0..f22b691 100644 (file)
@@ -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"))