+2002-10-18 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * spam.el: Wrap autoload settings for executable-find and
+ ifile-spam-filter with eval-and-compile.
+ (spam-display-buffer-contents): Remove.
+ (spam-bogofilter-score): Merge spam-display-buffer-contents.
+
+2002-10-17 Ted Zlatanov <tzz@lifelogs.com>
+
+ * spam.el (spam-display-buffer-contents): New function.
+ (spam-bogofilter-score): use spam-display-buffer-contents, patch
+ from Katsumi Yamaoka <yamaoka@jpl.org>.
+
2002-10-17 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
* nnheader.el (nnheader-parse-naked-head): New function.
(file-error (defalias 'bbdb-search 'ignore))))
;; autoload executable-find
-(autoload 'executable-find "executable")
+(eval-and-compile
+ ;; executable-find is not autoloaded in Emacs 20
+ (autoload 'executable-find "executable"))
;; autoload ifile-spam-filter
-(autoload 'ifile-spam-filter "ifile-gnus")
+(eval-and-compile
+ (autoload 'ifile-spam-filter "ifile-gnus"))
;;; Main parameters.
(setq found t
cache nil)))
found))
+
\f
;;;; Training via Bogofilter. Last updated 2002-09-02.
(interactive)
(when (and spam-use-bogofilter spam-bogofilter-path)
(spam-bogofilter-articles nil "-v" (list (gnus-summary-article-number)))
- (save-excursion
- (set-buffer spam-output-buffer-name)
- (unless (= (point-min) (point-max))
- (display-message-or-buffer (current-buffer)
- spam-output-buffer-name)))))
+ (with-current-buffer spam-output-buffer-name
+ (unless (zerop (buffer-size))
+ (if (<= (count-lines (point-min) (point-max)) 1)
+ (progn
+ (goto-char (point-max))
+ (when (bolp)
+ (backward-char 1))
+ (message "%s" (buffer-substring (point-min) (point))))
+ (goto-char (point-min))
+ (display-buffer (current-buffer)))))))
(defun spam-bogofilter-register-routine ()
(when (and spam-use-bogofilter spam-bogofilter-path)