Synch with Oort Gnus.
authoryamaoka <yamaoka>
Fri, 18 Oct 2002 01:49:46 +0000 (01:49 +0000)
committeryamaoka <yamaoka>
Fri, 18 Oct 2002 01:49:46 +0000 (01:49 +0000)
lisp/ChangeLog
lisp/spam.el

index 36f7dcc..5922530 100644 (file)
@@ -1,3 +1,16 @@
+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.
index e6a54f8..ea2643e 100644 (file)
     (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.
 
@@ -342,6 +345,7 @@ The regular expression is matched against the address.")
        (setq found t
              cache nil)))
     found))
+
 \f
 ;;;; Training via Bogofilter.   Last updated 2002-09-02.
 
@@ -467,11 +471,16 @@ spamicity coefficient of each, and the overall article spamicity."
   (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)