(spam-check-BBDB): fix the BBDB caching code to use
authorTeodor Zlatanov <tzz@lifelogs.com>
Tue, 21 Dec 2004 17:01:37 +0000 (17:01 +0000)
committerTeodor Zlatanov <tzz@lifelogs.com>
Tue, 21 Dec 2004 17:01:37 +0000 (17:01 +0000)
downcased symbol names; make a new cache instead of reusing
bbdb-hashtable

lisp/ChangeLog
lisp/spam.el

index b5af14b..e223d24 100644 (file)
@@ -1,3 +1,9 @@
+2004-12-21  Teodor Zlatanov  <tzz@lifelogs.com>
+
+       * spam.el (spam-check-BBDB): fix the BBDB caching code to use
+       downcased symbol names; make a new cache instead of reusing
+       bbdb-hashtable
+
 2004-12-21  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * rfc2231.el (rfc2231-parse-string): Decode encoded value after
index f4ee8e2..f61842d 100644 (file)
@@ -2088,21 +2088,24 @@ 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