From 790d6304437fe53652f0d4611c09f52afee9a13c Mon Sep 17 00:00:00 2001 From: tfheen Date: Sat, 13 Dec 2003 21:06:18 +0000 Subject: [PATCH] Handle lists.debian.org a little more gracefully git-svn-id: file:///svn/tfheen/trunk/dotfiles@236 8da78d58-1cd3-0310-bee5-d77bd1b3e8bf --- gnus | 54 +++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 41 insertions(+), 13 deletions(-) diff --git a/gnus b/gnus index 01fa675..96bac8a 100644 --- a/gnus +++ b/gnus @@ -493,6 +493,29 @@ inserts \" characters." (setq-default paragraph-separate (default-value 'paragraph-start)) (setq adaptive-fill-regexp (substring (default-value 'paragraph-start) 1 -1)) +(defun tfheen-debian-group-p () + (if (= (string-match "nnml:linux.debian" gnus-newsgroup-name) 0) t nil)) + +(defun tfheen-get-recipients-parsed () +(save-excursion + (set-buffer gnus-article-buffer) + (message-narrow-to-headers-or-head) + (append (mail-header-parse-addresses + (message-fetch-field "to")) + (mail-header-parse-addresses + (message-fetch-field "cc"))))) + +(defun tfheen-debian-find-recipients () + "Try to find all the recipients on debian lists." + (save-excursion + (set-buffer gnus-article-buffer) + (message-narrow-to-headers-or-head) + (or (message-fetch-field "Mail-Followup-To") + (mapconcat '(lambda(x) + (if (string-match ".*@lists.debian.org" (car x)) + (car x) nil)) + (tfheen-get-recipients-parsed) ", ")))) + (setq gnus-posting-styles '( ; Default-verdier @@ -538,21 +561,26 @@ inserts \" characters." Send bidrag til no-alt-gullkorn@moderators.usenet.no OBS: "))) ((and (message-mail-p) (stringp gnus-newsgroup-name)) - ("Mail-Followup-To" (gnus-group-get-parameter gnus-newsgroup-name 'to-address))) + ("Mail-Followup-To" (or (gnus-group-get-parameter gnus-newsgroup-name 'to-address) + (if (tfheen-debian-group-p) + (mapconcat '(lambda(x) + (if (string-match ".*@lists.debian.org" (car x)) + (car x) nil)) + (tfheen-get-recipients-parsed) + nil))))) + + ((and (message-mail-p) (stringp gnus-newsgroup-name) (tfheen-debian-group-p)) + (to (tfheen-debian-find-recipients)) + (cc nil)) ("nnml:in-" - (address (save-excursion - (set-buffer gnus-article-buffer) - (message-narrow-to-headers-or-head) - (let ((addr (mapconcat '(lambda(x) - (if (string-match gnus-ignored-from-addresses - (car x)) - (car x) nil)) - (append (mail-header-parse-addresses - (message-fetch-field "to")) - (mail-header-parse-addresses - (message-fetch-field "cc"))) + (address (let ((addr + (mapconcat '(lambda(x) + (if (string-match gnus-ignored-from-addresses + (car x)) + (car x) nil)) + (tfheen-get-recipients-parsed) nil))) - (if (string-equal addr "") "tfheen@raw.no" addr))))) + (if (string-equal addr "") "tfheen@raw.no" addr)))) ; ITK/Samfundet-ting ("nnml:drift.\\(itk\\|samfundet\\)" (address "tfheen@samfundet.no") -- 2.39.5