(spam-report-gmane-use-article-number): Improve
authorReiner Steib <Reiner.Steib@gmx.de>
Mon, 6 Feb 2006 16:48:43 +0000 (16:48 +0000)
committerReiner Steib <Reiner.Steib@gmx.de>
Mon, 6 Feb 2006 16:48:43 +0000 (16:48 +0000)
doc string.
(spam-report-gmane-internal): Check if a suitable header was found
in the article.

lisp/ChangeLog
lisp/spam-report.el

index 4cd059e..09a9ecb 100644 (file)
@@ -1,3 +1,10 @@
+2006-02-06  Reiner Steib  <Reiner.Steib@gmx.de>
+
+       * spam-report.el (spam-report-gmane-use-article-number): Improve
+       doc string.
+       (spam-report-gmane-internal): Check if a suitable header was found
+       in the article.
+
 2006-02-04  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * rfc2231.el (rfc2231-parse-string): Revert 2006-02-03 change.
index abbb8d1..54f48f1 100644 (file)
@@ -50,7 +50,11 @@ instead."
   :group 'spam-report)
 
 (defcustom spam-report-gmane-use-article-number t
-  "Whether the article number (faster!) or the header should be used."
+  "Whether the article number (faster!) or the header should be used.
+
+You must set this to nil if you don't read Gmane groups directly
+from news.gmane.org, e.g. when using local newsserver such as
+leafnode."
   :type 'boolean
   :group 'spam-report)
 
@@ -158,18 +162,20 @@ Reports is as ham when HAM is set."
            (setq field (or (gnus-fetch-field "X-Report-Spam")
                            (gnus-fetch-field "X-Report-Unspam")
                            (gnus-fetch-field "Archived-At")))
-           (setq host (progn
-                        (string-match
-                         (concat "http://\\([a-z]+\\.gmane\\.org\\)"
-                                 "\\(/[^:/]+[:/][0-9]+\\)")
-                         field)
-                        (match-string 1 field)))
-           (setq report (match-string 2 field))
-           (when (string-equal "permalink.gmane.org" host)
-             (setq host rpt-host)
-             (setq report (gnus-replace-in-string
-                           report "/\\([0-9]+\\)$" ":\\1")))
-           (setq url (format "http://%s%s" host report))
+           (when (stringp field)
+             (setq host
+                   (progn
+                     (string-match
+                      (concat "http://\\([a-z]+\\.gmane\\.org\\)"
+                              "\\(/[^:/]+[:/][0-9]+\\)")
+                      field)
+                     (match-string 1 field)))
+             (setq report (match-string 2 field))
+             (when (string-equal "permalink.gmane.org" host)
+               (setq host rpt-host)
+               (setq report (gnus-replace-in-string
+                             report "/\\([0-9]+\\)$" ":\\1")))
+             (setq url (format "http://%s%s" host report)))
            (if (not (and host report url))
                (gnus-message
                 3 "Could not find a spam report header in article %d..."