(TopLevel): Wrap autoload settings for executable-find and ifile-spam-filter
authorKatsumi Yamaoka <yamaoka@jpl.org>
Fri, 18 Oct 2002 02:42:23 +0000 (02:42 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Fri, 18 Oct 2002 02:42:23 +0000 (02:42 +0000)
 with eval-and-compile.
(spam-display-buffer-contents): Remove.
(spam-bogofilter-score): Merge spam-display-buffer-contents.

lisp/ChangeLog
lisp/spam.el

index 925e04e..5922530 100644 (file)
@@ -1,4 +1,11 @@
-2002-10-17    Ted Zlatanov <tzz@lifelogs.com>
+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
index ad8daac..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.
 
@@ -343,19 +346,6 @@ The regular expression is matched against the address.")
              cache nil)))
     found))
 
-(defun spam-display-buffer-contents ()
-  "Display contents of the current buffer in the echo area if possible,
-otherwise pop-up the buffer itself."
-  (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)))))
-
 \f
 ;;;; Training via Bogofilter.   Last updated 2002-09-02.
 
@@ -481,9 +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)
-      (spam-display-buffer-contents))))
+    (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)