2000-10-07 Yasushi Shoji <yashi@yashi.com>
authorteranisi <teranisi>
Mon, 30 Oct 2000 03:25:46 +0000 (03:25 +0000)
committerteranisi <teranisi>
Mon, 30 Oct 2000 03:25:46 +0000 (03:25 +0000)
* wl-vars.el (wl-subject-prefix-regexp): New variable.

* wl-draft.el (wl-draft-strip-subject-re): New function.

* wl-draft.el (wl-draft-reply): Use it.

wl/ChangeLog
wl/wl-draft.el
wl/wl-vars.el

index 6be9471..83bd518 100644 (file)
@@ -1,3 +1,11 @@
+2000-10-07  Yasushi Shoji      <yashi@yashi.com>
+
+       * wl-vars.el (wl-subject-prefix-regexp): New variable.
+
+       * wl-draft.el (wl-draft-strip-subject-re): New function.
+
+       * wl-draft.el (wl-draft-reply): Use it.
+
 2000-10-30  Yuuichi Teranishi  <teranisi@gohome.org>
 
        * wl-message.el (wl-mmelmo-message-redisplay): Use
index f8db10f..1810203 100644 (file)
@@ -275,6 +275,12 @@ the `wl-smtp-features' variable."
   (wl-draft-insert-message)
   (mail-position-on-field "To"))
 
+(defun wl-draft-strip-subject-re (subject)
+  "Remove \"Re:\" from subject lines. Shamelessly copied from Gnus"
+  (if (string-match wl-subject-prefix-regexp subject)
+      (substring subject (match-end 0))
+    subject))
+
 (defun wl-draft-reply (buf no-arg summary-buf)
   ""
 ;;;(save-excursion
@@ -365,13 +371,8 @@ the `wl-smtp-features' variable."
                        (nth 1 addr))))
             cc)))
     (and subject wl-reply-subject-prefix
-        (let ((case-fold-search t))
-          (not
-           (equal
-            (string-match (regexp-quote wl-reply-subject-prefix)
-                          subject)
-            0)))
-        (setq subject (concat wl-reply-subject-prefix subject)))
+        (setq subject (concat wl-reply-subject-prefix
+                               (wl-draft-strip-subject-re subject))))
     (setq in-reply-to (std11-field-body "Message-Id"))
     (setq references (nconc
                      (std11-field-bodies '("References" "In-Reply-To"))
index e87d8a2..ce892a5 100644 (file)
@@ -1147,6 +1147,12 @@ Each elements are regexp of field-name."
   :group 'wl-pref
   :group 'wl-draft)
 
+(defcustom wl-subject-prefix-regexp "^[ \t]*\\([Rr][Ee][:>][ \t]*\\)*[ \t]*"
+  "*Regexp matching \"Re: \" in the subject line."
+  :type 'regexp
+  :group 'wl-draft
+  :group 'wl-pref)
+
 (defcustom wl-folder-many-unsync-threshold 70
   "*Folders which contains messages more than this number are highlighted
 with wl-highlight-folder-many-face."