Require spam-stat in a normal fashion without binding `spam-stat-install-hooks' to...
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sun, 26 Jun 2011 11:23:45 +0000 (13:23 +0200)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sun, 26 Jun 2011 11:23:45 +0000 (13:23 +0200)
lisp/ChangeLog
lisp/spam-stat.el
lisp/spam.el

index 0e4fca9..5103f1a 100644 (file)
@@ -1,3 +1,11 @@
+2011-06-26  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * spam.el (spam-stat): Require in a normal fashion without binding
+       `spam-stat-install-hooks' to avoid compilation warnings.
+
+       * spam-stat.el (spam-stat-install-hooks): Removed.
+       (spam-stat-install-hooks): Don't run automatically.
+
 2011-06-26  Timo Juhani Lindfors <timo.lindfors@iki.fi>  (tiny change)
 
        * gnus-msg.el (gnus-summary-reply-to-list-with-original): New command
index b56d0c4..8b56c7b 100644 (file)
@@ -138,12 +138,6 @@ See `spam-stat-to-hash-table' for the format of the file."
   :type 'file
   :group 'spam-stat)
 
-(defcustom spam-stat-install-hooks t
-  "Whether spam-stat should install its hooks in Gnus.
-This is set to nil if you use spam-stat through spam.el."
-  :type 'boolean
-  :group 'spam-stat)
-
 (defcustom spam-stat-unknown-word-score 0.2
   "The score to use for unknown words.
 Also used for words that don't appear often enough."
@@ -658,9 +652,6 @@ COUNT defaults to 5"
   (add-hook 'gnus-select-article-hook
            'spam-stat-store-gnus-article-buffer))
 
-(when spam-stat-install-hooks
-  (spam-stat-install-hooks-function))
-
 (defun spam-stat-unload-hook ()
   "Uninstall the spam-stat function hooks."
   (interactive)
index cbffeea..33dbaaa 100644 (file)
@@ -2260,51 +2260,44 @@ Uses `gnus-newsgroup-name' if category is nil (for ham registration)."
   (autoload 'spam-stat-save "spam-stat")
   (autoload 'spam-stat-split-fancy "spam-stat"))
 
-(eval-and-compile
-  (when (condition-case nil
-            (let ((spam-stat-install-hooks nil))
-              (require 'spam-stat))
-          (file-error
-           (defalias 'spam-stat-register-ham-routine 'ignore)
-           (defalias 'spam-stat-register-spam-routine 'ignore)
-           nil))
+(require 'spam-stat)
 
-    (defun spam-check-stat ()
-      "Check the spam-stat backend for the classification of this message"
-      (let ((spam-stat-split-fancy-spam-group spam-split-group) ; override
-            (spam-stat-buffer (buffer-name)) ; stat the current buffer
-            category return)
-        (spam-stat-split-fancy)))
+(defun spam-check-stat ()
+  "Check the spam-stat backend for the classification of this message"
+  (let ((spam-stat-split-fancy-spam-group spam-split-group) ; override
+       (spam-stat-buffer (buffer-name)) ; stat the current buffer
+       category return)
+    (spam-stat-split-fancy)))
 
-    (defun spam-stat-register-spam-routine (articles &optional unregister)
-      (dolist (article articles)
-        (let ((article-string (spam-get-article-as-string article)))
-          (with-temp-buffer
-            (insert article-string)
-            (if unregister
-                (spam-stat-buffer-change-to-non-spam)
-              (spam-stat-buffer-is-spam))))))
+(defun spam-stat-register-spam-routine (articles &optional unregister)
+  (dolist (article articles)
+    (let ((article-string (spam-get-article-as-string article)))
+      (with-temp-buffer
+       (insert article-string)
+       (if unregister
+           (spam-stat-buffer-change-to-non-spam)
+         (spam-stat-buffer-is-spam))))))
 
-    (defun spam-stat-unregister-spam-routine (articles)
-      (spam-stat-register-spam-routine articles t))
+(defun spam-stat-unregister-spam-routine (articles)
+  (spam-stat-register-spam-routine articles t))
 
-    (defun spam-stat-register-ham-routine (articles &optional unregister)
-      (dolist (article articles)
-        (let ((article-string (spam-get-article-as-string article)))
-          (with-temp-buffer
-            (insert article-string)
-            (if unregister
-                (spam-stat-buffer-change-to-spam)
-              (spam-stat-buffer-is-non-spam))))))
+(defun spam-stat-register-ham-routine (articles &optional unregister)
+  (dolist (article articles)
+    (let ((article-string (spam-get-article-as-string article)))
+      (with-temp-buffer
+       (insert article-string)
+       (if unregister
+           (spam-stat-buffer-change-to-spam)
+         (spam-stat-buffer-is-non-spam))))))
 
-    (defun spam-stat-unregister-ham-routine (articles)
-      (spam-stat-register-ham-routine articles t))
+(defun spam-stat-unregister-ham-routine (articles)
+  (spam-stat-register-ham-routine articles t))
 
-    (defun spam-maybe-spam-stat-load ()
-      (when spam-use-stat (spam-stat-load)))
+(defun spam-maybe-spam-stat-load ()
+  (when spam-use-stat (spam-stat-load)))
 
-    (defun spam-maybe-spam-stat-save ()
-      (when spam-use-stat (spam-stat-save)))))
+(defun spam-maybe-spam-stat-save ()
+  (when spam-use-stat (spam-stat-save)))
 
 ;;}}}