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