Function: spam-initialize

spam-initialize is an autoloaded, interactive and byte-compiled function defined in spam.el.gz.

Signature

(spam-initialize &rest SYMBOLS)

Documentation

Install the spam.el hooks and do other initialization.

When SYMBOLS is given, set those variables to t. This is so you can call spam-initialize before you set spam-use-* variables on explicitly, and matters only if you need the extra headers installed through spam-necessary-extra-headers.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/spam.el.gz
;;}}}

;;}}}

;;{{{ Hooks

;;;###autoload
(defun spam-initialize (&rest symbols)
  "Install the spam.el hooks and do other initialization.
When SYMBOLS is given, set those variables to t.  This is so you
can call `spam-initialize' before you set spam-use-* variables on
explicitly, and matters only if you need the extra headers
installed through `spam-necessary-extra-headers'."
  (interactive)

  (when spam-install-hooks
    (dolist (var symbols)
      (set var t))

    (dolist (header (spam-necessary-extra-headers))
      (add-to-list 'nnmail-extra-headers header)
      (add-to-list 'gnus-extra-headers header))

    ;; TODO: How do we redo this every time the `spam' face is customized?
    (push '((eq mark gnus-spam-mark) . spam)
	  gnus-summary-highlight)
    ;; Add hooks for loading and saving the spam stats
    (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)
    (add-hook 'gnus-summary-prepared-hook #'spam-find-spam)
    ;; Don't install things more than once.
    (setq spam-install-hooks nil)))