]> err.no Git - dotfiles/commitdiff
Handle lists.debian.org a little more gracefully
authortfheen <tfheen@8da78d58-1cd3-0310-bee5-d77bd1b3e8bf>
Sat, 13 Dec 2003 21:06:18 +0000 (21:06 +0000)
committertfheen <tfheen@8da78d58-1cd3-0310-bee5-d77bd1b3e8bf>
Sat, 13 Dec 2003 21:06:18 +0000 (21:06 +0000)
git-svn-id: file:///svn/tfheen/trunk/dotfiles@236 8da78d58-1cd3-0310-bee5-d77bd1b3e8bf

gnus

diff --git a/gnus b/gnus
index 01fa6754fbe789d3ce3ca7556887eee06469d481..96bac8ac275cbb292e7814b535fe064f4c231214 100644 (file)
--- 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: <URL:http://www.stud.ifi.uio.no/~jani/OBS/no-alt-gullkorn.shtml>")))
     ((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")