Fix.
[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-2.33/lisp/bbdb-com.el~ Sat Mar 24 08:00:29 2001
47 +++ bbdb-2.33/lisp/bbdb-com.el  Mon Sep 10 22:48:15 2001
48 @@ -1625,7 +1625,7 @@
49            ;; to be enclosed in quotes.  Double-quotes and backslashes have
50            ;; already been escaped.  This quotes a few extra characters as
51            ;; well (!,%, and $) just for common sense.
52 -          ((string-match "[][\000-\037\177()<>@,;:.!$%]" name)
53 +         ((string-match "[][\000-\037\177<>@,;.!$%]" name)
54             (format "\"%s\" <%s>" name net))
55            (t
56             (format "%s <%s>" name net)))))
57 --- bbdb-2.33/lisp/bbdb-hooks.el~       Tue Mar 20 08:00:09 2001
58 +++ bbdb-2.33/lisp/bbdb-hooks.el        Mon Sep 10 22:48:15 2001
59 @@ -35,6 +35,8 @@
60  ;; $Id: README-gnus-bbdb.en,v 1.1.2.5.12.5 2001-09-10 22:51:50 yamaoka Exp $
61  ;;
62  
63 +(eval-when-compile (require 'cl))
64 +
65  (require 'bbdb)
66  
67  (defmacro the-v18-byte-compiler-sucks-wet-farts-from-dead-pigeons ()
68 @@ -367,14 +369,24 @@
69           (marker (bbdb-header-start))
70           field pairs fieldval  ; do all bindings here for speed
71           regexp string notes-field-name notes
72 -         replace-p replace-or-add-msg)
73 +         replace-p replace-or-add-msg extract-field-value-funtion)
74      (set-buffer (marker-buffer marker))
75      (save-restriction
76 -      (widen)
77 -      (goto-char marker)
78 -      (if (and (setq fieldval (bbdb-extract-field-value "From"))
79 -               (string-match (bbdb-user-mail-names) fieldval))
80 -          ;; Don't do anything if this message is from us.  Note that we have
81 +      (let ((function-list bbdb-extract-field-value-function-list)
82 +           function)
83 +       (or (progn
84 +             (while (and (not extract-field-value-funtion)
85 +                         (setq function (car function-list)))
86 +               (setq extract-field-value-funtion (funcall function)
87 +                     function-list (cdr function-list)))
88 +             extract-field-value-funtion)
89 +           (progn
90 +             (widen)
91 +             (goto-char marker)
92 +             (setq extract-field-value-funtion 'bbdb-extract-field-value))))
93 +      (if (and (setq fieldval (funcall extract-field-value-funtion "From"))
94 +              (string-match (bbdb-user-mail-names) fieldval))
95 +         ;; Don't do anything if this message is from us.  Note that we have
96            ;; to look at the message instead of the record, because the record
97            ;; will be of the recipient of the message if it is from us.
98            nil
99 @@ -383,7 +395,7 @@
100            (goto-char marker)
101            (setq field (car (car ignore-all))
102                  regexp (cdr (car ignore-all))
103 -                fieldval (bbdb-extract-field-value field))
104 +                fieldval (funcall extract-field-value-funtion field))
105            (if (and fieldval
106                     (string-match regexp fieldval))
107                (setq ignore t)
108 @@ -396,7 +408,8 @@
109                  pairs (cdr (car rest))  ; (REGEXP . STRING) or
110                                          ; (REGEXP FIELD-NAME STRING) or
111                                          ; (REGEXP FIELD-NAME STRING REPLACE-P)
112 -                fieldval (bbdb-extract-field-value field)) ; e.g., Subject line
113 +                fieldval (funcall extract-field-value-funtion field))
114 +                                        ; e.g., Subject line
115            (when fieldval
116              (while pairs
117                (setq regexp (car (car pairs))
118 --- bbdb-2.33/lisp/bbdb.el~     Tue Mar 27 08:00:31 2001
119 +++ bbdb-2.33/lisp/bbdb.el      Mon Sep 10 22:48:15 2001
120 @@ -709,6 +709,7 @@
121  (defvar bbdb-showing-changed-ones nil)
122  (defvar bbdb-modified-p nil)
123  (defvar bbdb-elided-display nil)
124 +(defvar bbdb-extract-field-value-function-list nil)
125  
126  (defvar bbdb-debug t)
127  (defmacro bbdb-debug (&rest body)
128 ------ cut here ------ cut here ------ cut here ------ cut here ------
129
130 ---