Gnus development mailing list
 help / color / mirror / Atom feed
* spam-stat loading hooks aren't getting loaded
@ 2003-06-27 18:24 David Z Maze
  2003-06-27 19:29 ` Ted Zlatanov
  0 siblings, 1 reply; 2+ messages in thread
From: David Z Maze @ 2003-06-27 18:24 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 937 bytes --]

My .gnus file, very very loosely, looks like this:

  (require 'gnus)
  (require 'spam)
  ;; require a bunch of other crap
  ;; go through extended contortions to build nnmail-split-fancy
  (setq gnus-spam-crvft '(...)
        spam-stat-file "/afs/.../dmaze/.spam-stat.el"
        spam-use-stat t)

But when I (require 'spam), since spam-install-hooks is non-nil,
(spam-install-hooks-function) is called.  Actually adding the
spam-stat file load and save hooks is predicated on spam-use-stat
being non-nil, so they don't get set.  Then, after this is done, I set
spam-use-stat to t in my .gnus.

Is there any reason the hooks shouldn't always be installed?  They
call spam-maybe-spam-stat-save and -load, which only do anything if
spam-use-stat is non-nil; there would be a very marginal performance
penalty to non-spam-stat users when new mail is read in and when
gnus-save-newsrc-hook is called, but I think this is pretty ignorable.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1016 bytes --]

Index: spam.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/spam.el,v
retrieving revision 6.106
diff -u -r6.106 spam.el
--- spam.el     23 Jun 2003 20:33:04 -0000      6.106
+++ spam.el     27 Jun 2003 18:27:33 -0000
@@ -1185,10 +1185,9 @@
   "Install the spam.el hooks"
   (interactive)
   ;; Add hooks for loading and saving the spam stats
-  (when spam-use-stat
-    (add-hook 'gnus-save-newsrc-hook 'spam-maybe-spam-stat-save)
-    (add-hook 'gnus-get-top-new-news-hook 'spam-maybe-spam-stat-load)
-    (add-hook 'gnus-startup-hook 'spam-maybe-spam-stat-load))
+  (add-hook 'gnus-save-newsrc-hook 'spam-maybe-spam-stat-save)
+  (add-hook 'gnus-get-top-new-news-hook 'spam-maybe-spam-stat-load)
+  (add-hook 'gnus-startup-hook 'spam-maybe-spam-stat-load)
   (add-hook 'gnus-summary-prepare-exit-hook 'spam-summary-prepare-exit)
   (add-hook 'gnus-summary-prepare-hook 'spam-summary-prepare)
   (add-hook 'gnus-get-new-news-hook 'spam-setup-widening))

[-- Attachment #3: Type: text/plain, Size: 167 bytes --]


-- 
David Maze             dmaze@mit.edu          http://www.mit.edu/~dmaze/
"Theoretical politics is interesting.  Politicking should be illegal."
	-- Abra Mitchell

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: spam-stat loading hooks aren't getting loaded
  2003-06-27 18:24 spam-stat loading hooks aren't getting loaded David Z Maze
@ 2003-06-27 19:29 ` Ted Zlatanov
  0 siblings, 0 replies; 2+ messages in thread
From: Ted Zlatanov @ 2003-06-27 19:29 UTC (permalink / raw)
  Cc: ding

On Fri, 27 Jun 2003, dmaze@MIT.EDU wrote:
> Is there any reason the hooks shouldn't always be installed?  They
> call spam-maybe-spam-stat-save and -load, which only do anything if
> spam-use-stat is non-nil; there would be a very marginal performance
> penalty to non-spam-stat users when new mail is read in and when
> gnus-save-newsrc-hook is called, but I think this is pretty
> ignorable.

Yes, people who just used customize on spam.el and had the hooks
installed automatically were pretty unhappy with hooks installed by
default.  I was told to do it the way it's in the source code,
including the unload-hook function.  Look in the ding archives for the
full story.

I'm open to suggestions.  Maybe spam-use-stat should automatically
enable just the spam-stat hooks?

Ted



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-06-27 19:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-27 18:24 spam-stat loading hooks aren't getting loaded David Z Maze
2003-06-27 19:29 ` Ted Zlatanov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).