1 ;; gnus-bbdb.el --- Interface to T-gnus
3 ;; Copyright (c) 1991,1992,1993 Jamie Zawinski <jwz@netscape.com>.
4 ;; Copyright (C) 1995,1996,1997 Shuhei KOBAYASHI
5 ;; Copyright (C) 1997,1998 MORIOKA Tomohiko
6 ;; Copyright (C) 1998,1999 Keiichi Suzuki <keiichi@nanap.org>
8 ;; Author: Keiichi Suzuki <keiichi@nanap.org>
9 ;; Author: Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp>
10 ;; Keywords: BBDB, MIME, multimedia, multilingual, mail, news
12 ;; This file is part of T-gnus.
14 ;; This program is free software; you can redistribute it and/or
15 ;; modify it under the terms of the GNU General Public License as
16 ;; published by the Free Software Foundation; either version 2, or (at
17 ;; your option) any later version.
19 ;; This program is distributed in the hope that it will be useful, but
20 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 ;; General Public License for more details.
24 ;; You should have received a copy of the GNU General Public License
25 ;; along with GNU Emacs; see the file COPYING. If not, write to the
26 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
27 ;; Boston, MA 02111-1307, USA.
36 (defvar bbdb-pop-up-elided-display) ; default unbound.
40 (defvar gnus-bbdb/decode-field-body-function 'nnheader-decode-field-body
41 "*Field body decoder.")
43 (defmacro gnus-bbdb/decode-field-body (field-body field-name)
44 `(or (and (functionp gnus-bbdb/decode-field-body-function)
45 (funcall gnus-bbdb/decode-field-body-function
46 ,field-body ,field-name))
50 (defun gnus-bbdb/update-record (&optional offer-to-create)
51 "returns the record corresponding to the current GNUS message, creating
52 or modifying it as necessary. A record will be created if
53 bbdb/news-auto-create-p is non-nil, or if OFFER-TO-CREATE is true and
54 the user confirms the creation."
56 (gnus-bbdb/pop-up-bbdb-buffer offer-to-create)
57 (let ((from (mime-entity-fetch-field gnus-current-headers "from")))
59 (setq from (gnus-bbdb/extract-address-components
60 (gnus-bbdb/decode-field-body from 'From))))
61 (when (and (car (cdr from))
62 (string-match (bbdb-user-mail-names)
64 ;; if logged-in user sent this, use recipients.
65 (let ((to (mime-entity-fetch-field gnus-current-headers "to")))
68 (gnus-bbdb/extract-address-components
69 (gnus-bbdb/decode-field-body to 'To))))))
72 (bbdb-annotate-message-sender from t
73 (or (bbdb-invoke-hook-for-value
74 bbdb/news-auto-create-p)
79 (defun gnus-bbdb/annotate-sender (string &optional replace)
80 "Add a line to the end of the Notes field of the BBDB record
81 corresponding to the sender of this message. If REPLACE is non-nil,
82 replace the existing notes entry (if any)."
83 (interactive (list (if bbdb-readonly-p
84 (error "The Insidious Big Brother Database is read-only.")
85 (read-string "Comments: "))))
86 (bbdb-annotate-notes (gnus-bbdb/update-record t) string 'notes replace))
88 (defun gnus-bbdb/edit-notes (&optional arg)
89 "Edit the notes field or (with a prefix arg) a user-defined field
90 of the BBDB record corresponding to the sender of this message."
92 (let ((record (or (gnus-bbdb/update-record t) (error ""))))
93 (bbdb-display-records (list record))
95 (bbdb-record-edit-property record nil t)
96 (bbdb-record-edit-notes record t))))
99 (defun gnus-bbdb/show-sender ()
100 "Display the contents of the BBDB for the sender of this message.
101 This buffer will be in bbdb-mode, with associated keybindings."
103 (let ((record (gnus-bbdb/update-record t)))
105 (bbdb-display-records (list record))
106 (error "unperson"))))
109 (defun gnus-bbdb/pop-up-bbdb-buffer (&optional offer-to-create)
110 "Make the *BBDB* buffer be displayed along with the GNUS windows,
111 displaying the record corresponding to the sender of the current message."
112 (let* ((bbdb-gag-messages t)
113 (bbdb-electric-p nil)
115 (let (bbdb-use-pop-up)
116 (gnus-bbdb/update-record offer-to-create)))
118 (cond ((boundp 'bbdb-pop-up-display-layout)
119 (symbol-value 'bbdb-pop-up-display-layout))
120 ((boundp 'bbdb-pop-up-elided-display)
121 (symbol-value 'bbdb-pop-up-elided-display))))
122 (bbdb-elided-display bbdb-display-layout))
124 ;; display the bbdb buffer iff there is a record for this article.
127 (bbdb-pop-up-bbdb-buffer
129 (with-current-buffer (window-buffer w)
131 '(mime-view-mode gnus-article-mode)))))
132 (bbdb-display-records (list record)))
133 ((and (not bbdb-inside-electric-display)
134 (get-buffer-window bbdb-buffer-name))
135 (delete-other-windows)
136 (if (assq 'article gnus-buffer-configuration)
137 (gnus-configure-windows 'article)
138 (gnus-configure-windows 'SelectArticle))
139 (let ((w (get-buffer-window gnus-summary-buffer)))
140 (if w (select-window w))))))
144 (defun gnus-bbdb/split-mail (header-field bbdb-field
145 &optional regexp group)
146 "Mail split method for `nnmail-split-fancy'.
147 HEADER-FIELD is a regexp or list of regexps as mail header field name
148 for gathering mail addresses. If HEADER-FIELD is a string, then it's
149 used for just matching pattern. If HEADER-FIELD is a list of strings,
150 then these strings have priorities in the order.
152 BBDB-FIELD is field name of BBDB.
153 Optional argument REGEXP is regexp string for matching BBDB-FIELD value.
154 If REGEXP is nil or not specified, then all BBDB-FIELD value is matched.
156 If GROUP is nil or not specified, then BBDB-FIELD value is returned as
157 group name. If GROUP is a symbol `&', then list of all matching group's
158 BBDB-FIELD values is returned. Otherwise, GROUP is returned."
159 (if (listp header-field)
161 (gnus-bbdb/split-mail (mapconcat 'identity header-field "\\|")
162 bbdb-field regexp group)
164 (while (and header-field
165 (null (setq rest (gnus-bbdb/split-mail
166 (car header-field) bbdb-field
168 (setq header-field (cdr header-field)))
170 (let ((pat (concat "^\\(" header-field "\\):[ \t]"))
172 (goto-char (point-min))
173 (while (re-search-forward pat nil t)
174 (setq header-values (cons (buffer-substring (point)
177 (let ((address-regexp
181 (setq lal (std11-parse-addresses-string
182 (pop header-values)))
184 (gnus-bbdb/insert-address-regexp (pop lal)))))
186 (unless (zerop (length address-regexp))
187 (gnus-bbdb/split-mail-1 address-regexp bbdb-field regexp group))))))
189 (defun gnus-bbdb/insert-address-regexp (address)
190 "Insert string of address part from parsed ADDRESS of RFC 822."
191 (cond ((eq (car address) 'group)
192 (setq address (cdr address))
194 (gnus-bbdb/insert-address-regexp (pop address))))
195 ((eq (car address) 'mailbox)
196 (unless (eq (point) (point-min))
198 (let ((addr (nth 1 address)))
199 (insert (regexp-quote (std11-addr-to-string
200 (if (eq (car addr) 'phrase-route-addr)
204 (defun gnus-bbdb/split-mail-1 (address-regexp bbdb-field regexp group)
205 (let ((records (bbdb-search (bbdb-records) nil nil address-regexp))
207 (or regexp (setq regexp ""))
212 (when (and (setq prop (bbdb-record-getprop (car records) bbdb-field))
213 (string-match regexp prop)
214 (not (member prop rest)))
215 (setq rest (cons prop rest)))
216 (setq records (cdr records)))
217 (throw 'done (when rest (cons '& rest))))
220 (when (or (null bbdb-field)
221 (and (setq prop (bbdb-record-getprop (car records)
223 (string-match regexp prop)))
224 (throw 'done (or group prop)))
225 (setq records (cdr records))))))))
228 ;; Announcing BBDB entries in the summary buffer
231 (defcustom gnus-bbdb/lines-and-from-length 18
232 "*The number of characters used to display From: info in Gnus, if you have
233 set gnus-optional-headers to 'gnus-bbdb/lines-and-from."
234 :group 'bbdb-mua-specific-gnus
237 (defcustom gnus-bbdb/summary-mark-known-posters t
238 "*If t, mark messages created by people with records in the BBDB.
239 In GNUS, this marking will take place in the subject list (assuming
240 `gnus-optional-headers' contains `gnus-bbdb/lines-and-from'). In Gnus, the
241 marking will take place in the Summary buffer if the format code defined by
242 `gnus-bbdb/summary-user-format-letter' is used in `gnus-summary-line-format'.
243 This variable has no effect on the marking controlled by
244 `gnus-bbdb/summary-in-bbdb-format-letter'."
245 :group 'bbdb-mua-specific-gnus
246 :type '(choice (const :tag "Mark known posters" t)
247 (const :tag "Do not mark known posters" nil)))
248 (static-when (and (fboundp 'defvaralias)
249 (subrp (symbol-function 'defvaralias)))
250 (defvaralias 'gnus-bbdb/mark-known-posters
251 'gnus-bbdb/summary-mark-known-posters))
253 (defcustom gnus-bbdb/summary-known-poster-mark "+"
254 "This is the default character to prefix author names with if
255 gnus-bbdb/summary-mark-known-posters is t. If the poster's record has
256 an entry in the field named by bbdb-message-marker-field, then that will
258 :group 'bbdb-mua-specific-gnus
261 (defcustom gnus-bbdb/summary-show-bbdb-names t
262 "*If both this variable and `gnus-bbdb/summary-prefer-real-names' are true,
263 then for messages from authors who are in your database, the name
264 displayed will be the primary name in the database, rather than the
265 one in the From line of the message. This doesn't affect the names of
266 people who aren't in the database, of course. (`gnus-optional-headers'
267 must be `gnus-bbdb/lines-and-from' for GNUS users.)"
268 :group 'bbdb-mua-specific-gnus
270 (static-when (and (fboundp 'defvaralias)
271 (subrp (symbol-function 'defvaralias)))
272 (defvaralias 'gnus-bbdb/header-show-bbdb-names
273 'gnus-bbdb/summary-show-bbdb-names))
275 (defcustom gnus-bbdb/summary-prefer-bbdb-data t
276 "If t, then for posters who are in our BBDB, replace the information
277 provided in the From header with data from the BBDB."
278 :group 'bbdb-mua-specific-gnus
281 (defcustom gnus-bbdb/summary-prefer-real-names t
282 "If t, then display the poster's name from the BBDB if we have one,
283 otherwise display his/her primary net address if we have one. If it
284 is set to the symbol bbdb, then real names will be used from the BBDB
285 if present, otherwise the net address in the post will be used. If
286 gnus-bbdb/summary-prefer-bbdb-data is nil, then this has no effect.
287 See `gnus-bbdb/lines-and-from' for GNUS users, or
288 `gnus-bbdb/summary-user-format-letter' for Gnus users."
289 :group 'bbdb-mua-specific-gnus
290 :type '(choice (const :tag "Prefer real names" t)
291 (const :tag "Prefer network addresses" nil)))
292 (static-when (and (fboundp 'defvaralias)
293 (subrp (symbol-function 'defvaralias)))
294 (defvaralias 'gnus-bbdb/header-prefer-real-names
295 'gnus-bbdb/summary-prefer-real-names))
297 (defcustom gnus-bbdb/summary-user-format-letter "B"
298 "This is the gnus-user-format-function- that will be used to insert
299 the information from the BBDB in the summary buffer (using
300 `gnus-bbdb/summary-get-author'). This format code is meant to replace
301 codes that insert sender names or addresses (like %A or %n). Unless
302 you've alread got other code using user format B, you might as well
303 stick with the default. Additionally, if the value of this variable
304 is nil, no format function will be installed for
305 `gnus-bbdb/summary-get-author'. See also
306 `gnus-bbdb/summary-in-bbdb-format-letter', which installs a format
307 code for `gnus-bbdb/summary-author-in-bbdb'"
308 :group 'bbdb-mua-specific-gnus
311 (defcustom gnus-bbdb/summary-in-bbdb-format-letter "b"
312 "This is the gnus-user-format-function- that will be used to insert
313 `gnus-bbdb/summary-known-poster-mark' (using
314 `gnus-bbdb/summary-author-in-bbdb') if the poster is in the BBDB, and
315 \" \" if not. If the value of this variable is nil, no format code
316 will be installed for `gnus-bbdb/summary-author-in-bbdb'. See also
317 `gnus-bbdb/summary-user-format-letter', which installs a format code
318 for `gnus-bbdb/summary-get-author'."
319 :group 'bbdb-mua-specific-gnus
322 (defcustom bbdb-message-marker-field 'mark-char
323 "*The field whose value will be used to mark messages by this user in Gnus."
324 :group 'bbdb-mua-specific-gnus
328 (defun gnus-bbdb/lines-and-from (header)
329 "Useful as the value of gnus-optional-headers in *GNUS* (not Gnus).
330 NOTE: This variable no longer seems to be present in Gnus. It seems
331 to have been replaced by `message-default-headers', which only takes
332 strings. In the future this should change."
333 (let* ((length gnus-bbdb/lines-and-from-length)
334 (lines (mail-header-lines header))
335 (from (mail-header-from header))
336 (data (and (or gnus-bbdb/summary-mark-known-posters
337 gnus-bbdb/summary-show-bbdb-names)
339 (gnus-bbdb/extract-address-components from)
342 (net (car (cdr data)))
344 (bbdb-search-simple name
345 (if (and net bbdb-canonicalize-net-hook)
346 (bbdb-canonicalize-address net)
350 (if (and record name (member (downcase name) (bbdb-record-net record)))
355 (or (and gnus-bbdb/summary-prefer-bbdb-data
356 (or (and gnus-bbdb/summary-prefer-real-names
357 (and record (bbdb-record-name record)))
358 (and record (bbdb-record-net record)
359 (nth 0 (bbdb-record-net record)))))
360 (and gnus-bbdb/summary-prefer-real-names
361 (or (and (equal gnus-bbdb/summary-prefer-real-names 'bbdb)
364 net from "**UNKNOWN**"))
365 ;; GNUS can't cope with extra square-brackets appearing in the summary.
366 (if (and name (string-match "[][]" name))
367 (progn (setq name (copy-sequence name))
368 (while (string-match "[][]" name)
369 (aset name (match-beginning 0) ? ))))
370 (setq string (format "%s%3d:%s"
371 (if (and record gnus-bbdb/summary-mark-known-posters)
372 (or (bbdb-record-getprop
373 record bbdb-message-marker-field)
376 lines (or name from))
378 (cond ((> L length) (substring string 0 length))
379 ((< L length) (concat string (make-string (- length L) ? )))
382 (defun gnus-bbdb/summary-get-author (header)
383 "Given a Gnus message header, returns the appropriate piece of
384 information to identify the author in a Gnus summary line, depending on
385 the settings of the various configuration variables. See the
386 documentation for the following variables for more details:
387 `gnus-bbdb/summary-mark-known-posters'
388 `gnus-bbdb/summary-known-poster-mark'
389 `gnus-bbdb/summary-prefer-bbdb-data'
390 `gnus-bbdb/summary-prefer-real-names'
391 This function is meant to be used with the user function defined in
392 `gnus-bbdb/summary-user-format-letter'"
393 (let* ((from (mail-header-from header))
394 (data (and gnus-bbdb/summary-show-bbdb-names
396 (gnus-bbdb/extract-address-components from)
399 (net (car (cdr data)))
401 (bbdb-search-simple name
402 (if (and net bbdb-canonicalize-net-hook)
403 (bbdb-canonicalize-address net)
405 (if (and record name (member (downcase name) (bbdb-record-net record)))
409 (or (and gnus-bbdb/summary-prefer-bbdb-data
410 (or (and gnus-bbdb/summary-prefer-real-names
411 (and record (bbdb-record-name record)))
412 (and record (bbdb-record-net record)
413 (nth 0 (bbdb-record-net record)))))
414 (and gnus-bbdb/summary-prefer-real-names
415 (or (and (equal gnus-bbdb/summary-prefer-real-names 'bbdb)
418 net from "**UNKNOWN**"))
420 (or (and record gnus-bbdb/summary-mark-known-posters
421 (or (bbdb-record-getprop
422 record bbdb-message-marker-field)
423 gnus-bbdb/summary-known-poster-mark))
427 ;; DEBUG: (gnus-bbdb/summary-author-in-bbdb "From: simmonmt@acm.org")
428 (defun gnus-bbdb/summary-author-in-bbdb (header)
429 "Given a Gnus message header, returns a mark if the poster is in the BBDB, \" \" otherwise. The mark itself is the value of the field indicated by `bbdb-message-marker-field' (`mark-char' by default) if the indicated field is in the poster's record, and `gnus-bbdb/summary-known-poster-mark' otherwise."
430 (let* ((from (mail-header-from header))
431 (data (condition-case ()
432 (gnus-bbdb/extract-address-components from)
440 name (if (and net bbdb-canonicalize-net-hook)
441 (bbdb-canonicalize-address net)
443 (or (bbdb-record-getprop
444 record bbdb-message-marker-field)
445 gnus-bbdb/summary-known-poster-mark) " ")))
451 (defcustom gnus-bbdb/score-field 'gnus-score
452 "This variable contains the name of the BBDB field which should be
453 checked for a score to add to the net addresses in the same record."
454 :group 'bbdb-mua-specific-gnus-scoring
457 (defcustom gnus-bbdb/score-default nil
458 "If this is set, then every net address in the BBDB that does not have
459 an associated score field will be assigned this score. A value of nil
460 implies a default score of zero."
461 :group 'bbdb-mua-specific-gnus-scoring
462 :type '(choice (const :tag "Do not assign default score")
463 (integer :tag "Assign this default score" 0)))
465 (defvar gnus-bbdb/score-default-internal nil
466 "Internal variable for detecting changes to
467 `gnus-bbdb/score-default'. You should not set this variable directly -
468 set `gnus-bbdb/score-default' instead.")
470 (defvar gnus-bbdb/score-alist nil
471 "The text version of the scoring structure returned by
472 gnus-bbdb/score. This is built automatically from the BBDB.")
474 (defvar gnus-bbdb/score-rebuild-alist t
475 "Set to t to rebuild gnus-bbdb/score-alist on the next call to
476 gnus-bbdb/score. This will be set automatically if you change a BBDB
477 record which contains a gnus-score field.")
479 (defun gnus-bbdb/score-invalidate-alist (rec)
480 "This function is called through bbdb-after-change-hook, and sets
481 gnus-bbdb/score-rebuild-alist to t if the changed record contains a
483 (if (bbdb-record-getprop rec gnus-bbdb/score-field)
484 (setq gnus-bbdb/score-rebuild-alist t)))
487 (defun gnus-bbdb/score (group)
488 "This returns a score alist for GNUS. A score pair will be made for
489 every member of the net field in records which also have a gnus-score
490 field. This allows the BBDB to serve as a supplemental global score
491 file, with the advantage that it can keep up with multiple and changing
492 addresses better than the traditionally static global scorefile."
495 (read (gnus-bbdb/score-as-text group))
496 (error (setq gnus-bbdb/score-rebuild-alist t)
497 (message "Problem building BBDB score table.")
501 (defun gnus-bbdb/score-as-text (group)
502 "Returns a SCORE file format string built from the BBDB."
503 (cond ((or (cond ((/= (or gnus-bbdb/score-default 0)
504 (or gnus-bbdb/score-default-internal 0))
505 (setq gnus-bbdb/score-default-internal
506 gnus-bbdb/score-default)
508 (not gnus-bbdb/score-alist)
509 gnus-bbdb/score-rebuild-alist)
510 (setq gnus-bbdb/score-rebuild-alist nil)
511 (setq gnus-bbdb/score-alist
512 (concat "((touched nil) (\"from\"\n"
515 (let ((score (or (bbdb-record-getprop rec
516 gnus-bbdb/score-field)
517 gnus-bbdb/score-default))
518 (net (bbdb-record-net rec)))
519 (if (not (and score net)) nil
522 (concat "(\"" addr "\" " score ")\n"))
526 gnus-bbdb/score-alist)
528 (defun gnus-bbdb/extract-field-value-init ()
529 (function gnus-bbdb/extract-field-value))
531 (defun gnus-bbdb/extract-field-value (field-name)
532 "Given the name of a field (like \"Subject\") this returns the value of
533 that field in the current message, or nil. This works whether you're in
534 Semi-gnus, Rmail, or VM. This works on multi-line fields, but if more than
535 one field of the same name is present, only the last is returned. It is
536 expected that the current buffer has a message in it, and (point) is at the
537 beginning of the message headers."
538 ;; we can't special-case VM here to use its cache, because the cache has
539 ;; divided real-names from addresses; the actual From: and Subject: fields
540 ;; exist only in the message.
542 (when (setq value (mime-entity-fetch-field
543 gnus-current-headers field-name))
544 (gnus-bbdb/decode-field-body value field-name))))
549 (defvar gnus-bbdb/canonicalize-full-name-methods
550 '(gnus-bbdb/canonicalize-dots
551 gnus-bbdb/canonicalize-spaces))
553 (defun gnus-bbdb/extract-address-components (str)
554 (let* ((ret (std11-extract-address-components str))
556 (address (car (cdr ret)))
557 (methods gnus-bbdb/canonicalize-full-name-methods))
558 (while (and phrase methods)
559 (setq phrase (funcall (car methods) phrase)
560 methods (cdr methods)))
561 (if (string= address "") (setq address nil))
562 (if (string= phrase "") (setq phrase nil))
563 (when (or phrase address)
564 (list phrase address))))
566 ;;; @ full-name canonicalization methods
569 (defun gnus-bbdb/canonicalize-spaces (str)
571 (while (string-match "\\s +" str)
572 (setq dest (cons (substring str 0 (match-beginning 0)) dest))
573 (setq str (substring str (match-end 0))))
575 (setq dest (cons str dest)))
576 (setq dest (nreverse dest))
577 (mapconcat 'identity dest " ")))
579 (defun gnus-bbdb/canonicalize-dots (str)
581 (while (string-match "\\." str)
582 (setq dest (cons (substring str 0 (match-end 0)) dest))
583 (setq str (substring str (match-end 0))))
585 (setq dest (cons str dest)))
586 (setq dest (nreverse dest))
587 (mapconcat 'identity dest " ")))
594 (defun gnus-bbdb-insinuate ()
595 "Call this function to hook BBDB into Semi-gnus."
596 ;; (setq gnus-optional-headers 'gnus-bbdb/lines-and-from)
597 (when (boundp 'bbdb-extract-field-value-function-list)
598 (add-to-list 'bbdb-extract-field-value-function-list
599 'gnus-bbdb/extract-field-value-init))
600 (add-hook 'gnus-article-prepare-hook 'gnus-bbdb/update-record)
601 (add-hook 'gnus-save-newsrc-hook 'bbdb-offer-save)
602 (define-key gnus-summary-mode-map ":" 'gnus-bbdb/show-sender)
603 (define-key gnus-summary-mode-map ";" 'gnus-bbdb/edit-notes)
605 ;; Set up user field for use in gnus-summary-line-format
606 (let ((get-author-user-fun (intern
607 (concat "gnus-user-format-function-"
608 gnus-bbdb/summary-user-format-letter)))
609 (in-bbdb-user-fun (intern
610 (concat "gnus-user-format-function-"
611 gnus-bbdb/summary-in-bbdb-format-letter))))
612 ; The big one - whole name
613 (cond (gnus-bbdb/summary-user-format-letter
614 (if (and (fboundp get-author-user-fun)
615 (not (eq (symbol-function get-author-user-fun)
616 'gnus-bbdb/summary-get-author)))
618 (format "`gnus-user-format-function-%s' already seems to be in use.
619 Please redefine `gnus-bbdb/summary-user-format-letter' to a different letter."
620 gnus-bbdb/summary-user-format-letter))
621 (fset get-author-user-fun 'gnus-bbdb/summary-get-author))))
623 ; One tick. One tick only, please
624 (cond (gnus-bbdb/summary-in-bbdb-format-letter
625 (if (and (fboundp in-bbdb-user-fun)
626 (not (eq (symbol-function in-bbdb-user-fun)
627 'gnus-bbdb/summary-author-in-bbdb)))
629 (format "`gnus-user-format-function-%s' already seems to be in use.
630 Redefine `gnus-bbdb/summary-in-bbdb-format-letter' to a different letter."
631 gnus-bbdb/summary-in-bbdb-format-letter))
632 (fset in-bbdb-user-fun 'gnus-bbdb/summary-author-in-bbdb)))))
635 (add-hook 'bbdb-after-change-hook 'gnus-bbdb/score-invalidate-alist)
636 ; (setq gnus-score-find-score-files-function
637 ; (if (boundp 'gnus-score-find-score-files-function)
638 ; (cond ((functionp gnus-score-find-score-files-function)
639 ; (list gnus-score-find-score-files-function
641 ; ((listp gnus-score-find-score-files-function)
642 ; (append gnus-score-find-score-files-function
644 ; (t 'gnus-bbdb/score))
649 (defun gnus-bbdb-insinuate-message ()
650 "Call this function to hook BBDB into message-mode."
651 (define-key message-mode-map "\M-\t" 'bbdb-complete-name))