* spam.el (spam-initialize): new function, does the spam-face
authorTeodor Zlatanov <tzz@lifelogs.com>
Fri, 10 Oct 2003 16:02:45 +0000 (16:02 +0000)
committerTeodor Zlatanov <tzz@lifelogs.com>
Fri, 10 Oct 2003 16:02:45 +0000 (16:02 +0000)
update and all the hooks, replaces spam-install-hooks-function

* gnus-registry.el (gnus-registry-initialize): new autoloaded
function to explicitly initialize the registry

lisp/ChangeLog
lisp/gnus-registry.el
lisp/spam.el

index 2db82d9..587de56 100644 (file)
@@ -1,3 +1,11 @@
+2003-10-10  Teodor Zlatanov  <tzz@lifelogs.com>
+
+       * spam.el (spam-initialize): new function, does the spam-face
+       update and all the hooks, replaces spam-install-hooks-function
+
+       * gnus-registry.el (gnus-registry-initialize): new autoloaded
+       function to explicitly initialize the registry
+
 2003-10-10  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * mm-decode.el (mm-w3m-safe-url-regexp): Doc fix.
index 8160c81..e3b9177 100644 (file)
@@ -569,6 +569,14 @@ Returns the first place where the trail finds a group name."
   (setq gnus-registry-hashtb (alist-to-hashtable gnus-registry-alist))
   (setq gnus-registry-dirty t))
 
+;;;###autoload
+(defun gnus-registry-initialize ()
+  (interactive)
+  (setq gnus-registry-install t)
+  (gnus-registry-install-hooks)
+  (gnus-registry-read))
+
+;;;###autoload
 (defun gnus-registry-install-hooks ()
   "Install the registry hooks."
   (interactive)
index 28dc6c0..1b3bfb4 100644 (file)
@@ -370,13 +370,6 @@ spamoracle database."
   "Msx" gnus-summary-mark-as-spam
   "\M-d" gnus-summary-mark-as-spam)
 
-;;; How to highlight a spam summary line.
-
-;; TODO: How do we redo this every time spam-face is customized?
-
-(push '((eq mark gnus-spam-mark) . spam-face)
-      gnus-summary-highlight)
-
 ;; convenience functions
 (defun spam-group-ham-mark-p (group mark &optional spam)
   (when (stringp group)
@@ -1224,9 +1217,13 @@ Uses `gnus-newsgroup-name' if category is nil (for ham registration)."
 ;;;; Hooks
 
 ;;;###autoload
-(defun spam-install-hooks-function ()
-  "Install the spam.el hooks"
+(defun spam-initialize ()
+  "Install the spam.el hooks and do other initialization"
   (interactive)
+  (setq spam-install-hooks t)
+  ;; TODO: How do we redo this every time spam-face is customized?
+  (push '((eq mark gnus-spam-mark) . spam-face)
+       gnus-summary-highlight)
   ;; Add hooks for loading and saving the spam stats
   (when spam-use-stat
     (add-hook 'gnus-save-newsrc-hook 'spam-maybe-spam-stat-save)
@@ -1247,7 +1244,7 @@ Uses `gnus-newsgroup-name' if category is nil (for ham registration)."
   (remove-hook 'gnus-get-new-news-hook 'spam-setup-widening))
 
 (when spam-install-hooks
-  (spam-install-hooks-function))
+  (spam-initialize))
 
 (provide 'spam)