emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r106052: spam.el (spam-check-BBDB): S


From: Katsumi Yamaoka
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r106052: spam.el (spam-check-BBDB): Simplify and support BBDB 3.x when searching. Drop `bbdb-cache'.
Date: Tue, 11 Oct 2011 14:24:55 +0000
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 106052
author: Teodor Zlatanov <address@hidden>
committer: Katsumi Yamaoka <address@hidden>
branch nick: trunk
timestamp: Tue 2011-10-11 14:24:55 +0000
message:
  spam.el (spam-check-BBDB): Simplify and support BBDB 3.x when searching.  
Drop `bbdb-cache'.
modified:
  lisp/gnus/ChangeLog
  lisp/gnus/spam.el
=== modified file 'lisp/gnus/ChangeLog'
--- a/lisp/gnus/ChangeLog       2011-10-11 05:51:09 +0000
+++ b/lisp/gnus/ChangeLog       2011-10-11 14:24:55 +0000
@@ -1,3 +1,8 @@
+2011-10-11  Teodor Zlatanov  <address@hidden>
+
+       * spam.el (spam-check-BBDB): Simplify and support BBDB 3.x when
+       searching.  Drop `bbdb-cache'.
+
 2011-10-11  Katsumi Yamaoka  <address@hidden>
 
        * message.el (message-signed-or-encrypted-p): Exclude header when

=== modified file 'lisp/gnus/spam.el'
--- a/lisp/gnus/spam.el 2011-08-04 00:58:07 +0000
+++ b/lisp/gnus/spam.el 2011-10-11 14:24:55 +0000
@@ -2150,29 +2150,13 @@
 
     (defun spam-check-BBDB ()
       "Mail from people in the BBDB is classified as ham or non-spam"
-      (let ((who (message-fetch-field "from"))
-            bbdb-cache bbdb-hashtable)
-        (when spam-cache-lookups
-          (setq bbdb-cache (gethash 'spam-use-BBDB spam-caches))
-          (unless bbdb-cache
-            (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)))
+      (let ((who (message-fetch-field "from")))
         (when who
           (setq who (nth 1 (gnus-extract-address-components who)))
           (if
-              (if spam-cache-lookups
-                  (intern-soft (downcase who) bbdb-cache)
-                (bbdb-search-simple nil who))
+              (if (fboundp 'bbdb-search)
+                  (bbdb-search (bbdb-records) who) ;; v3
+                (bbdb-search-simple nil who)) ;; v2
               t
             (if spam-use-BBDB-exclusive
                 spam-split-group


reply via email to

[Prev in Thread] Current Thread [Next in Thread]