Revision: miles@gnu.org--gnu-2005/gnus--devo--0--patch-37
[gnus] / lisp / spam.el
index f4ee8e2..ee57514 100644 (file)
@@ -80,7 +80,7 @@ Populated by spam-install-backend-super.")
 
 (defgroup spam nil
   "Spam configuration."
-  :version "21.4")
+  :version "22.1")
 
 (defcustom spam-summary-exit-behavior 'default
   "Exit behavior at the time of summary exit.
@@ -350,7 +350,19 @@ Only meaningful if you enable `spam-use-blackholes'."
   :type '(radio (const nil) regexp)
   :group 'spam)
 
-(defcustom spam-face 'gnus-splash-face
+(defface spam-face
+  '((((class color) (type tty) (background dark))
+     (:foreground "gray80" :background "gray50"))
+    (((class color) (type tty) (background light))
+     (:foreground "gray50" :background "gray80"))
+    (((class color) (background dark))
+     (:foreground "ivory2"))
+    (((class color) (background light))
+     (:foreground "ivory4"))
+    (t :inverse-video t))
+  "Face for spam-marked articles.")
+
+(defcustom spam-face 'spam-face
   "Face for spam-marked articles."
   :type 'face
   :group 'spam)
@@ -2088,21 +2100,23 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details."
        (when spam-cache-lookups
          (setq bbdb-cache (gethash 'spam-use-BBDB spam-caches))
          (unless bbdb-cache
-           (setq bbdb-cache
-                 ;; this is the expanded (bbdb-hashtable) macro
-                 ;; without the debugging support
-                 (with-current-buffer (bbdb-buffer)
-                   (save-excursion
-                     (save-window-excursion
-                       (bbdb-records nil t)
-                       bbdb-hashtable))))
+           (setq bbdb-cache (make-vector 17 0)) ; a good starting hash value
+           ;; this is based on the expanded (bbdb-hashtable) macro
+           ;; without the debugging support
+           (with-current-buffer (bbdb-buffer)
+             (save-excursion
+               (save-window-excursion
+                 (bbdb-records nil t)
+                 (mapatoms 
+                  (lambda (symbol)
+                    (intern (downcase (symbol-name symbol)) bbdb-cache))
+                  bbdb-hashtable))))
            (puthash 'spam-use-BBDB bbdb-cache spam-caches)))
        (when who
          (setq who (nth 1 (gnus-extract-address-components who)))
          (if
              (if spam-cache-lookups
-                 (symbol-value
-                  (intern-soft who bbdb-cache))
+                 (intern-soft (downcase who) bbdb-cache)
                (bbdb-search-simple nil who))
              t
            (if spam-use-BBDB-exclusive