Gnus development mailing list
 help / color / mirror / Atom feed
* [PATCH] Simplify and correct header trimming before feeding to bogofilter
@ 2002-12-31  6:35 Michael Shields
  2002-12-31 12:30 ` Ted Zlatanov
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Shields @ 2002-12-31  6:35 UTC (permalink / raw)


I sent this patch a few days ago, but mail.gnus.org ate it.

2002-12-19  Michael Shields  <shields@msrl.com>
	
	* spam.el (spam-bogofilter-articles): Use message-remove-header
	to remove headers; the old way incorrectly removed just the first
	line of folded headers.

--- /home/shields/gnus-CURRENT-20021216/lisp/spam.el.orig	2002-12-31 06:34:23.000000000 +0000
+++ /home/shields/gnus-CURRENT-20021216/lisp/spam.el	2002-12-31 06:34:23.000000000 +0000
@@ -530,15 +530,10 @@
 	      (insert-buffer-substring gnus-original-article-buffer)
 	      ;; Remove spam classification redundant headers: they may induce
 	      ;; unwanted biases in later analysis.
-	      (goto-char (point-min))
-	      (while (not (or (eobp) (= (following-char) ?\n)))
-		(if (looking-at remove-regexp)
-		    (delete-region (point)
-				   (save-excursion (forward-line 1) (point)))
-		  (forward-line 1)))
-	      (goto-char (point-min))
+	      (message-remove-header remove-regexp t)
 	      ;; Bogofilter really wants From envelopes for counting articles.
 	      ;; Fake one at the beginning, make sure there will be no other.
+	      (goto-char (point-min))
 	      (if (looking-at "From ")
 		  (forward-line 1)
 		(insert "From nobody " (current-time-string) "\n"))

-- 
Shields.




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Simplify and correct header trimming before feeding to bogofilter
  2002-12-31  6:35 [PATCH] Simplify and correct header trimming before feeding to bogofilter Michael Shields
@ 2002-12-31 12:30 ` Ted Zlatanov
  0 siblings, 0 replies; 2+ messages in thread
From: Ted Zlatanov @ 2002-12-31 12:30 UTC (permalink / raw)
  Cc: ding

On Tue, 31 Dec 2002, shields@msrl.com wrote:
> I sent this patch a few days ago, but mail.gnus.org ate it.
> 
> 2002-12-19  Michael Shields  <shields@msrl.com>
> 	
> 	* spam.el (spam-bogofilter-articles): Use
> 	message-remove-header to remove headers; the old way
> 	incorrectly removed just the first line of folded headers.

Applied, thanks.

Ted




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-12-31 12:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-31  6:35 [PATCH] Simplify and correct header trimming before feeding to bogofilter Michael Shields
2002-12-31 12:30 ` Ted Zlatanov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).