From: Teodor Zlatanov Date: Tue, 11 Oct 2011 14:24:55 +0000 (+0000) Subject: spam.el (spam-check-BBDB): Simplify and support BBDB 3.x when searching. Drop `bbdb... X-Git-Tag: emacs-pretest-24.0.91~154 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=128f4b895f4755f062484547bb0bf6d4a89b6ffe;p=emacs.git spam.el (spam-check-BBDB): Simplify and support BBDB 3.x when searching. Drop `bbdb-cache'. --- diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index a4c2d97403b..dbdaa5820f9 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,8 @@ +2011-10-11 Teodor Zlatanov + + * spam.el (spam-check-BBDB): Simplify and support BBDB 3.x when + searching. Drop `bbdb-cache'. + 2011-10-11 Katsumi Yamaoka * message.el (message-signed-or-encrypted-p): Exclude header when diff --git a/lisp/gnus/spam.el b/lisp/gnus/spam.el index c7f993d7293..fa152f688c4 100644 --- a/lisp/gnus/spam.el +++ b/lisp/gnus/spam.el @@ -2150,29 +2150,13 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details." (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