dotfiles

🎜 Clone'em, tweak'em, stick'em in your $HOME 🎝
git clone https://git.kevinlegouguec.net/dotfiles
Log | Files | Refs | README

commit d22ed9c99234149ed732deabd5ba6efe0065143f
parent d1a622cf8e03e829ac30086178cab61b64282521
Author: KΓ©vin Le Gouguec <kevin.legouguec@gmail.com>
Date:   Wed, 14 Apr 2021 23:17:24 +0200

Fix message-subject-re-regexp some more

Diffstat:
M.gnus | 37+++++++++++++++++++++++++------------
1 file changed, 25 insertions(+), 12 deletions(-)

diff --git 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