From d22ed9c99234149ed732deabd5ba6efe0065143f Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Wed, 14 Apr 2021 23:17:24 +0200 Subject: Fix message-subject-re-regexp some more --- .gnus | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) (limited to '.gnus') diff --git a/.gnus b/.gnus index 18873aa..8bca6a2 100644 --- a/.gnus +++ b/.gnus @@ -41,18 +41,31 @@ . "%b %d") (t . "%F")) - gnus-gcc-mark-as-read t - ;; This regexp is used both in Gnus summary buffers to detect - ;; and elide similar subjects in a thread, and by message mode - ;; when replying, to determine what to strip from the subject. - message-subject-re-regexp - (rx bol (+ (* space) - (or "re" "Re" "RE" - "aw" "Aw" "AW" - "sv" "Sv" "SV" - (seq "bug#" (+ digit)) - "[External]") - (* space) ":" (* space)))) + gnus-gcc-mark-as-read t) + +;; message-subject-re-regexp is used both in Gnus summary buffers to +;; detect and elide similar subjects in a thread, and by message mode +;; when replying, to determine what to strip from the subject. +;; +;; Some MUAs add cruft to the subject, turning "Re: bug#123: foobar" +;; into "RE: [External] : Re: bug#1234: foobar", which Debbugs will +;; then turn into "bug#1234: [External] : Re: bug#1234: foobar". +;; +;; The only way I can find to tell the Gnus summary code to +;; canonicalize all that cruft away is by tweaking this regexp, but +;; setting its global value causes message mode to elide stuff it +;; shouldn't. Therefore, chase down the best Gnus hook for the job, +;; and set the regexp locally. +(add-hook 'gnus-summary-generate-hook + (lambda () + (setq-local message-subject-re-regexp + (rx bol (+ (* space) + (or "re" "Re" "RE" + "aw" "Aw" "AW" + "sv" "Sv" "SV" + (seq "bug#" (+ digit)) + "[External]") + (* space) ":" (* space)))))) (gnus-add-configuration '(summary -- cgit v1.2.3