Function: message--bbdb-query-with-words

message--bbdb-query-with-words is a byte-compiled function defined in message.el.gz.

Signature

(message--bbdb-query-with-words WORDS)

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/message.el.gz
(defun message--bbdb-query-with-words (words)
  ;; FIXME: This (or something like this) should live on the BBDB side.
  (when (fboundp 'bbdb-records)
    (require 'bbdb)           ;FIXME: `bbdb-records' is incorrectly autoloaded!
    (bbdb-records)            ;Make sure BBDB and its database is initialized.
    (defvar bbdb-hashtable)
    (declare-function bbdb-record-mail "bbdb" (record))
    (declare-function bbdb-dwim-mail "bbdb-com" (record &optional mail))
    (declare-function bbdb-completion-predicate "bbdb-com" (key records))
    (let ((records '())
          (responses '()))
      (dolist (word words)
	(dolist (c (all-completions word bbdb-hashtable
                                    #'bbdb-completion-predicate))
	  (dolist (record (gethash c bbdb-hashtable))
	    (cl-pushnew record records))))
      (dolist (record records)
	(dolist (mail (bbdb-record-mail record))
	  (push (bbdb-dwim-mail record mail) responses)))
      responses)))