Synch with Gnus.
[elisp/gnus.git-] / README-gnus-bbdb.en
1 -*- mode: text; fill-column: 70; -*-
2
3 ---
4  If BBDB is used then, bbdb-gnus.elc can't be shared with them before
5 Semi-gnus 6.8.X. It is necessary to byte-compile it again.
6
7 ;; It is a simple way that only bbdb-gnus.el is byte-compiled after
8 ;; gnus starts.
9
10 ---
11 gnus-bbdb.el
12
13  This is the BBDB API module for Semi-gnus. `mime-bbdb' should not be
14 necessary for Semi-gnus, if that module were used.
15
16  You need FLIM 1.11.3 or later.
17
18  If you are using bbdb-auto-notes-hook, the patch listed at the end
19 of this file should be applied. If not, it might not.
20
21  EXAMPLE:
22
23 ;; You need to set nothing for `mime-bbdb'.
24 ;(setq mime-bbdb/use-mail-extr nil)
25 ;(eval-after-load "mail-extr" '(require 'mime-bbdb))
26
27 (require 'bbdb)
28 (require 'gnus-bbdb)
29 (bbdb-initialize 'sc)  ;; 'Gnus or 'gnus should be deleted.
30 (add-hook 'gnus-startup-hook 'gnus-bbdb-insinuate)
31 (add-hook 'message-setup-hook 'gnus-bbdb-insinuate-message)
32
33  If you would like to decode the quoted encoded words forcibly, even
34 though FLIM does not decode them, put the following lines in your
35 .gnus file.
36
37 (setq gnus-bbdb/decode-field-body-function
38       (function
39        (lambda (field-body field-name)
40          (eword-decode-string field-body))))
41
42 ---
43  This is a patch for bbdb.el / bbdb-hooks.el.
44
45 ------ cut here ------ cut here ------ cut here ------ cut here ------
46 --- bbdb-hooks.el~      Tue Oct 13 03:13:50 1998
47 +++ bbdb-hooks.el       Fri Oct 30 17:05:53 1998
48 @@ -352,12 +352,23 @@
49         (marker (bbdb-header-start))
50         field pairs fieldval  ; do all bindings here for speed
51         regexp string notes-field-name notes
52 -        replace-p replace-or-add-msg)
53 +       replace-p replace-or-add-msg
54 +       extract-field-value-funtion)
55      (set-buffer (marker-buffer marker))
56      (save-restriction
57 -      (widen)
58 -      (goto-char marker)
59 -      (if (and (setq fieldval (bbdb-extract-field-value "From"))
60 +      (let ((function-list bbdb-extract-field-value-function-list)
61 +           function)
62 +       (or (progn
63 +             (while (and (not extract-field-value-funtion)
64 +                         (setq function (car function-list)))
65 +               (setq extract-field-value-funtion (funcall function)))
66 +                     function-list (cdr function-list)))
67 +             extract-field-value-funtion)
68 +           (progn
69 +             (widen)
70 +             (goto-char marker)
71 +             (setq extract-field-value-funtion 'bbdb-extract-field-value))))
72 +      (if (and (setq fieldval (funcall extract-field-value-funtion "From"))
73                (string-match (bbdb-user-mail-names) fieldval))
74           ;; Don't do anything if this message is from us.  Note that we have
75           ;; to look at the message instead of the record, because the record
76 @@ -368,7 +378,7 @@
77           (goto-char marker)
78           (setq field (car (car ignore-all))
79                 regexp (cdr (car ignore-all))
80 -               fieldval (bbdb-extract-field-value field))
81 +               fieldval (funcall extract-field-value-funtion field))
82           (if (and fieldval
83                    (string-match regexp fieldval))
84               (setq ignore t)
85 @@ -382,7 +392,7 @@
86                 pairs (cdr (car rest))  ; (REGEXP . STRING) or
87                                         ; (REGEXP FIELD-NAME STRING) or
88                                         ; (REGEXP FIELD-NAME STRING REPLACE-P)
89 -               fieldval (bbdb-extract-field-value field)) ; e.g., Subject line
90 +               fieldval (funcall extract-field-value-funtion field)) ; e.g., Subject line
91           (if fieldval
92               (while pairs
93                 (setq regexp (car (car pairs))
94 --- bbdb.el~    Tue Oct 13 03:14:55 1998
95 +++ bbdb.el     Fri Oct 30 17:05:53 1998
96 @@ -620,6 +620,7 @@
97  (defvar bbdb-showing-changed-ones nil)
98  (defvar bbdb-modified-p nil)
99  (defvar bbdb-elided-display nil)
100 +(defvar bbdb-extract-field-value-function-list nil)
101  
102  (defvar bbdb-debug t)
103  (defmacro bbdb-debug (&rest body)
104 ------ cut here ------ cut here ------ cut here ------ cut here ------
105
106 ---