From: yoichi Date: Sun, 6 Jun 2004 13:00:57 +0000 (+0000) Subject: * wl-vars.el (wl-reply-subject-prefix): The value can be function. X-Git-Tag: wl-2_11_30~17 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b46b46c162f818628573d74c2821a2c14f01c39;p=elisp%2Fwanderlust.git * wl-vars.el (wl-reply-subject-prefix): The value can be function. (wl-forward-subject-prefix): Ditto. * wl-draft.el (wl-draft-forward-make-subject): Change accordingly. (wl-draft-reply-make-subject): Ditto. --- diff --git a/wl/ChangeLog b/wl/ChangeLog index 35b7280..f0820dc 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,5 +1,10 @@ 2004-06-06 Yoichi NAKAYAMA + * wl-vars.el (wl-reply-subject-prefix): The value can be function. + (wl-forward-subject-prefix): Ditto. + * wl-draft.el (wl-draft-forward-make-subject): Change accordingly. + (wl-draft-reply-make-subject): Ditto. + * 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/wl-draft.el b/wl/wl-draft.el index f22b691..ce24987 100644 --- a/wl/wl-draft.el +++ b/wl/wl-draft.el @@ -247,26 +247,33 @@ e.g. (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)) + (cond ((functionp wl-forward-subject-prefix) + (concat (funcall wl-forward-subject-prefix) + original-subject)) + ((stringp wl-forward-subject-prefix) + (concat wl-forward-subject-prefix + (wl-draft-strip-subject-regexp + (or original-subject "") + wl-subject-forward-prefix-regexp))) + (t 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)) + (cond ((functionp wl-reply-subject-prefix) + (concat (funcall wl-reply-subject-prefix) + original-subject)) + ((stringp wl-reply-subject-prefix) + (concat wl-reply-subject-prefix + (wl-draft-strip-subject-regexp + (or original-subject "") + wl-subject-re-prefix-regexp))) + (t original-subject))) (defun wl-draft-forward (original-subject summary-buf) - (let (references parent-folder) + (let (references parent-folder subject) (with-current-buffer summary-buf (setq parent-folder (wl-summary-buffer-folder-name))) + (setq subject (wl-draft-forward-make-subject original-subject)) (with-current-buffer (wl-message-get-original-buffer) (setq references (nconc (std11-field-bodies '("References" "In-Reply-To")) @@ -281,8 +288,7 @@ e.g. (get-buffer-window summary-buf) (select-window (get-buffer-window summary-buf))) (wl-draft (list (cons 'To "") - (cons 'Subject - (wl-draft-forward-make-subject original-subject)) + (cons 'Subject subject) (cons 'References references)) nil nil nil nil parent-folder)) (goto-char (point-max)) @@ -357,7 +363,7 @@ Reply to author if WITH-ARG is non-nil." (setq r-list (cdr r-list))) (error "No match field: check your `wl-draft-reply-%s-argument-list'" (if with-arg "with" "without"))) - (setq subject (std11-field-body "Subject")) + (setq subject (wl-draft-reply-make-subject (std11-field-body "Subject"))) (setq to (wl-parse-addresses to) cc (wl-parse-addresses cc)) (with-temp-buffer ; to keep raw buffer unibyte. @@ -379,7 +385,6 @@ Reply to author if WITH-ARG is non-nil." (cons (nth 1 (std11-extract-address-components addr)) (if decoder (funcall decoder addr) addr))) cc))) - (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")) diff --git a/wl/wl-vars.el b/wl/wl-vars.el index b88e529..df6ac30 100644 --- a/wl/wl-vars.el +++ b/wl/wl-vars.el @@ -1723,14 +1723,18 @@ This variable overwhelm `wl-message-ignored-field-list' settings." :group 'wl-pref) (defcustom wl-reply-subject-prefix "Re: " - "*Prefix of the subject of the replied message." - :type 'string + "*Prefix of the subject of the replied message. +The value is string or string valued function to be evalueted in the target +message buffer." + :type '(choice string function) :group 'wl-draft :group 'wl-pref) (defcustom wl-forward-subject-prefix "Forward: " - "*Prefix of the subject of the forwarded message." - :type 'string + "*Prefix of the subject of the forwarded message. +The value is string or string valued function to be evalueted in the target +message buffer." + :type '(choice string function) :group 'wl-draft :group 'wl-pref)