aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Heuer <[email protected]>1995-02-03 04:21:05 +0000
committerKarl Heuer <[email protected]>1995-02-03 04:21:05 +0000
commit08960da1562b5f3246c44e566a5743f5a38eb1ee (patch)
treeed6f6b8c53d3a41b2c3611eed1b8bfc57b49945e
parent438c6ef0ef88d9c582ec3cf440c0773ba17bfcda (diff)
(rmail-reply-regexp): New var.
(rmail-reply): Delete text matching rmail-reply-regexp.
-rw-r--r--lisp/mail/rmail.el15
1 files changed, 11 insertions, 4 deletions
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 457b443a6a..0bc70936ed 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -1,6 +1,6 @@
;;; rmail.el --- main code of "RMAIL" mail reader for Emacs.
-;; Copyright (C) 1985,86,87,88,93,94 Free Software Foundation, Inc.
+;; Copyright (C) 1985,86,87,88,93,94,95 Free Software Foundation, Inc.
;; Maintainer: FSF
;; Keywords: mail
@@ -122,6 +122,11 @@ Called with region narrowed to the message, including headers.")
(defvar rmail-reply-prefix "Re: "
"String to prepend to Subject line when replying to a message.")
+;; Some mailers use "Re(2):" or "Re^2:" or "Re: Re:".
+;; This pattern should catch all the common variants.
+(defvar rmail-reply-regexp "\\`\\(Re\\(([0-9]+)\\|\\^[0-9]+\\)?: *\\)*"
+ "Regexp to delete from Subject line before inserting rmail-reply-prefix.")
+
(defvar rmail-display-summary nil
"If non nil, the summary buffer is always displayed.")
@@ -1975,9 +1980,11 @@ use \\[mail-yank-original] to yank the original message into it."
(mail-fetch-field "resent-message-id" t))
((mail-fetch-field "message-id"))))))
(and (stringp subject)
- (or (string-match (concat "\\`" (regexp-quote rmail-reply-prefix))
- subject)
- (setq subject (concat rmail-reply-prefix subject))))
+ (setq subject
+ (concat rmail-reply-prefix
+ (if (string-match rmail-reply-regexp subject)
+ (substring subject (match-end 0))
+ subject))))
(rmail-start-mail nil
(mail-strip-quoted-names reply-to)
subject