Here is yet another patch:
it is very annoying that some messages are marked as coming from a known
sender but ':' does not show them because "known senders" are matched by
e-mail and name and the ':' searches just by email.
this patch makes them consistent.


From: Sam Steingold <s...@gnu.org>
Date: Thu, 9 Feb 2012 13:18:36 -0500
Subject: [PATCH] (bbdb-update-records): use `bbdb-message-search' instead of
 `bbdb-search' when `update-p' is `search' so that all
 senders marked with `bbdb/gnus-summary-known-poster-mark'
 can be displayed with `:'

---
 ChangeLog        |    6 ++++++
 lisp/bbdb-mua.el |   14 +++++---------
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 26b677c..b490120 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-02-09  Sam Steingold  <s...@gnu.org>
+       * lisp/bbdb-mua.el (bbdb-update-records): use
+       `bbdb-message-search' instead of `bbdb-search' when `update-p' is
+       `search' so that all senders marked with
+       `bbdb/gnus-summary-known-poster-mark' can be displayed with `:'
+
 2012-01-01  Sam Steingold  <s...@gnu.org>
        * lisp/bbdb-mua.el (bbdb-annotate-message): Remove
        bbdb-message-clean-name and completely trust
diff --git a/lisp/bbdb-mua.el b/lisp/bbdb-mua.el
index 4281c7d..93f0228 100644
--- a/lisp/bbdb-mua.el
+++ b/lisp/bbdb-mua.el
@@ -226,8 +226,7 @@ Usually this function is called by the wrapper 
`bbdb-mua-update-records'."
         (setq update-p (funcall update-p))))
   (if (eq t update-p)
       (setq update-p 'create))
-  (let ((bbdb-records (bbdb-records)) ;; search all records
-        ;; `bbdb-update-records-p' and `bbdb-offer-to-create' are used here
+  (let (;; `bbdb-update-records-p' and `bbdb-offer-to-create' are used here
         ;; as internal variables for communication with
         ;; `bbdb-prompt-for-create'.  This does not affect the value of the
         ;; global user variable `bbdb-update-records-p'.
@@ -243,14 +242,11 @@ Usually this function is called by the wrapper 
`bbdb-mua-update-records'."
     (when (and (not records) update-p)
       (while (setq address (pop address-list))
         (let* ((bbdb-update-records-address address)
-               (mail (nth 1 address))
                hits
                (task
                 (catch 'done
                   (setq hits
-                        (cond ((null mail)
-                               nil) ; ignore emtpy mails, e.g. (??? nil)
-                              ((eq bbdb-update-records-p 'create)
+                        (cond ((eq bbdb-update-records-p 'create)
                                (list (bbdb-annotate-message address t)))
                               ((eq bbdb-update-records-p 'query)
                                (list ; Search might return a list
@@ -259,9 +255,9 @@ Usually this function is called by the wrapper 
`bbdb-mua-update-records'."
                               ((eq bbdb-update-records-p 'search)
                                ;; Search for records having this mail address
                                ;; but do not modify an existing record.
-                               (let ((mail (concat "^" (regexp-quote mail) 
"$")))
-                                 ;; MAIL must be atomic arg.
-                                 (bbdb-search bbdb-records nil nil mail)))))
+                               (bbdb-message-search
+                                (car address)
+                                (bbdb-canonicalize-mail (cadr address))))))
                   nil)))
           (cond ((eq task 'quit)
                  (setq address-list nil))
-- 
1.7.5.4




-- 
Sam Steingold (http://sds.podval.org/) on Ubuntu 11.10 (oneiric) X 11.0.11004000
http://palestinefacts.org http://memri.org http://honestreporting.com
http://dhimmi.com http://openvotingconsortium.org http://www.memritv.org
Professionalism is being dispassionate about your work.


------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/

Reply via email to