From 6385882b7e73072381e422618ed98c92ad6e960e Mon Sep 17 00:00:00 2001 From: Jesper Harder Date: Thu, 22 Jan 2004 06:36:40 +0000 Subject: [PATCH] (spam-stat-strip-xref): New function. (spam-stat-process-directory): Use it. --- lisp/ChangeLog | 3 +++ lisp/spam-stat.el | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1a7acc635..2b35e2a65 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2004-01-22 Jesper Harder + * spam-stat.el (spam-stat-strip-xref): New function. + (spam-stat-process-directory): Use it. + * gnus-util.el (gnus-fetch-field): Don't bind case-fold-search here -- it's done in message-fetch-field. diff --git a/lisp/spam-stat.el b/lisp/spam-stat.el index 3602a6993..b7b7cd29a 100644 --- a/lisp/spam-stat.el +++ b/lisp/spam-stat.el @@ -122,6 +122,7 @@ ;;; Code: +(require 'mail-parse) (defgroup spam-stat nil "Statistical spam detection for Emacs. @@ -471,6 +472,13 @@ check the variable `spam-stat-score-data'." ;; Testing +(defun spam-stat-strip-xref () + "Strip the the Xref header." + (save-restriction + (mail-narrow-to-head) + (when (re-search-forward "^Xref:.*\n" nil t) + (delete-region (match-beginning 0) (match-end 0))))) + (defun spam-stat-process-directory (dir func) "Process all the regular files in directory DIR using function FUNC." (let* ((files (directory-files dir t "^[^.]")) @@ -484,6 +492,7 @@ check the variable `spam-stat-score-data'." (setq count (1+ count)) (message "Reading %s: %.2f%%" dir (/ count max)) (insert-file-contents f) + (spam-stat-strip-xref) (funcall func) (erase-buffer)))))) -- 2.34.1