(spam-stat-process-directory): Use it.
2004-01-22 Jesper Harder <harder@ifa.au.dk>
+ * 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.
\f
;;; Code:
+(require 'mail-parse)
(defgroup spam-stat nil
"Statistical spam detection for Emacs.
;; 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 "^[^.]"))
(setq count (1+ count))
(message "Reading %s: %.2f%%" dir (/ count max))
(insert-file-contents f)
+ (spam-stat-strip-xref)
(funcall func)
(erase-buffer))))))