summaryrefslogtreecommitdiff
path: root/lisp/mail/rmail.el
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2020-04-13 11:43:39 +0300
committerEli Zaretskii <eliz@gnu.org>2020-04-13 11:43:39 +0300
commit49f2811f7827142fd5dcd6c4a53fd7c0c700054f (patch)
treea25da0288c23e8de10c06b2222c6844770542db0 /lisp/mail/rmail.el
parent91e4acf7c736dfdb2673dc33c9303b5284e925df (diff)
downloademacs-49f2811f7827142fd5dcd6c4a53fd7c0c700054f.tar.gz
Improve support of "Re:" in Rmail
* lisp/mail/rmail.el (rmail-simplified-subject) (rmail-reply-regexp): Recognize U+FF1A FULLWIDTH COLON as a colon after "Re:"-type prefixes. (rmail-re-abbrevs): New defcustom with localized abbreviations of "Re:". (rmail-reply-regexp): Use 'rmail-re-abbrevs'. Recognize U+FF1A in addition to the ASCII colon. * etc/NEWS: Call out the new defcustom 'rmail-re-abbrevs'.
Diffstat (limited to 'lisp/mail/rmail.el')
-rw-r--r--lisp/mail/rmail.el14
1 files changed, 12 insertions, 2 deletions
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index d79cea987e9..6c9847304fd 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -578,11 +578,21 @@ Examples:
(defvar rmail-reply-prefix "Re: "
"String to prepend to Subject line when replying to a message.")
+;; Note: this is matched with case-fold-search bound to t.
+(defcustom rmail-re-abbrevs
+ "\\(RE\\|رد\\|回复\\|回覆\\|SV\\|Antw\\|VS\\|REF\\|AW\\|ΑΠ\\|ΣΧΕΤ\\|השב\\|Vá\\|R\\|RIF\\|BLS\\|RES\\|Odp\\|YNT\\|ATB\\)"
+ "Regexp with localized 'Re:' abbreviations in various languages."
+ :version "28.1"
+ :type 'regexp)
+
;; Some mailers use "Re(2):" or "Re^2:" or "Re: Re:" or "Re[2]:".
;; This pattern should catch all the common variants.
;; rms: I deleted the change to delete tags in square brackets
;; because they mess up RT tags.
-(defvar rmail-reply-regexp "\\`\\(Re\\(([0-9]+)\\|\\[[0-9]+\\]\\|\\^[0-9]+\\)?: *\\)*"
+(defvar rmail-reply-regexp
+ (concat "\\`\\("
+ rmail-re-abbrevs
+ "\\(([0-9]+)\\|\\[[0-9]+\\]\\|\\^[0-9]+\\)?[::] *\\)*")
"Regexp to delete from Subject line before inserting `rmail-reply-prefix'.")
(defcustom rmail-display-summary nil
@@ -3398,7 +3408,7 @@ whitespace, replacing whitespace runs with a single space and
removing prefixes such as Re:, Fwd: and so on and mailing list
tags such as [tag]."
(let ((subject (or (rmail-get-header "Subject" msgnum) ""))
- (regexp "\\`[ \t\n]*\\(\\(\\w\\{1,3\\}:\\|\\[[^]]+]\\)[ \t\n]+\\)*"))
+ (regexp "\\`[ \t\n]*\\(\\(\\w\\{1,3\\}[::]\\|\\[[^]]+]\\)[ \t\n]+\\)*"))
(setq subject (rfc2047-decode-string subject))
(setq subject (replace-regexp-in-string regexp "" subject))
(replace-regexp-in-string "[ \t\n]+" " " subject)))