Update.
[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  If you would like to decode the quoted encoded words forcibly, even
37 though FLIM does not decode them, put the following lines in your
38 .gnus file.
39
40 (setq gnus-bbeb/decode-field-body-function
41       (function
42        (lambda (field-body field-name)
43          (eword-decode-string field-body))))
44
45 ---
46  This is a patch for bbdb.el / bbdb-hooks.el.
47
48 ------ cut here ------ cut here ------ cut here ------ cut here ------
49 --- bbdb-hooks.el~      Tue Oct 13 03:13:50 1998
50 +++ bbdb-hooks.el       Fri Oct 30 17:05:53 1998
51 @@ -352,12 +352,22 @@
52         (marker (bbdb-header-start))
53         field pairs fieldval  ; do all bindings here for speed
54         regexp string notes-field-name notes
55 -        replace-p replace-or-add-msg)
56 +       replace-p replace-or-add-msg
57 +       extract-field-value-funtion)
58      (set-buffer (marker-buffer marker))
59      (save-restriction
60 -      (widen)
61 -      (goto-char marker)
62 -      (if (and (setq fieldval (bbdb-extract-field-value "From"))
63 +      (let ((function-list bbdb-extract-field-value-function-list)
64 +           function)
65 +       (or (progn
66 +             (while (and (not extract-field-value-funtion)
67 +                         (setq function (pop function-list)))
68 +               (setq extract-field-value-funtion (funcall function)))
69 +             extract-field-value-funtion)
70 +           (progn
71 +             (widen)
72 +             (goto-char marker)
73 +             (setq extract-field-value-funtion 'bbdb-extract-field-value))))
74 +      (if (and (setq fieldval (funcall extract-field-value-funtion "From"))
75                (string-match (bbdb-user-mail-names) fieldval))
76           ;; Don't do anything if this message is from us.  Note that we have
77           ;; to look at the message instead of the record, because the record
78 @@ -368,7 +378,7 @@
79           (goto-char marker)
80           (setq field (car (car ignore-all))
81                 regexp (cdr (car ignore-all))
82 -               fieldval (bbdb-extract-field-value field))
83 +               fieldval (funcall extract-field-value-funtion field))
84           (if (and fieldval
85                    (string-match regexp fieldval))
86               (setq ignore t)
87 @@ -382,7 +392,7 @@
88                 pairs (cdr (car rest))  ; (REGEXP . STRING) or
89                                         ; (REGEXP FIELD-NAME STRING) or
90                                         ; (REGEXP FIELD-NAME STRING REPLACE-P)
91 -               fieldval (bbdb-extract-field-value field)) ; e.g., Subject line
92 +               fieldval (funcall extract-field-value-funtion field)) ; e.g., Subject line
93           (if fieldval
94               (while pairs
95                 (setq regexp (car (car pairs))
96 --- bbdb.el~    Tue Oct 13 03:14:55 1998
97 +++ bbdb.el     Fri Oct 30 17:05:53 1998
98 @@ -620,6 +620,7 @@
99  (defvar bbdb-showing-changed-ones nil)
100  (defvar bbdb-modified-p nil)
101  (defvar bbdb-elided-display nil)
102 +(defvar bbdb-extract-field-value-function-list nil)
103  
104  (defvar bbdb-debug t)
105  (defmacro bbdb-debug (&rest body)
106 ------ cut here ------ cut here ------ cut here ------ cut here ------
107
108 ---