From 9e1b7e99e310e517a7f47c84d0f625bf5b8dbbc2 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Mon, 6 Feb 2006 22:04:10 +0000 Subject: [PATCH] Synch to No Gnus 200602061648. --- lisp/ChangeLog | 7 +++++++ lisp/spam-report.el | 32 +++++++++++++++++++------------- 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1976590..b3d5345 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2006-02-06 Reiner Steib + + * 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 * rfc2231.el (rfc2231-parse-string): Revert 2006-02-03 change. diff --git a/lisp/spam-report.el b/lisp/spam-report.el index a7179d5..3f5c726 100644 --- a/lisp/spam-report.el +++ b/lisp/spam-report.el @@ -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..." -- 1.7.10.4