aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2020-04-13 11:43:39 +0300
committerEli Zaretskii2020-04-13 11:43:39 +0300
commit49f2811f7827142fd5dcd6c4a53fd7c0c700054f (patch)
treea25da0288c23e8de10c06b2222c6844770542db0
parent91e4acf7c736dfdb2673dc33c9303b5284e925df (diff)
downloademacs-49f2811f7827142fd5dcd6c4a53fd7c0c700054f.tar.gz
emacs-49f2811f7827142fd5dcd6c4a53fd7c0c700054f.zip
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'.
-rw-r--r--etc/NEWS7
-rw-r--r--lisp/mail/rmail.el14
2 files changed, 19 insertions, 2 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 7a7f11f5071..9f3e5b650b5 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -275,6 +275,13 @@ The new default value is 2000000 (2 megabytes).
275*** New customizable option 'texinfo-texi2dvi-options'. 275*** New customizable option 'texinfo-texi2dvi-options'.
276This is used when invoking 'texi2dvi' from 'texinfo-tex-buffer'. 276This is used when invoking 'texi2dvi' from 'texinfo-tex-buffer'.
277 277
278** Rmail
279
280---
281*** New customizable option 'rmail-re-abbrevs'.
282Its default value matches localized abbreviations of the "reply"
283prefix on the Subject line in various languages.
284
278 285
279* New Modes and Packages in Emacs 28.1 286* New Modes and Packages in Emacs 28.1
280 287
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:
578(defvar rmail-reply-prefix "Re: " 578(defvar rmail-reply-prefix "Re: "
579 "String to prepend to Subject line when replying to a message.") 579 "String to prepend to Subject line when replying to a message.")
580 580
581;; Note: this is matched with case-fold-search bound to t.
582(defcustom rmail-re-abbrevs
583 "\\(RE\\|رد\\|回复\\|回覆\\|SV\\|Antw\\|VS\\|REF\\|AW\\|ΑΠ\\|ΣΧΕΤ\\|השב\\|Vá\\|R\\|RIF\\|BLS\\|RES\\|Odp\\|YNT\\|ATB\\)"
584 "Regexp with localized 'Re:' abbreviations in various languages."
585 :version "28.1"
586 :type 'regexp)
587
581;; Some mailers use "Re(2):" or "Re^2:" or "Re: Re:" or "Re[2]:". 588;; Some mailers use "Re(2):" or "Re^2:" or "Re: Re:" or "Re[2]:".
582;; This pattern should catch all the common variants. 589;; This pattern should catch all the common variants.
583;; rms: I deleted the change to delete tags in square brackets 590;; rms: I deleted the change to delete tags in square brackets
584;; because they mess up RT tags. 591;; because they mess up RT tags.
585(defvar rmail-reply-regexp "\\`\\(Re\\(([0-9]+)\\|\\[[0-9]+\\]\\|\\^[0-9]+\\)?: *\\)*" 592(defvar rmail-reply-regexp
593 (concat "\\`\\("
594 rmail-re-abbrevs
595 "\\(([0-9]+)\\|\\[[0-9]+\\]\\|\\^[0-9]+\\)?[::] *\\)*")
586 "Regexp to delete from Subject line before inserting `rmail-reply-prefix'.") 596 "Regexp to delete from Subject line before inserting `rmail-reply-prefix'.")
587 597
588(defcustom rmail-display-summary nil 598(defcustom rmail-display-summary nil
@@ -3398,7 +3408,7 @@ whitespace, replacing whitespace runs with a single space and
3398removing prefixes such as Re:, Fwd: and so on and mailing list 3408removing prefixes such as Re:, Fwd: and so on and mailing list
3399tags such as [tag]." 3409tags such as [tag]."
3400 (let ((subject (or (rmail-get-header "Subject" msgnum) "")) 3410 (let ((subject (or (rmail-get-header "Subject" msgnum) ""))
3401 (regexp "\\`[ \t\n]*\\(\\(\\w\\{1,3\\}:\\|\\[[^]]+]\\)[ \t\n]+\\)*")) 3411 (regexp "\\`[ \t\n]*\\(\\(\\w\\{1,3\\}[::]\\|\\[[^]]+]\\)[ \t\n]+\\)*"))
3402 (setq subject (rfc2047-decode-string subject)) 3412 (setq subject (rfc2047-decode-string subject))
3403 (setq subject (replace-regexp-in-string regexp "" subject)) 3413 (setq subject (replace-regexp-in-string regexp "" subject))
3404 (replace-regexp-in-string "[ \t\n]+" " " subject))) 3414 (replace-regexp-in-string "[ \t\n]+" " " subject)))