EasyPG 1.07 Released
[packages] / xemacs-packages / bbdb / texinfo / bbdb.texinfo
1 \input texinfo  @c -*-texinfo-*-  -*- coding: iso-latin-1 -*-
2 @c %**start of header
3 @documentencoding ISO-8859-1
4 @setfilename bbdb.info
5 @settitle Insidious Big Brother Database User Manual
6 @c %**end of header
7
8 @c
9 @c $Id: bbdb.texinfo,v 1.9 2005-07-24 15:23:05 waider Exp $
10 @c
11
12 @ifnottex
13 @dircategory Emacs
14 @direntry
15 * BBDB: (bbdb).             The Insidious Big Brother Database.
16 @end direntry
17
18 This file documents the Insidious Big Brother Database
19
20 This is edition $Revision: 1.9 $ of the BBDB User Manual for BBDB
21 version 2.34.
22
23 Copyright (c) 1991-1994 Jamie Zawinski <jwz@@netscape.com>
24
25 Copyright (c) 1997-1999 Matt Simmons <simmonmt@@acm.org>
26
27 Copyright (c) 2000-present The BBDB Development Team
28 @end ifnottex
29
30 @titlepage
31 @title BBDB User Manual
32 @subtitle A phone number and address database program for Emacs
33 @subtitle Edition $Revision: 1.9 $, $Date: 2005-07-24 15:23:05 $
34
35 @author by Jamie Zawinski, Matt Simmons and the BBDB Development Team
36 @page
37 Copyright @copyright{} 1991-1994 Jamie Zawinski <jwz@@netscape.com>
38
39 Copyright @copyright{} 1997-1999 Matt Simmons <simmonmt@@acm.org>
40
41 Copyright @copyright{} 2000-present The BBDB Development Team
42
43 @sp 2
44 This is edition $Revision: 1.9 $ of the @cite{BBDB User Manual} for BBDB
45 version 2.34, $Date: 2005-07-24 15:23:05 $.@refill
46
47 @sp 2
48
49 Permission is granted to make and distribute verbatim copies of this
50 manual provided the copyright notice and this permission notice are
51 preserved on fnord all copies.
52
53 Permission is granted to copy and distribute modified versions of
54 this manual under the conditions for verbatim copying, provided that
55 the entire resulting derived work is distributed under the terms of a
56 permission notice identical to this one.
57
58 Permission is granted to copy and distribute translations of this
59 manual into another language, under the above conditions for modified
60 versions, except that this permission notice may be stated in a
61 translation approved by the author.
62
63 @end titlepage
64 @page
65
66 @node Top, Installation,,_
67 @chapter BBDB
68
69 @b{BBDB} is a rolodex-like database program for GNU Emacs.  @b{BBDB} stands
70 for @b{@i{Insidious Big Brother Database}}, and is not, repeat, @emph{not} an
71 obscure reference to the Buck Rogers TV series.
72
73 It provides the following features:
74
75 @itemize @bullet
76 @item
77 Integration with mail and news readers, with little or no
78 interaction by the user: @refill
79
80 @itemize @bullet
81 @item
82 easy (or automatic) display of the record corresponding to the sender of
83 the current message; @refill
84
85 @item
86 automatic creation of records based on the contents of the current
87 message; @refill
88
89 @item
90 automatic addition of data to arbitrary fields of the record
91 corresponding to the sender of the current message. @refill
92 @end itemize
93
94 @item
95 Listing all records which match a regular expression;
96
97 @item
98 Listing all records which match a regular expression in a particular
99 field (@samp{company} or @samp{notes,} for example); @refill
100 @end itemize
101
102 @menu
103 * Installation::                Installation
104 * The BBDB::                    Overview
105 * BBDB Mode::                   BBDB Mode
106 * Interfaces::                  Interfaces to various readers
107 * Reader-specific Features::    Features only available to specific readers
108 * Other Packages::              Using the BBDB with other packages
109 * Options::                     Options
110 * Utilities::                   Utilities
111 * Internals::                   BBDB Internals
112 * Mailing Lists::               The BBDB mailing lists
113 * Changes::                     New in this version
114 * The Latest Version::          Where to Get It
115 * The Future::                  Known Bugs, the TODO list and EOL statements
116 * Thanks::                      to the Ministry of Bugs
117
118 * Concept Index::               Concept Index
119 * Variable Index::              Variable Index
120
121 @detailmenu
122  --- The Detailed Node Listing ---
123
124 Installation
125
126 * General Prerequisites::       General @b{BBDB} requirements
127
128 File Installation
129 * Normal User::                 "Normal" Installations
130 * XEmacs Package::              Installing as an XEmacs package
131
132 Initial Configuration
133 * Initial Configuration::       How to initially set up the @b{BBDB}
134
135 Manual initialization
136
137 * Gnus Prep::           Initializing @b{BBDB} support for Gnus
138 * MH-E Prep::           Initializing @b{BBDB} support for MH-E
139 * RMAIL Prep::          Initializing @b{BBDB} support for RMAIL
140 * Sendmail Prep::       Initializing @b{BBDB} support for Sendmail
141 * VM Prep::             Initializing @b{BBDB} support for VM
142
143 Other packages:
144
145 * Message Prep::        Initializing @b{BBDB} support for Message mode
146 * Reportmail Prep::     Initializing @b{BBDB} support for Reportmail
147 * Supercite Prep::      Initializing @b{BBDB} support for Supercite
148 * Web Browser Prep::    Initializing @b{BBDB} support for Web Browsers
149
150 The @b{BBDB}
151
152 * Database Fields::             Description of database fields
153 * Basic Searching::             Basic database searching commands
154 * Advanced Searching::          Advanced database searching commands
155 * Manual Record Addition::      Adding records by hand
156
157 Interfaces
158
159 * Mail Reading Interfaces::             Mail Reading Interfaces
160 * News Reading Interfaces::             News Reading Interfaces
161 * Mail Sending Interfaces::             Mail Sending Interfaces
162
163 Reader-specific Features
164
165 * Gnus Features::                       Gnus-specific Features
166 * VM Features::                         VM-specific Features
167
168 Gnus-specific Features
169
170 * Gnus Scoring::                        Store score adjustments in the @b{BBDB}
171 * Gnus Summary Buffer::                 @b{BBDB} information in the Summary buffer
172 * GNUS Subject List::                   @b{BBDB} information in the Subject List
173
174 VM-specific features
175
176 * VM Message Summary::                  @b{BBDB} information in message summary
177
178 Using the @b{BBDB} with other packages
179
180 * Using Message Mode::          Using the @b{BBDB} with Message Mode
181 * Using Reportmail::            Using the @b{BBDB} with Reportmail
182 * Using Supercite::             Using the @b{BBDB} with Supercite
183 * Using Web Browsers::          Using the @b{BBDB} with Web Browsers
184
185 Options
186
187 * Customization Parameters::    Customization Parameters
188 * Customization Hooks::         Customization Hooks
189 * Predefined Hooks::            Predefined Hooks
190
191 Utilities
192
193 * bbdb-ftp::                    Storing FTP sites in the @b{BBDB}
194 * bbdb-print::                  Print the @b{BBDB}
195 * bbdb-snarf::                  Record generation from raw text
196 * bbdb-srv::                    External control of the @b{BBDB}
197
198 Changes in this Version
199
200 * Major Changes::                Major changes in this version
201 * Other Changes::                Not-so-major changes
202
203 The Future
204
205 * Known Bugs::          Known Bugs, and how to submit new ones
206 * TODO List::           The TODO List
207 * EOL Statements::      EOL (End Of Life) Statements
208
209 _
210
211 * Top::
212
213 @end detailmenu
214 @end menu
215
216 @node Installation, The BBDB, Top, Top
217 @section Installation
218 @cindex Installation
219 @cindex Makefile
220
221 This program consists of several groups of files, organized by
222 directory:
223
224 @ifnottex
225 @example
226      lisp     - the main program code for the @b{BBDB}
227      tex      - TeX support files for @xref{bbdb-print}, the @b{BBDB}
228                 printing utility
229      texinfo  - the documentation files for the @b{BBDB}
230      utils    - miscellaneous external utility programs
231      misc     - things that don't fall into the above categories
232      bits     - things that have been written as add-ons for @b{BBDB}
233                 but have not yet been merged with the main codebase
234 @end example
235 @end ifnottex
236 @iftex
237 @bgroup@tableindent=1.5in
238 @table @b
239 @item lisp
240 the main program code for the BBDB
241 @item tex
242 @TeX@ support files for bbdb-print, the BBDB printing utility
243 @item texinfo
244 the documentation files for the BBDB
245 @item utils
246 miscellaneous external utility programs
247 @item bits
248 things that have been written as add-ons for @b{BBDB} but have not yet
249 been merged with the main codebase
250 @end table
251 @egroup
252 @end iftex
253
254 @menu
255 * General Prerequisites::       General @b{BBDB} requirements
256
257 File Installation
258 * Normal User::                 "Normal" Installations
259 * XEmacs Package::              Installing as an XEmacs package
260
261 Initial Configuration
262 * Initial Configuration::       How to initially set up the @b{BBDB}
263 @end menu
264
265 @node General Prerequisites, Normal User, Installation, Installation
266 @subsection General Prerequisites
267
268 Various parts of the @b{BBDB} require extra packages to be available
269 that are not part of the @b{BBDB} distribution.  Please note that with
270 one exception no extra packages (beyond those which ship with both GNU
271 Emacs and XEmacs) are required for the use of @b{BBDB} core
272 functionality.@footnote{"Core Functionality" is defined as the parts of
273 the @b{BBDB} used to implement basic record creation (@samp{M-x
274 bbdb-create}) and searching (@samp{M-x bbdb}).}  This one exception
275 applies to XEmacs 20.5 users - the @code{xemacs-base} package must be
276 installed for the correct operation of the core @b{BBDB} functionality.
277 The table below lists the requirements of the various portions of the
278 @b{BBDB}.  Please note that the absence of any of the below optional
279 packages will not affect core @b{BBDB} functionality.
280
281 @multitable {bbdb-reportmail } {Package needed} {GNU 19.34} {GNU 20.2} {XEmacs} {XEmacs}
282 @item @* BBDB file
283 @tab @* Package needed
284 @tab @* GNU 19.34
285 @tab @* GNU 20.2
286 @tab XEmacs@* @center >=20.4
287 @tab XEmacs@* @center 20.5
288
289 @item @code{bbdb-ftp}
290 @tab EFS or @* Ange-FTP
291 @tab @center B
292 @tab @center B
293 @tab @center B
294 @tab @center P
295
296 @item @code{bbdb-gnus}
297 @tab Gnus[1]
298 @tab @center B
299 @tab @center B
300 @tab @center B
301 @tab @center P
302
303 @item @code{bbdb-mhe}
304 @tab MH-E
305 @tab @center B
306 @tab @center B
307 @tab @center B
308 @tab @center P
309
310 @item @code{bbdb-reportmail}
311 @tab Reportmail
312 @tab
313 @tab
314 @tab @center B
315 @tab @center P[2]
316
317 @item @code{bbdb-sc}
318 @tab Supercite
319 @tab @center B
320 @tab
321 @tab @center B
322 @tab @center P
323
324 @item @code{bbdb-srv}
325 @tab @code{gnuserv} and @* @code{itimer}
326 @tab
327 @tab
328 @tab @center B
329 @tab @center B
330
331 @item @code{bbdb-vm}
332 @tab VM[4]
333 @tab
334 @tab
335 @tab @center B
336 @tab @center P
337
338 @item @code{bbdb-w3}
339 @tab @code{browse-url}
340 @tab @center B
341 @tab @center B
342 @tab @center B
343 @tab @center P[3]
344 @end multitable
345
346 @* 
347 @noindent
348 @b{NOTES:}
349 @enumerate
350 @item 
351 The old GNUS mail/newsreader should still work.  Please keep in mind
352 that you have a relatively recent Emacs (GNU 19.34 or later, XEmacs
353 19.15 or later), you are probably using Gnus. 
354 @item
355 As of this writing, Reportmail is available as
356 part of the @code{edit-utils} package.
357 @item
358 As of this writing, @code{browse-url} is
359 available as part of the @code{mail-lib} package.
360 @item
361 The source release of VM is currently required due to the use of macros
362 from the VM codebase in @b{BBDB}'s VM integration.
363 @end enumerate
364
365 Please also note that the XEmacs package locations are as of this
366 writing.  As the XEmacs 20.5 package system is still in development, the
367 locations may change without warning.
368
369 @node Normal User, XEmacs Package, General Prerequisites, Installation
370 @subsection Normal User Installation
371 @cindex Normal User Installation
372
373 @subheading Configuring the compilation process
374
375 First of all, you should run the @code{configure} script at the toplevel
376 of the distribution.  This script will perform a number of checks on
377 your system and generate the @file{Makefile}'s accordingly.
378
379 The @code{configure} script also comes with a number of options that
380 lets you customize the compilation process.  These options are described
381 below where appropriate.
382
383 @subheading Byte Compiling the Lisp files
384
385 First, you need to byte-compile the appropriate @b{BBDB} Lisp files.
386 While this is in theory an optional step, it is virtually required in
387 practice due to speed reasons.
388
389 In order to byte-compile the lisp files, an Emacs of some sort must be
390 used. By default (at @code{configure} time), @code{emacs} and
391 @code{xemacs} will be tried in that order. If you want to use a special
392 Emacs flavor (or if you want to use @code{xemacs} at the first place),
393 you should pass the @code{--with-emacs=PROG} option to @code{configure}.
394
395 In order to successfully compile the @b{BBDB}, the build process also
396 needs to know the location of the various optional packages.  If the
397 directories containing these optional packages are in the default Emacs
398 search path (the @code{load-path} variable), no other changes need be
399 made for the build process to complete successfully.
400
401 If the optional packages are not in the default search path, the build
402 process will not find them unless explicitly told of their location(s).
403 To tell the build process where to find Gnus, MH-E, and/or VM, use the
404 @code{configure} options @code{--with-gnus-dir=DIR},
405 @code{--with-mhe-dir=DIR}, and/or @code{--with-vm-dir=DIR} variables
406 respectively.  To tell the build process where to find any other
407 package(s), pass the directories containing the lisp files for the
408 package(s) to the @code{configure} option @code{--with-other-dirs=DIRS}.
409 If multiple directories are to be added, they should be separated by
410 spaces or colons, and should @b{not} be quoted.  For example, to
411 add the @file{/p/local/elisp/footnote} and @file{/p/local/elisp/sc}
412 directories, call the @code{configure} script as follows:
413
414 @example
415   @code{configure --with-other-dirs=/p/local/elisp/footnote:/p/local/elisp/sc}
416 @end example
417
418 After configuring, run one of the following commands:
419
420 @ifnottex
421 @example
422      @code{make bbdb}  - Build the core, mailer independent, components
423      @code{make gnus}  - Core components plus @code{Gnus} support
424      @code{make mhe}   - Core components plus @code{MH-E} support
425      @code{make rmail} - Core components plus @code{RMAIL} support
426      @code{make vm}    - Build the core components with @code{VM} support
427      @code{make all}   - Core components plus support for all mailers
428                          listed above
429 @end example
430 @end ifnottex
431 @iftex
432 @bgroup@tableindent=1.5in
433 @table @b
434 @item @code{make bbdb}
435 Build the core, mailer independent, components
436 @item @code{make gnus}
437 Core components plus @code{Gnus} support
438 @item @code{make mhe}
439 Core components plus @code{MH-E} support
440 @item @code{make rmail}
441 Core components plus @code{RMAIL} support
442 @item @code{make vm}
443 Build the core components with @code{VM} support
444 @item @code{make all}
445 Core components plus support for all mailers listed above
446 @end table
447 @egroup
448 @end iftex
449
450 You can also combine the above @code{make} commands.  For example, to
451 build the @b{BBDB} with support for @code{Gnus} and @code{VM}, you can
452 do so by typing:
453
454 @example
455 make gnus vm
456 @end example
457
458 @subheading Moving the files to their final destination
459
460 @subsubheading Lisp files
461
462 As stated above, the @file{lisp} subdirectory contains the Emacs Lisp source
463 files for the @b{BBDB}.  Therefore, these files must be in the Emacs
464 @code{load-path}.  There are several ways of doing this, three of which are
465 described below:
466
467 @itemize @bullet
468 @item
469 Add the @file{lisp} directory from the source distribution to the
470 @code{load-path}.  This will allow you to run the @b{BBDB} in-place.  This
471 method is recommended for normal users or @b{BBDB} developers, especially if
472 disk usage is an issue.  It is @b{not} recommended for site-wide
473 installations. @refill
474
475 @item
476 Link the @file{lisp} directory into your @file{site-lisp} directory.  This is
477 for a site-wide installation, but it is subject to the following caveat.  If you
478 link the @file{lisp} directory into @file{site-lisp}, you will make life more
479 difficult for yourself down the road, as you will not be able to make changes to
480 the source directory (new versions, patches, etc) without having an effect on
481 other users who now depend on it.  This directory will automatically be added to
482 the @code{load-path} when Emacs starts. @refill
483
484 @item
485 Make a directory whose sole purpose in life is containing the production copies
486 of the @b{BBDB} source and byte-compiled source files.  Either put this
487 directory under @file{site-lisp} (or put it somewhere else and link it into
488 @file{site-lisp}).  This directory will automatically be added to the
489 @code{load-path} when Emacs starts.  This is the best of the three listed here,
490 as it allows for a degree of separation between the (possibly changing) source
491 tree and the production code.
492 @end itemize
493
494 @ifnottex
495 @subsubheading TeX files
496
497 The @file{tex} subdirectory contains the TeX support files for
498 bbdb-print, the @b{BBDB} printing utility (@xref{bbdb-print}.). The
499 three support files, @file{bbdb-cols.tex}, @file{bbdb-print.tex}, and
500 @file{bbdb-print-brief.tex}, must be placed in a directory that is
501 either on the default TeX search path or is listed in the
502 @code{TEXINPUTS} environment variable. If neither of these two options
503 is taken, TeX will not be able to process the file output by
504 @code{bbdb-print}.
505 @end ifnottex
506 @iftex
507 @subsubheading @TeX files
508
509 The @file{tex} subdirectory contains the @TeX support files for
510 bbdb-print, the @b{BBDB} printing utility (@xref{bbdb-print}). The three
511 support files, @file{bbdb-cols.tex}, @file{bbdb-print.tex}, and
512 @file{bbdb-print-brief.tex}, must be placed in a directory that is
513 either on the default @TeX search path or is listed in the
514 @code{TEXINPUTS} environment variable. If neither of these two options
515 is taken, @TeX will not be able to process the file output by
516 @code{bbdb-print}.
517 @end iftex
518
519 @subsubheading texinfo files
520
521 The @file{bbdb.info} file in this directory contains the documentation
522 for the @b{BBDB}.  This file should either be linked or copied to a
523 directory on the default path for the @code{info} program or listed in
524 the @code{INFOPATH} environment variable.
525
526 @node XEmacs Package, Initial Configuration, Normal User, Installation
527 @subsection XEmacs Package Installation
528 @cindex XEmacs Package Installation
529
530 @noindent
531 @b{NOTE:} XEmacs packages are currently supported only under XEmacs
532 versions after and including 20.5.  If you are not running such a version
533 of XEmacs, you should install the @b{BBDB} according to the instructions
534 in @ref{Normal User}.
535
536 @subheading Configuring / Byte Compiling
537
538 The configuration and byte-compilation procedures are the same as in the
539 Normal User installation.  See @ref{Normal User}.
540
541 @subheading Moving the files to their final destination
542
543 Support is provided for the automatic installation of the @b{BBDB} in an
544 XEmacs package directory. The following @code{configure} options are
545 available for you:
546
547 @table @b
548 @item @code{--with-package-dir=DIR}
549 This option sets the root of the XEmacs package directory.  By default,
550 @file{/usr/local/lib/xemacs/site-packages} is used.
551 @item @code{--with-symlinks}
552 If this option is used, the installation will be done by making symbolic
553 links to the sources instead of copying the files.
554 @item @code{--with-linkpath=PATH}
555 Without this option, the installation process uses the output of
556 @code{pwd} to determine the current directory.  If something else should
557 be used, you should provide an alternate name for the BBDB toplevel
558 directory by using @code{--with-linkpath}.  If, for example, @code{pwd}
559 returns @file{/p/local/elisp/bbdb}, but you prefer to use
560 @file{/usr/local/elisp/bbdb/...} for the links, usr this:
561 @code{configure --with-linkpath=/usr/local/elisp/bbdb}.  This option is
562 ignored if @code{--with-symlinks} is not used.
563 @end table
564
565 To perform the (un)installation, use the command @code{make (un)install-pkg}.
566 This will compile the @file{lisp/auto-autoloads.el} file and will
567 install the appropriate files to the appropriate places.  The final
568 installation tree will take the following form:
569
570 @table @code
571 @item $(PACKAGEDIR)/
572 @table @code
573 @item lisp/
574 @table @code
575 @item bbdb/
576    @i{@b{BBDB} lisp source files.  This directory contains a copy of all
577 @code{.el} and @code{.elc} files from the @file{lisp} source directory,
578 or is a symbolic link to it.}
579 @end table
580 @item info/
581 @table @code
582 @item bbdb.info*
583    @i{@b{BBDB} documentation files.  These are either copies of the info
584 files from the @file{texinfo} source directory, or are symbolic links to
585 them.}
586 @end table
587 @item etc/
588 @table @code
589 @item bbdb/
590 @table @code
591 @item tex/
592     @i{@b{BBDB} support files for bbdb-print.  This directory contains a
593 copy of the appropriate files from the @file{tex} source directory, or
594 is a symbolic link to it.}
595 @item utils/
596     @i{@b{BBDB} miscellaneous utilities.  This directory contains a copy
597 of the appropriate files from the @file{utils} source directory, or is a
598 symbolic link to it.}
599 @end table
600 @end table
601 @end table
602 @end table
603
604 @node Initial Configuration,  , XEmacs Package, Installation
605 @subsection Initial Configuration
606 @cindex Initial Configuration
607 @findex bbdb-initialize
608
609 The simplest way to configure the @b{BBDB} is to include the following
610 forms in your Emacs configuration file:
611
612 @example
613 @code{(require 'bbdb)}
614 @code{(bbdb-initialize)}
615 @end example
616
617 @b{Note:}  The forms above replace the autoloads needed for previous
618 versions of the @b{BBDB}.
619
620 This will set up the @b{BBDB} for basic querying and record manipulation
621 (the Core Functionality referred to in the Prerequisites section).  It
622 will not enable any of the mailreader-, newsreader- or other
623 package-specific @b{BBDB} features.  To enable some or all of these
624 features, the @code{(bbdb-initialize)} form can be enable as shown
625 below.  Alternatively, the features can be enabled manually as described
626 in the following sections.
627
628 @subheading Modifying @code{(bbdb-initialize)}
629
630 The @code{bbdb-initialize} function can be used to enable the various
631 package-specific @b{BBDB} functions.  This feature activation is
632 accomplished through the passing of symbols which tell the function
633 which features to activate.  These symbols are outlined below and in the
634 Emacs documentation for the @code{bbdb-initialize}@footnote{This
635 documentation can be accessed by typing @kbd{C-h f bbdb-initialize RET}.}
636
637 @subsubheading Initialization symbols for mail and news readers
638
639 @table @code
640 @item gnus
641  Initialize support for Gnus@footnote{If you are using GNUS (not Gnus),
642  and if your GNUS version is 3.14 or older, use the @code{Gnus} (note
643  the capitalization) symbol.}.  If you pass the @code{gnus} symbol, you should
644  probably also pass the @code{message} symbol.
645 @item mh-e
646  Initialize support for the MH-E mail reader.
647 @item rmail
648  Initialize support for the RMAIL mail reader.
649 @item sendmail
650  Initialize support for sendmail (@kbd{M-x mail})
651 @item vm
652  Initialize support for the VM mail reader.@footnote{For the VM
653  initialization to work properly, you must either call
654  @code{bbdb-initialize} with the @code{vm} symbol from within your VM
655  initialization file (@file{~/.vm}), or you must call
656  @code{bbdb-insinuate-vm} manually from within your VM initialization
657  file.}
658 @end table
659
660 @subsubheading Initialization symbols for other packages
661
662 @table @code
663 @item message
664  Initialize support for Message mode (the mail composition program
665  included with Gnus).
666 @item reportmail
667  Initialize support for the Reportmail mail notification package.
668 @item sc
669  Initialize support for the Supercite message citation package.
670  Additional initialization is required for Supercite to work with the
671  @b{BBDB}.  @xref{Supercite Prep}.
672 @item w3
673  Initialize support for Web browsers.
674 @end table
675
676 @subsubheading Initialization example
677
678 To initialize support for Gnus 5.5, Message mode, Supercite, and Web
679 browsers, the following forms would be used:
680
681 @example
682 (require 'bbdb)
683 (bbdb-initialize 'gnus 'message 'sc 'w3)
684 @end example
685
686 @subsubheading Manual initialization
687
688 If your initialization needs exceed those provided by
689 @code{bbdb-initialize}, refer to the following sections for a
690 description of the procedures necessary for enabling @b{BBDB} support
691 for the packages listed above.  The procedures described are the same as
692 those carried out by the @code{bbdb-initialize} function when passed the
693 appropriate symbols.  That is, the procedure listed in the RMAIL Prep
694 section below is the same as than executed by @code{bbdb-initialize}
695 when the @code{rmail} symbol is passed.
696
697 @menu
698 Mail and News readers:
699
700 * Gnus Prep::           Initializing @b{BBDB} support for Gnus
701 * MH-E Prep::           Initializing @b{BBDB} support for MH-E
702 * RMAIL Prep::          Initializing @b{BBDB} support for RMAIL
703 * Sendmail Prep::       Initializing @b{BBDB} support for Sendmail
704 * VM Prep::             Initializing @b{BBDB} support for VM
705
706 Other packages:
707
708 * Message Prep::        Initializing @b{BBDB} support for Message mode
709 * Reportmail Prep::     Initializing @b{BBDB} support for Reportmail
710 * Supercite Prep::      Initializing @b{BBDB} support for Supercite
711 * Web Browser Prep::    Initializing @b{BBDB} support for Web Browsers
712 @end menu
713
714 @node Gnus Prep, MH-E Prep, Initial Configuration, Initial Configuration
715 @subsubsection Initializing @b{BBDB} support for Gnus
716
717 To take advantage of the @b{Gnus} features of the @b{BBDB}, add one of
718 the following forms to your Emacs configuration file: @refill
719
720 @noindent
721 For Gnus 3.14 or older:
722
723 @code{(add-hook 'gnus-Startup-hook 'bbdb-insinuate-gnus)}
724
725 @noindent
726 For Gnus 3.15 or newer:
727
728 @code{(add-hook 'gnus-startup-hook 'bbdb-insinuate-gnus)}
729
730 @code{bbdb-insinuate-gnus} adds bindings for the default keys to
731 @b{Gnus} and configures @b{Gnus} to notify the @b{BBDB} when new
732 messages are loaded.  This notification is required if the @b{BBDB} is
733 to be able to display @b{BBDB} entries for messages displayed in
734 @b{Gnus}.
735
736 @node MH-E Prep, RMAIL Prep, Gnus Prep, Initial Configuration
737 @subsubsection Initializing @b{BBDB} support for MH-E
738
739 To take advantage of the @b{MH-E} features of the @b{BBDB}, add the
740 following form to your Emacs configuration file: @refill
741
742 @example
743 (add-hook 'mh-folder-mode-hook 'bbdb-insinuate-mh)
744 @end example
745
746 @code{bbdb-insinuate-mh} adds bindings for the default keys to
747 @b{MH-E} and configures @b{MH-E} to notify the @b{BBDB} when new
748 messages are loaded.  This notification is required if the @b{BBDB} is
749 to be able to display @b{BBDB} entries for messages displayed in
750 @b{MH-E}.
751
752 @node RMAIL Prep, Sendmail Prep, MH-E Prep, Initial Configuration
753 @subsubsection Initializing @b{BBDB} support for RMAIL
754
755 To take advantage of the @b{RMAIL} features of the @b{BBDB}, add the
756 following form to your Emacs configuration file: @refill
757
758 @example
759 (add-hook 'rmail-mode-hook 'bbdb-insinuate-rmail)
760 @end example
761
762 @code{bbdb-insinuate-rmail} adds bindings for the default keys to
763 @b{RMAIL} and configures @b{RMAIL} to notify the @b{BBDB} when new
764 messages are loaded.  This notification is required if the @b{BBDB} is
765 to be able to display @b{BBDB} entries for messages displayed in
766 @b{RMAIL}.
767
768 @node Sendmail Prep, VM Prep, RMAIL Prep, Initial Configuration
769 @subsubsection Initializing @b{BBDB} support for Sendmail
770
771 To take advantage of send-mail-mode (the one invoked with @code{M-x
772 mail}) features of the @b{BBDB}, add the following form to your Emacs
773 configuration file: @refill
774
775 @example
776 (add-hook 'mail-setup-hook 'bbdb-insinuate-sendmail)
777 @end example
778
779 @code{bbdb-insinuate-sendmail} enables auto-completion in
780 send-mail-mode.
781
782 @node VM Prep, Message Prep, Sendmail Prep, Initial Configuration
783 @subsubsection Initializing @b{BBDB} support for VM
784
785 To take advantage of the @b{VM} features of the @b{BBDB}, either add
786 @code{'vm} to the parameters of the @code{(bbdb-initialize)} form, or
787 add the following form to your @file{~/.vm} file: 
788
789 @example
790 @code{(bbdb-insinuate-vm)}
791 @end example
792
793 @code{bbdb-insinuate-vm} adds bindings for the default keys to @b{VM}
794 and configures @b{VM} to notify the @b{BBDB} when new messages are
795 loaded.  This notification is required if the @b{BBDB} is to be able to
796 display @b{BBDB} entries for messages displayed in @b{VM}.
797
798 @node Message Prep, Reportmail Prep, VM Prep, Initial Configuration
799 @subsubsection Initializing @b{BBDB} support for Message mode
800
801 To allow the @b{BBDB} to be used in Message mode, add the following form
802 to your Emacs initialization file:
803
804 @example
805 @code{(bbdb-insinuate-message)}
806 @end example
807
808 @code{bbdb-insinuate-message} adds a binding for @kbd{M-TAB} to Message
809 mode.  This will enable completion of addressees based on @b{BBDB}
810 records. See @ref{Using Message Mode} for more details on the operation
811 of Message mode @b{BBDB} record completion.
812
813 @node Reportmail Prep, Supercite Prep, Message Prep, Initial Configuration
814 @subsubsection Initializing @b{BBDB} support for Reportmail
815
816 To allow the Reportmail package to report information from @b{BBDB}
817 records for new mail, add the following form to your Emacs
818 initialization file:
819
820 @example
821 @code{(bbdb-insinuate-reportmail)}
822 @end example
823
824 @code{bbdb-insinuate-reportmail} adds to the
825 @code{display-time-get-field} function to allow access to @b{BBDB}
826 records during new mail information display.  See @ref{Using Reportmail}
827 for more details on the operation of Reportmail with the @b{BBDB}.
828
829 @node Supercite Prep, Web Browser Prep, Reportmail Prep, Initial Configuration
830 @subsubsection Initializing @b{BBDB} support for Supercite
831
832 To allow the @b{BBDB} to assist in the storage of Supercite citations,
833 add the following form to your Emacs initialization file:
834
835 @example
836 @code{(bbdb-insinuate-sc)}
837 @end example
838
839 @code{bbdb-insinuate-sc} adds @b{BBDB} functions to two Supercite hooks
840 - @code{sc-post-hook} and @code{sc-attribs-postselect-hook}.  See
841 @ref{Using Supercite} for more details on the operation of Supercite
842 citation management using the @b{BBDB}.
843
844 Three other Supercite variables must be set/modified to allow the
845 @b{BBDB} to work with it.  These variables are not automatically set as
846 it would be impossible to reliably set them without interfering with
847 other user customizations.  The modifications are:
848
849 @table @code
850 @item sc-preferred-attribution-list
851 @code{"sc-consult"} should be added to the list.  An example
852 configuration is:
853
854 @example
855 (setq sc-preferred-attribution-list
856   '("sc-lastchoice" "x-attribution" "sc-consult"
857     "initials" "firstname" "lastname"))
858 @end example
859
860 @item sc-attrib-selection-list
861 The following form should be added to @code{sc-attrib-selection-list}:
862
863 @example
864       '(("sc-from-address"
865          ((".*" . (bbdb/sc-consult-attr
866                    (sc-mail-field "sc-from-address"))))))
867 @end example
868
869 @item sc-mail-glom-frame
870 The following form should be added to @code{sc-mail-glom-frame}, to
871 allow the retrieval of the name of a person who is a) in the @b{BBDB}
872 and b) has only included their net address in the message in question.
873
874 @example
875   ("^$"  (progn (bbdb/sc-default)
876             (list 'abort '(step . 0))))
877 @end example
878
879 An example configuration is as follows:
880
881 @example
882 @exdent @code{(setq sc-mail-glom-frame}
883 @exdent @code{   '((begin                        (setq sc-mail-headers-start (point)))}
884 @exdent @code{     ("^x-attribution:[ \t]+.*$"   (sc-mail-fetch-field t) nil t)}
885 @exdent @code{     ("^\\S +:.*$"                 (sc-mail-fetch-field) nil t)}
886 @exdent @code{     ("^$"                         (progn (bbdb/sc-default)}
887 @exdent @code{                                   (list 'abort '(step . 0))))}
888 @exdent @code{     ("^[ \t]+"                    (sc-mail-append-field))}
889 @exdent @code{     (sc-mail-warn-if-non-rfc822-p (sc-mail-error-in-mail-field))}
890 @exdent @code{     (end                          (setq sc-mail-headers-end (point)))))}
891 @end example
892 @end table
893
894 The above is also documented in @file{bbdb-sc.el}.  The
895 @code{bbdb/sc-setup-variables} function has been provided as an example for
896 Supercite variable initialization.  Please note that while
897 @code{bbdb/sc-setup-variables} makes every attempt to safely configure
898 the Supercite variables, it will not always work.  Specifically, the
899 variables @code{sc-attrib-selection-list} and @code{sc-mail-glom-frame}
900 will not be overridden if they have already been defined.
901
902 @node Web Browser Prep,  , Supercite Prep, Initial Configuration
903 @subsubsection Initializing @b{BBDB} support for Web Browsers
904
905 To allow URLs to be added to @b{BBDB} records, add the following form to
906 your Emacs initialization file:
907
908 @example
909 @code{(bbdb-insinuate-w3)}
910 @end example
911
912 @code{bbdb-insinuate-w3} adds the definition of @kbd{:} to the W3
913 keymap.
914
915 The other @code{bbdb-w3} functions, specifically the passing of URLs
916 from @b{BBDB} records to Web browsers, do not require initialization
917 within the @b{BBDB}.  They do, however, require the configuration of the
918 @code{browse-url} package so it knows to which Web browser URLs are to
919 be passed.  For more details on the operation of @code{bbdb-w3}, see
920 @ref{Using Web Browsers}.
921
922 @node The BBDB, BBDB Mode, Installation, Top
923 @section The @b{BBDB}
924
925 This section discusses the basics of the @b{BBDB} - an overview of the
926 database's layout, and a discussion of the basic @b{BBDB} manipulation
927 commands.
928
929 The database itself lives in a file which is named by the variable
930 @code{bbdb-file}.  If this variable is not set, the database is assumed
931 to be in @file{~/.bbdb}.
932
933 @menu
934 * Database Fields::             Description of database fields
935 * Basic Searching::             Basic database searching commands
936 * Advanced Searching::          Advanced database searching commands
937 * Manual Record Addition::      Adding records by hand
938 @end menu
939
940 @node Database Fields, Basic Searching, The BBDB, The BBDB
941 @subsection Database Fields
942
943 The database is organized as a set of records, where each record
944 corresponds to one person or organization.  Each record has several
945 fields, and each field is of one of several types.  Below, the built-in
946 types are listed, followed by a description of how and why some types
947 can be used more than once in a single record: @refill
948 @cindex Builtin field types
949
950 @multitable @columnfractions .1 .5 .4
951 @item Type
952 @tab Description
953 @tab Notes
954
955 @item @code{name}
956 @tab The name of this person, or none if the record corresponds to an
957 organization.
958 @tab Single value, single instance.
959
960 @item @code{company}
961 @tab The name of this person's organization, or none.
962 @tab Single value, single instance.
963
964 @item @code{AKA}
965 @tab A list of other names for this person.
966 @tab Multiple values through commas.
967
968 @item @code{net}
969 @tab A list of this person's network addresses.
970 @tab Multiple values through commas.
971
972 @item @code{address}
973 @tab A list of postal (physical) addresses for this person.
974 @tab Multiple values through multiple occurences.
975
976 @item @code{phone}
977 @tab A list of telephone numbers for this person.
978 @tab Multiple values through multiple occurences.
979
980 @item @code{notes}
981 @tab Random commentary.
982 @tab Multiple values through multiple occurences.
983
984 @end multitable
985
986 The field types listed above can be classified into four categories, as
987 indicated by the comments in the `Notes' column.
988
989 Field types marked as "Single value, single occurrence" may only occur
990 once per record.  Each occurrence can only have a single value.  For
991 example, there will be only one field of type @code{name} in a record.
992 It will be named @code{name}, and will contain a single value (the
993 person's name).
994
995 The types marked as "Multiple values through commas" are essentially the
996 same as the single value, single occurrence field types, but with one
997 crucial difference: they can contain multiple values in the form of a
998 comma-separated list.  So, for example, while a @code{name} field with a
999 value of "foo, bar" would be treated as if it contained the single value
1000 "foo, bar", a @code{net} field with the same data would be thought of as
1001 having two separate values - "foo" and "bar".  As in the single
1002 occurrence, single value field types, there will be only one occurrence
1003 of each "Multiple values through commas" field type, and the occurrence
1004 will have the same name as the type.
1005
1006 The "Multiple values through multiple occurrences" field type is the
1007 most flexible of the four listed here.  There can be multiple
1008 occurrences of each type.  This type necessarily does not have the name
1009 restriction imposed by the previous two types.  For example, there can
1010 be multiple fields of the @code{address} type, none of which have to be
1011 named @code{address}.  One could be named @code{home}, and the other
1012 could be named @code{work}.
1013
1014 Special properties of the @code{notes} field type: All user-defined
1015 fields that don't fit into the other predefined field types
1016 (@code{name}, @code{company}, @code{AKA}, @code{net}, @code{address},
1017 and @code{phone}) will be created as a @code{notes}-type field.  In
1018 addition, several of the user-defined field names are "special".  That
1019 is, the @b{BBDB} treats the values of these "special" fields differently
1020 than it does other user-defined fields.  The "special" fields are:
1021
1022 @cindex Special Field Names
1023 @table @code
1024 @item attribution
1025 @vindex bbdb/sc-attribution-field
1026 @i{(Available only when the Supercite-specific @b{BBDB} functions have been
1027 enabled)} Used for the storage of Supercite attributions.  For initialization
1028 details, see @ref{Supercite Prep}.  For usage details, see @ref{Using
1029 Supercite}.  The field used can be changed by changing the value of
1030 @code{bbdb/sc-attribution-field}.
1031 @item aka
1032 Used to store non-primary names associated with a given record.
1033 @item face
1034 @i{(XEmacs only)} Used for the storage of image data.  This data is to be
1035 in the format output by @code{compface}, and commonly found in
1036 @code{X-Face:} headers in messages.  If face support has been compiled
1037 into XEmacs, the image contained in the @code{face} header will be
1038 displayed when the record is viewed.
1039 @item finger-host
1040 @vindex bbdb-finger-host-field
1041 Address used in place of the listed net address for fingering the entity
1042 indicated by the record. @xref{BBDB Mode}.  The field used can be changed by
1043 changing the value of @code{bbdb-finger-host-field}.
1044 @item gnus-score
1045 @vindex bbdb/gnus-score-field
1046 @b{Gnus} scoring adjustment for this person.  For initialization details, see
1047 @ref{Gnus Prep}.  For usage details, see @ref{Gnus Features}. The field used
1048 can be changed by changing the value of @code{bbdb/gnus-score-field}.
1049 @item mail-alias
1050 @cindex mail-alias definition
1051 Value used instead of @code{name} for completion.  @xref{Mail Sending
1052 Interfaces}.
1053 @item mail-name
1054 @i{(Available only when the Reportmail-specific @b{BBDB} functions have been
1055 enabled)}  Used for the storage of non-default names to be used in the
1056 reporting of new mail by Reportmail.  For initialization details,
1057 see @ref{Reportmail Prep}.  For usage details, see @ref{Using Reportmail}.
1058 @item mark-char
1059 The field containing the character to be used for marking a given poster
1060 in the Gnus Summary Buffer.  For usage details, see @ref{Gnus Summary Buffer}.
1061 @item tex-name
1062 @cindex Printing records in the database
1063 @findex bbdb-print
1064 The value of this field is used in place of the @code{name} field when
1065 printing the database using @code{bbdb-print}.  @xref{bbdb-print}.
1066 @item www
1067 This field contains the URL associated with the @b{BBDB} record.  Common uses
1068 are with @code{bbdb-snarf} (@pxref{bbdb-snarf}) and the @b{BBDB}/Web Browser
1069 functionality (for initialization details, see @ref{Web Browser Prep}.  For
1070 usage details, see @ref{Using Web Browsers}).
1071 @end table
1072
1073 @node Basic Searching, Advanced Searching, Database Fields, The BBDB
1074 @subsection Basic searching commands
1075
1076 You can list the contents of the database with the command
1077 @w{@kbd{M-x bbdb}}.  You will be prompted for a regular expression, and all
1078 records which match that regexp in the name, company, network address,
1079 or any notes fields will be displayed.@refill
1080 @cindex Searching the database
1081 @findex bbdb
1082 @findex bbdb-name
1083 @findex bbdb-company
1084 @findex bbdb-net
1085 @findex bbdb-notes
1086
1087 A narrower search may be made by using the commands @kbd{bbdb-name},
1088 @kbd{bbdb-company,} @kbd{bbdb-net,} or @kbd{bbdb-notes}.  These commands
1089 limit their searches to the name, company, email address, and notes
1090 fields, respectively.  If these commands are given a prefix argument,
1091 the listing displayed will be one line per entry; otherwise, the full
1092 database entry will be shown on multiple lines.
1093
1094 The functions described above are predefined to certain keys in the
1095 @code{*BBDB*} buffer.  @xref{BBDB Mode}. for more details.
1096
1097 @cindex User-defined fields
1098 The @code{bbdb-notes} command will prompt for the notes field to search
1099 (@kbd{RET} for all).  In this way you can limit your searches to the
1100 contents of one particular user-defined notes field.  (You can add
1101 user-defined fields with the @code{bbdb-insert-new-field} command;
1102 @xref{BBDB Mode}.)@refill
1103
1104 @cindex Elided display
1105 @cindex One-line display
1106
1107 @node Advanced Searching, Manual Record Addition, Basic Searching, The BBDB
1108 @subsection Advanced searching commands
1109
1110 The following functions can be used to search for records based on
1111 creation and/or modification dates.  These functions will match records
1112 that have @code{timestamp} and/or @code{creation-date} fields (as
1113 appropriate.  @xref{Predefined Hooks}. for more information on these
1114 fields, which are created by default.
1115
1116 @table @code
1117 @findex bbdb-timestamp-older
1118 @item bbdb-timestamp-older
1119 Display all records modified before a given date.  If this function is
1120 called interactively, it will prompt for a date.  If it is being called
1121 non-interactively, the date should be provided as a string in
1122 @samp{yyyy-mm-dd} format.
1123
1124 @findex bbdb-timestamp-newer
1125 @item bbdb-timestamp-newer
1126 Display all records modified after a given date.  If this function is
1127 called interactively, it will prompt for a date.  If it is being called
1128 non-interactively, the date should be provided as a string in
1129 @samp{yyyy-mm-dd} format.
1130
1131 @findex bbdb-creation-older
1132 @item bbdb-creation-older
1133 Display all records created before a given date.  If this function is
1134 called interactively, it will prompt for a date.  If it is being called
1135 non-interactively, the date should be provided as a string in
1136 @samp{yyyy-mm-dd} format.
1137
1138 @findex bbdb-creation-newer
1139 @item bbdb-creation-newer
1140 Display all records created after a given date.  If this function is
1141 called interactively, it will prompt for a date.  If it is being called
1142 non-interactively, the date should be provided as a string in
1143 @samp{yyyy-mm-dd} format.
1144
1145 @findex bbdb-creation-no-change
1146 @item bbdb-creation-no-change
1147 Display all records that have not been changed since creation.
1148 @end table
1149
1150 @node Manual Record Addition,  , Advanced Searching, The BBDB
1151 @subsection Manual record addition
1152
1153 There are several ways to add new entries to the Insidious Big Brother
1154 Database; the most straightforward is to use @w{@kbd{M-x bbdb-create}},
1155 which will prompt you for all relevant information.  However, the
1156 easiest way is to allow them to be added automatically by one of the
1157 mail or news-reading interfaces (@xref{Interfaces}.). @refill
1158
1159 @cindex Creating new records
1160 @cindex Adding new records
1161
1162 There is als @w{@kbd{bbdb-snarf}} (@xref{bbdb-snarf}), which will
1163 attempt to create a record from a text block. Note that this depends
1164 on particular formatting and may not do exactly what you want.
1165
1166 @node BBDB Mode, Interfaces, The BBDB, Top
1167 @section BBDB Mode
1168
1169 @subsection Functions bound to keys in @b{BBDB} Mode
1170
1171 When the @samp{*BBDB*} buffer is active (either summoned by one of the
1172 commands in the previous section [@xref{The BBDB}.] or by your mail
1173 or news program), a variety of commands become available for database
1174 manipulation.  Some of the commands listed below take numeric arguments.
1175 These arguments can be generated by entering the number before pressing
1176 the key(s) corresponding to the desired command.  The output (if any) of
1177 the listed commands will be displayed in the @samp{*BBDB*} buffer, and
1178 can be navigated through using the usual cursor motion commands.
1179 @cindex BBDB Mode
1180 @cindex *BBDB* buffer
1181
1182 @table @kbd
1183 @item e
1184 @findex bbdb-edit-current-field
1185 @cindex Editing fields
1186 @cindex Changing fields
1187 (@code{bbdb-edit-current-field})  Edit the field on the current line.  If
1188 the cursor is in the middle of a multi-line field, such as an address or
1189 comments section, then the entire field is edited, not just the current
1190 line. @refill
1191
1192 @item ;
1193 @findex bbdb-edit-notes
1194 (@code{bbdb-edit-notes})  A shortcut for editing the @var{notes} field. @refill
1195
1196 @item d, C-k
1197 @findex bbdb-delete-current-field-or-record
1198 @cindex Deleting fields
1199 @cindex Removing fields
1200 (@code{bbdb-delete-current-field-or-record}) Delete the field on the
1201 current line.  If the current line is the first line of a record, the
1202 @b{BBDB} will, after prompting the user, delete the entire record from
1203 the database.  This may also be applied to multiple records at once by
1204 @kbd{*}.
1205
1206 @item C-o
1207 @findex bbdb-insert-new-field
1208 @cindex Adding new fields
1209 @cindex Inserting new fields
1210 @cindex User-defined fields
1211 (@code{bbdb-insert-new-field}) Inserts a new field into the current
1212 record.  You are prompted (with completion) for the type of field to
1213 insert (@b{phone}, @b{address}, @b{notes}, etc); if the string you type
1214 is not a known field type, you will be asked whether to add a new field
1215 with the entered name of type @code{notes}.
1216
1217 @cindex Phone numbers
1218 @cindex North American phone numbers
1219 @cindex European phone numbers
1220 If you are inserting a new phone-number field, you can control whether
1221 it is a North American or European phone number by providing a prefix
1222 argument.  A prefix arg of @kbd{^U} means it's to be a euronumber, and
1223 any other prefix arg means it's to be a a structured North American
1224 number.  If no prefix argument is supplied, the style used is controlled
1225 by the variable @code{bbdb-north-american-phone-numbers-p}. @refill
1226
1227 @item C-x C-t
1228 @findex bbdb-transpose-fields
1229 @cindex Reordering fields
1230 @cindex Transposing fields
1231 (@code{bbdb-transpose-fields}) This is like the @code{transpose-lines}
1232 command, but it is for @b{BBDB} fields.  If the cursor is on a field of
1233 a @b{BBDB} record, that field and the previous field will be
1234 transposed.@refill
1235
1236 With non-zero numeric argument @var{ARG}, the previous field is moved
1237 past @var{ARG} fields.  With argument 0, the field indicated by
1238 @i{point} is interchanged with the one indicated by @i{mark}.
1239
1240 Both fields must be in the same record, and must be of the same basic type
1241 (that is, you can use this command to change the order in which phone-number
1242 fields are listed, but you can't use it to make an address appear before a
1243 phone number; the order of field types is fixed.)@refill
1244
1245 @item n, p
1246 @findex bbdb-next-record
1247 @findex bbdb-prev-record
1248 (@code{bbdb-next-record}, @code{bbdb-prev-record})  Move to the next and
1249 previous displayed record, respectively. @refill
1250
1251 @item t
1252 @findex bbdb-toggle-records-display-layout
1253 (@code{bbdb-toggle-records-display-layout}) Toggles the display layout of a
1254 record.  With a numeric argument
1255 of 0, the current record will be made displayed in one line layout; with any
1256 other argument, the current record will be shown in multi-line layout. @refill
1257
1258 If @kbd{*t} is used instead of simply @kbd{t}, then the state of all
1259 records will be changed instead of just the one at point.  In this case,
1260 a numeric argument of 0 means that all records will unconditionally be
1261 made one-line layout; any other numeric argument means that all of the records
1262 will unconditionally be shown expanded; and no numeric argument means
1263 that the records are made to be in the opposite state of the record
1264 under point. @refill
1265
1266 @item T
1267 @findex bbdb-display-record-completely
1268 (@code{bbdb-display-record-completely})
1269 Show all the fields of the current record.
1270 The display layout `full-multi-line' is used for this.
1271 @refill
1272
1273 @item o
1274 @findex bbdb-omit-record
1275 (@code{bbdb-omit-record}) Removes the current record from the display,
1276 but does not delete it from the database; it merely makes it seem as if
1277 the most recent search had not matched this record.  With a numeric
1278 argument, omit the next N records.  With a negative argument, go
1279 backwards. @refill
1280
1281 @item m
1282 @findex bbdb-send-mail
1283 @cindex Sending mail
1284 @vindex bbdb-send-mail-style
1285 (@code{bbdb-send-mail}) Begin composing mail to the person represented
1286 by the current record.  The first email address is used.  Normally, the
1287 mail-sending package which is used is determined by which mail-reading
1288 package is loaded; that is, if @b{MH-E} is loaded, then @code{mh-send}
1289 will be used; if @b{VM} is loaded, then @code{vm-mail} is used; if
1290 @b{message} is loaded, then it is used; otherwise, @code{mail} is used.
1291 You can override this by setting the variable
1292 @code{bbdb-send-mail-style} to one of the symbols @code{vm}, @code{mh},
1293 @code{message}, or @code{mail}. @refill
1294
1295 If @kbd{*m} is used instead of simply @kbd{m}, then mail will be sent to
1296 all of the folks listed in the @samp{*BBDB*} buffer instead of just the
1297 person under point. @refill
1298
1299 This function does not at present use the facility provided by
1300 @code{compose-mail} and @code{mail-user-agent}.  In a future version of
1301 the @b{BBDB}, it will.
1302
1303 @item s, C-x C-s
1304 @findex bbdb-save-db
1305 @cindex Saving your changes
1306 (@code{bbdb-save-db})  Saves the @b{BBDB} file to disk.
1307
1308 @item r
1309 @findex bbdb-refile-record
1310 @cindex Fixing mistakes
1311 @cindex Merging records
1312 (@code{bbdb-refile-record})  Merge the current record into some other record;
1313 that is, delete the record under point after copying all of the data
1314 within it into some other record.  this is useful if you realize that
1315 somehow a redundant record has gotten into the database, and you want to
1316 merge it with another. @refill
1317
1318 If both records have names and/or companies, you are asked which to use.
1319 Phone numbers, addresses, and network addresses are simply concatenated.
1320 The first record is the record under the point; the second is prompted
1321 for.  Completion behavior is as dictated by the variable
1322 @code{bbdb-completion-type}. @refill
1323
1324 @item M-d
1325 @findex bbdb-dial
1326 @cindex Dialling phone numbers
1327 (@code{bbdb-dial})  This command will attempt to dial the phone number
1328 currently at point, or if point is at the start of a record, the first
1329 phone number in the record.  An extension, if present, is disregarded.
1330 @refill
1331
1332 The method of dialling is controlled by @code{bbdb-modem-dial}. If this
1333 variable is nil, the @b{BBDB} will play touchtones corresponding to the
1334 number to be dialled.  Otherwise, this variable is treated as a modem
1335 command string to be prepended to the number prior to feeding it to
1336 @code{bbdb-modem-device}. @refill
1337
1338 The @b{BBDB} plays touchtones using @code{bbdb-sound-player} to play the
1339 sounds and the elements of @code{bbdb-sound-files} as the audio to be
1340 played.  The first ten elements of @code{bbdb-sound-files} correspond to
1341 the touchtones for the digits @samp{0} to @samp{9}, while the eleventh
1342 and twelfth elements correspond to @samp{#} and @samp{*}
1343 respectively. The default configuration assumes a Solaris[tm]
1344 installation with the demonstration sound files in
1345 @code{/usr/demo/SOUND/sounds}. @refill
1346
1347 The actual number dialled depends on the following variables:
1348
1349 @table @code
1350 @item bbdb-dial-local-prefix-alist 
1351 @vindex bbdb-dial-local-prefix-alist
1352 This is a list of (SEXPR REPLACEMENT) pairs.  SEXPR is evaluated to
1353 produce a regular expression which is then applied to the number. If it
1354 matches, whatever it matches is replaced by REPLACEMENT.  The match and
1355 replace is performed using each item in the list that matches, in
1356 sequence, so that the output from one item may become input to another.
1357 The default value for this variable is to remove
1358 @code{(bbdb-default-area-code)} (i.e. the value of that variable, in
1359 parenthesis) from the start of the number to be dialled.@refill
1360
1361 @b{Note:} If this procedure produces a transformed number then no
1362 further modifications (such as prefix additions, below) will be made to
1363 the number before dialling.@refill
1364
1365 Using a prefix argument to @code{bbdb-dial} disables the processing of
1366 this variable. The other modifiers, below, are not affected by
1367 this.@refill
1368
1369 @item bbdb-dial-local-prefix
1370 @vindex bbdb-dial-local-prefix
1371 If the number to be dialled starts with a zero, it is deemed to be a
1372 local number, and @code{bbdb-dial-local-prefix} is prepended to it (see
1373 note above concerning @code{bbdb-dial-local-prefix-alist} processing,
1374 however).@refill
1375
1376 @item bbdb-dial-long-distance-prefix
1377 @vindex bbdb-dial-long-distance-prefix
1378 If the number to be dialled starts with a plus sign (+), it is deemed to
1379 be a long distance number, and @code{bbdb-dial-long-distance-prefix} is
1380 prepended to it (see note above concerning
1381 @code{bbdb-dial-local-prefix-alist} processing, however).@refill
1382
1383 @end table
1384
1385 @item f
1386 @findex bbdb-finger
1387 @cindex Finger interface
1388 (@code{bbdb-finger})  This command fingers the network address of a
1389 @b{BBDB} record.  If this command is executed from the @samp{*BBDB*} buffer,
1390 it fingers the network address of the record which is at point; otherwise,
1391 it prompts in the minibuffer (with completion) for a user to finger.  With a
1392 numeric prefix argument, it fingers the @i{N}th network address of the
1393 current record; with a prefix argument of @kbd{^U}, it fingers all of them.
1394 The @samp{*finger*} buffer is filled asynchronously, meaning that you don't
1395 have to wait around for it to finish; but fingering another user before
1396 the first finger has finished could have unpredictable results.@refill
1397
1398 If this command is executed from the @samp{*BBDB*} buffer, it may be prefixed
1399 with @kbd{*} (as in @kbd{*f} instead of simply @kbd{f}), meaning to
1400 finger all of the users currently listed instead of just the one under
1401 point.  The numeric prefix argument has the same interpretation. @refill
1402
1403 @vindex bbdb-finger-host-field
1404 You can define a special network address to ``finger'' by defining a field
1405 @code{finger-host}.  The name of the field to be fingered can be changed
1406 by setting @code{bbdb-finger-host-field}.
1407
1408 @item q
1409 @findex bbdb-bury-buffer
1410 (@code{bbdb-bury-buffer})  Hides the @samp{*BBDB*} buffer.  @b{Note:}
1411 This command does @b{not} kill the @samp{*BBDB*} buffer.
1412
1413 @item ?
1414 @findex bbdb-help
1415 (@code{bbdb-help})  This displays a one-line help message in the
1416 minibuffer, showing some of the most common bbdb-mode commands.
1417
1418 @item i
1419 @findex bbdb-info
1420 (@code{bbdb-info})  This documentation is displayed.  Please note that
1421 either @file{bbdb} or @file{bbdb.info} must be installed in one of the
1422 info directories known to Emacs for this command to work.
1423
1424 @table @code
1425 @item bbdb-info-file
1426 @vindex bbdb-info-file
1427 If this documentation is not installed in the standard Info directory,
1428 then you should set this variable to the name of the texinfo-formatted
1429 version of this file; the @code{bbdb-info} command will use this file
1430 instead.@refill
1431 @end table
1432
1433 @item W
1434 @cindex Browsing the Web page for the current record
1435 @findex bbdb-www
1436 (@code{bbdb-www})  Displays the Web page listed in the @code{www} field
1437 of the current record.  @xref{Using Web Browsers}.
1438
1439 @item P
1440 @cindex Printing records in the database
1441 @findex bbdb-print
1442 (@code{bbdb-print})  Creates a TeX file that contains a pretty-printed version
1443 of @b{BBDB} records.  If prefixed by @kbd{*}, only the records currently
1444 displayed will print.  @xref{bbdb-print}.
1445
1446 @item h
1447 @cindex Changing windows
1448 Moves point to another window via the @code{other-window} function.
1449
1450 @item c
1451 @cindex Creating new records
1452 @findex bbdb-create
1453 (@code{bbdb-create})  Create a new database record from information
1454 supplied by the user.
1455
1456 @item C
1457 @cindex Displaying changed records
1458 @findex bbdb-changed
1459 (@code{bbdb-changed})  Display all records that have been changed since
1460 the last time the database was saved.
1461
1462 @item b
1463 @cindex Searching the database
1464 @findex bbdb
1465 (@code{bbdb})  Begin a new database search.  The results of the new
1466 search will be displayed in place of the results of the old search.
1467
1468 @item S a, S c, S o, S n
1469 @cindex Searching the database
1470 @findex bbdb-net
1471 @findex bbdb-company
1472 @findex bbdb-notes
1473 @findex bbdb-name
1474 (@code{bbdb-net}, @code{bbdb-company}, @code{bbdb-notes},
1475 @code{bbdb-name})@*
1476 Begin a new database search.  This search will be
1477 limited to the net address, company, notes, or name fields,
1478 respectively, of database records.  @xref{Basic Searching}. for more
1479 details.
1480
1481 @item *
1482 @findex bbdb-append-records
1483 @code{bbdb-append-records} will make the next display/search
1484 command to append its results to the BBDB buffer instead of replacing its
1485 content. 
1486
1487 With an prefix arg (C-u) toggle between always append and no append.
1488 With an prefix arg that is a positive number append will be enabled for that
1489 many times.
1490 With any other argument append will be enabled once."@refill
1491
1492 @end table
1493
1494 @subsection Other database manipulation functions
1495
1496 @table @code
1497 @findex bbdb-kill-older
1498 @item bbdb-kill-older
1499 If called interactively (or with a single argument - a date in
1500 @samp{yyyy-mm-dd} format), it will kill all records that were last
1501 modified before the given date as determined by the @code{timestamp}
1502 field.  @xref{Predefined Hooks}.  If called non-interactively with a
1503 date (in @samp{yyyy-mm-dd} format), a comparison function and an action
1504 function, the comparison function is applied to the @code{timestamp}
1505 field of all records, and the action function applied to those for whom
1506 the comparison function returns true.  If @samp{nil} is supplied as the
1507 comparison function, @code{string-lessp} is used.
1508
1509 @end table
1510
1511 @node Interfaces, Reader-specific Features, BBDB Mode, Top
1512 @section Interfaces
1513
1514 The @b{BBDB} interfaces itself with several message-handling packages, but
1515 certain parameters control its behavior depending on whether it is
1516 being used from within a mail reader or a news reader. @refill
1517
1518 In all of these packages, two new keybindings will be added:
1519
1520 @table @kbd
1521 @item :
1522 @cindex Showing the sender of the current message
1523 @findex bbdb/vm-show-sender
1524 @findex bbdb/rmail-show-sender
1525 @findex bbdb/mh-show-sender
1526 @findex bbdb/gnus-show-sender
1527 (@code{bbdb/@i{package}-show-sender}) Displays the @b{BBDB} entry corresponding
1528 to the author of the current message.  If there is none, you will be
1529 asked whether to create one.  The function called is
1530 @code{bbdb/@i{package}-show-sender}, where @code{@i{package}} is either
1531 @code{gnus}, @code{mh}, @code{rmail}, or @code{vm}, depending on the
1532 mail or news program being used when the command is invoked.
1533
1534 @item ;
1535 @cindex Annotating the sender of the current message
1536 @findex bbdb/vm-annotate-sender
1537 @findex bbdb/rmail-annotate-sender
1538 @findex bbdb/mh-annotate-sender
1539 @findex bbdb/gnus-annotate-sender
1540 (@code{bbdb/@i{package}-annotate-sender}) Lets you edit the @samp{notes}
1541 field of the @b{BBDB} record corresponding to the sender of the current
1542 message.  If there is no record for the current author, you will be
1543 asked whether to create one.  The function called is
1544 @code{bbdb/@i{package}-annotate-sender}, where @code{@i{package}} is
1545 either @code{gnus}, @code{mh}, @code{rmail}, or @code{vm}, depending on
1546 the mail or news program being used when the command is invoked.
1547 @end table
1548
1549 These keybindings (and several other features) will not be
1550 available unless you call the appropriate ``insinuation''
1551 function; @xref{Installation}.@refill
1552
1553 It is possible to configure @b{BBDB} so that it automatically creates a
1554 record when it sees a message from a person who is not in the database.
1555 It is also possible to have text automatically added to the notes field
1556 of the corresponding record depending on the contents of the message
1557 headers.  @xref{Customization Hooks}.@refill
1558
1559 @menu
1560 * Mail Reading Interfaces::             Mail Reading Interfaces
1561 * News Reading Interfaces::             News Reading Interfaces
1562 * Mail Sending Interfaces::             Mail Sending Interfaces
1563 @end menu
1564
1565 @node Mail Reading Interfaces, News Reading Interfaces, Interfaces, Interfaces
1566 @subsection Mail Reading Interfaces
1567
1568 There are BBDB interfaces for the following mail readers:
1569
1570 @itemize @bullet
1571 @item
1572 @b{Gnus}, a news- and email- reader written by Lars Magne Ingebrigtsen
1573 (based on @b{GNUS} by Mansanobu Umeda).
1574 @item
1575 @b{MH-E}, the Emacs interface to @b{Mail Handler} (@b{MH}), from the
1576 standard emacs library, but packaged separately from XEmacs since
1577 version 20.4.@refill
1578 @item
1579 @b{RMAIL}, from the standard emacs library (packaged separately for
1580 XEmacs users as of 20.4);
1581 @item
1582 @b{View Mail}, by Kyle Jones, version 5.31 or newer;
1583 @end itemize
1584
1585 @node News Reading Interfaces, Mail Sending Interfaces, Mail Reading Interfaces, Interfaces
1586 @subsection News Reading Interfaces
1587
1588 There are BBDB interfaces for the following news readers:
1589
1590 @itemize @bullet
1591 @item
1592 @b{GNUS}, a newsreader written by Masanobu Umeda. @refill
1593 @item
1594 @b{Gnus}, the modern news- and email-reading incarnation of @b{GNUS}.
1595 @b{Gnus} is written by Lars Magne Ingebrigtsen.@refill
1596 @end itemize
1597
1598 @node Mail Sending Interfaces,  , News Reading Interfaces, Interfaces
1599 @subsection Mail Sending Interfaces
1600
1601 @findex bbdb-complete-name
1602 @vindex bbdb-dwim-net-address-allow-redundancy
1603 @cindex Name completion
1604 @cindex Mail address completion
1605 @cindex Address completion
1606 @cindex Format of completed address
1607 When sending mail, the keystroke @kbd{M-TAB} is bound to the
1608 function @code{bbdb-complete-name}.  This will take the string that
1609 you have typed (from point back to the preceding colon, comma, or
1610 the beginning of the line) and will complete that against the
1611 contents of the database.  What you have typed may be an initial
1612 subsequence of a person's full name or network address; if it
1613 completes ambiguously, then what you have typed will be replaced
1614 with the common portion of the matches.  Typing @kbd{M-TAB} again will
1615 show a list of possible completions.  If it completes unambiguously,
1616 then an address will be inserted.  The variable
1617 @code{bbdb-completion-type} controls whether completion is done on real
1618 names, or network addresses, or both. The address inserted is normally
1619 of the form @w{@code{User Name <email-address>}}; however, if
1620 @code{User Name} has an address of the form
1621 @code{<user.name@@somedomain>}, only the @code{<email-address>} portion
1622 is inserted. This can be overridden by setting
1623 @code{bbdb-dwim-net-address-allow-redundancy} to @code{t}. @refill
1624
1625 This binding is automatically set by the various insinuation functions
1626 documented earlier in this manual.  (@xref{Initial Configuration}.)
1627 Briefly, the forms for these functions are:
1628
1629 @table @b
1630 @item Gnus
1631 @code{(add-hook 'gnus-Startup-hook 'bbdb-insinuate-gnus)} @i{for Gnus 3.14 or older}@*
1632 @code{(add-hook 'gnus-startup-hook 'bbdb-insinuate-gnus)} @i{for Gnus 3.15 or newer}
1633 @item MH-E
1634 @code{(add-hook 'mh-folder-mode-hook 'bbdb-insinuate-mh)}
1635 @item RMAIL
1636 @code{(add-hook 'rmail-mode-hook 'bbdb-insinuate-rmail)}
1637 @item sendmail
1638 @code{(add-hook 'mail-setup-hook 'bbdb-insinuate-sendmail)}
1639 @item VM
1640 @code{(bbdb-insinuate-vm)} @i{Add to @file{~/.vm} file}
1641 @end table
1642
1643 @noindent
1644 The above forms should be added to your Emacs initialization file,
1645 except where otherwise noted.
1646
1647 You can control what ``real name'' is inserted with the
1648 @code{mail-alias} field: if a record has a @code{mail-alias}
1649 field, then that is used instead of their @code{name} field.
1650
1651 @vindex bbdb-completion-display-record
1652 If the variable @code{bbdb-completion-display-record} is true (the
1653 default) then when you successfully complete an address with
1654 @kbd{M-TAB}, the corresponding record will be appended to
1655 the @samp{*BBDB*} buffer.  The buffer will not be displayed if it
1656 is not already visible, but the record will be displayed there.
1657
1658 @findex bbdb-yank-addresses
1659 @cindex Sending mail
1660 When sending mail, you can use the command @code{bbdb-yank-addresses}
1661 to CC the current message to the people currently displayed in
1662 the @samp{*BBDB*} buffer.  This is useful if you are in the midst of
1663 sending or replying to a message, and you decide to add some recipients.
1664 You can use one of the @kbd{M-x bbdb} commands to display the set of
1665 people that you want to CC the message to, and then execute this command
1666 to add them to the list.
1667
1668 @unnumberedsubsec Mailing Lists and Mail Aliases
1669
1670 @cindex Mailing lists
1671 @cindex Mail Aliases
1672 @cindex mail-alias usage
1673 @findex bbdb-define-all-aliases
1674 @findex bbdb-add-or-remove-mail-alias
1675 @findex define-mail-alias
1676
1677 If you are using Jamie Zawinski's @file{mail-abbrevs.el} package, which
1678 uses the word-abbrev mechanism for mail aliases, then you can store your
1679 mail aliases in the BBDB instead of duplicating the information
1680 elsewhere.@refill
1681
1682 If you want a mail alias to be defined for a person, simply add a
1683 @code{mail-alias} field to their record.  You may have multiple aliases
1684 for the same person; simply separate them with commas.@refill
1685
1686 For convenience there is the function @code{bbdb-add-or-remove-mail-alias}
1687 bound to @kbd{a} which adds an alias to one or multiple records when prefixed
1688 by a @kbd{*}.  Called with a prefix argument @kbd{C-u} it will remove
1689 the given alias.@refill
1690
1691 If more than one person has the same mail-alias, then that alias expands
1692 to the addresses of all of those people; in this way you can maintain
1693 mailing lists within the BBDB.@refill
1694
1695 When you want to group aliases as in @code{.mailrc} you may just
1696 retained the group aliases in your @code{.mailrc}.
1697
1698 To actually define the aliases which are stored in the BBDB, call the
1699 function @code{bbdb-define-all-aliases} from your
1700 @code{mail-setup-hook} (or @code{message-setup-hook} if you use
1701 Message mode coming with Gnus).  This will search the database, and
1702 call @code{define-mail-alias} to define each of the resulting
1703 aliases.@refill
1704
1705 @node Reader-specific Features, Other Packages, Interfaces, Top
1706 @section Reader-specific Features
1707
1708 There are features of the @b{BBDB} that are available only for specific
1709 mail- and news-readers.  These features are described below.
1710
1711 The headers which are parsed for email addresses and what records are
1712 displayed can be controlled by the following variables:
1713 @vindex bbdb-get-addresses-from-headers
1714 @vindex bbdb-get-addresses-to-headers
1715 @vindex bbdb-get-addresses-headers
1716 @vindex bbdb-get-only-first-address-p
1717 @code{bbdb-get-addresses-from-headers} controls which headers are parsed
1718 for sender addresses when calling the show-sender function of your MUA.
1719 @code{bbdb-get-addresses-to-headers} controls which headers are parsed
1720 for recipients addresses when calling the show-all-recipients function
1721 of your MUA.  When using the pop up feature it will search for the
1722 addresses in @code{bbdb-get-addresses-headers} and display them.  By
1723 default it will list only the first address, but by setting
1724 @code{bbdb-get-only-first-address-p} to @code{nil} one will will get
1725 records for all addresses.
1726
1727 If there is no MUA specific variable for ignoring certain addresses then
1728 those addresses matching @code{bbdb-user-mail-names} will be ignored.
1729
1730 @b{BBDB} adds the bindings @kbd{:} for showing all senders and @kbd{;}
1731 for editing the notes of the sender.
1732
1733 @menu
1734 * Gnus Features::                       Gnus-specific Features
1735 * VM Features::                         VM-specific Features
1736 @end menu
1737
1738 @node Gnus Features, VM Features, Reader-specific Features, Reader-specific Features
1739 @subsection Gnus-specific Features
1740
1741 The @b{BBDB} can be used to provide score information, or to integrate
1742 database information into the @b{Gnus} Summary buffer or the @b{GNUS}
1743 Subject List.
1744
1745 @menu
1746 * Gnus Scoring::                        Store score adjustments in the @b{BBDB}
1747 * Gnus Summary Buffer::                 @b{BBDB} information in the Summary buffer
1748 * GNUS Subject List::                   @b{BBDB} information in the Subject List
1749 @end menu
1750
1751 @node Gnus Scoring, Gnus Summary Buffer, Gnus Features, Gnus Features
1752 @subsubsection Scoring
1753 @vindex bbdb/gnus-score-field
1754 @vindex bbdb/gnus-score-default
1755 @vindex gnus-score-find-score-files-function
1756
1757 The @b{BBDB} can provide scoring information to @b{Gnus} in one of two
1758 ways.
1759
1760 @enumerate
1761 @item
1762 Articles whose authors appear in the @b{BBDB} and who have
1763 @code{gnus-score} fields will have their scores adjusted by the value
1764 contained in that field.
1765 @item
1766 Articles whose authors appear in the @b{BBDB} but who do not have
1767 @code{gnus-score} fields will have their scores adjusted by
1768 @code{bbdb/gnus-score-default}.  If @code{bbdb/gnus-score-default} is
1769 @code{nil}, no score adjustment will be made.
1770 @end enumerate
1771
1772 The @b{BBDB} by default searches the field contained in
1773 @code{bbdb/gnus-score-field} for score values.  To have the @b{BBDB} use
1774 a different field, change the value of this variable.
1775
1776 To enable @b{BBDB}-assisted scoring, add the @code{bbdb/gnus-score}
1777 function to @code{gnus-score-find-score-files-function}.  Assuming that
1778 you want to preserve the default value of this variable, use a form
1779 similar to the following:
1780
1781 @example
1782 (setq gnus-score-find-score-files-function
1783       '(gnus-score-find-bnews bbdb/gnus-score))
1784 @end example
1785
1786 @b{Note:} The default value in @b{Gnus} 5.5 is @code{gnus-score-find-bnews}.
1787 Check your configuration before using the above code, as your values may
1788 be different.
1789
1790 @node Gnus Summary Buffer, GNUS Subject List, Gnus Scoring, Gnus Features
1791 @subsubsection Gnus Summary Buffer Enhancements
1792
1793 @b{Gnus} can use the @b{BBDB} to do one of two things:
1794
1795 @itemize @bullet
1796 @item
1797 Mark authors in the Summary Buffer who have records in the @b{BBDB} with
1798 a user-defined mark character.  See Marking Posters, below.
1799 @item
1800 For authors in the Summary Buffer who also have records in the @b{BBDB},
1801 replace their name as listed in the Summary Buffer with their name as
1802 stored in the @b{BBDB}.  See Using Names from the @b{BBDB}, below.
1803 @end itemize
1804
1805 @subsubheading Marking Posters
1806
1807 Authors with records in the @b{BBDB} can be marked either with a
1808 user-defined mark character, or with a default one.  The marking is
1809 enabled by the use of a Gnus user format code, as determined by
1810 @code{bbdb/gnus-summary-in-bbdb-format-letter}.  This variable, which
1811 defaults to @samp{b}, is used to create a format code which is intended
1812 for use in @code{gnus-summary-line-format}.  The format code is created
1813 by concatenating @samp{%u} with the value of
1814 @code{bbdb/gnus-summary-in-bbdb-format-letter}.  In the default case
1815 this results in the creation of the format code @samp{%ub}.
1816
1817 Posts are marked as follows: If the record for the poster has the field
1818 indicated in @code{bbdb-message-marker-field} (the default is
1819 @code{mark-char}), the value of that field is used as the mark
1820 character.@footnote{While it is possible to put a multi-character mark
1821 in @code{bbdb-message-marker-field} and/or in
1822 @code{bbdb/gnus-summary-known-poster-mark}, the resulting summary buffer
1823 will be misaligned as a result.  This misalignment will result from fact
1824 that at this time the character used to indicate posts whose authors are
1825 not in the @b{BBDB} is always a single character, and cannot be
1826 changed.}  If no such field is present, the value of
1827 @code{bbdb/gnus-summary-known-poster-mark} will be used instead.  If the
1828 author is not in the @b{BBDB}, a space will be used as the mark character.
1829
1830 @subsubheading Using Names from the @b{BBDB}
1831
1832 The names reported for authors of posts in the Summary buffer can be
1833 altered to conform to the values present in their respective @b{BBDB}
1834 records (if any).  This rewriting is enabled by the use of a Gnus user
1835 format code, as determined by
1836 @code{bbdb/gnus-summary-user-format-letter}.  This variable, which
1837 defaults to @samp{B}, is used to create a format code which is intended
1838 for use in @code{gnus-summary-line-format}.  The format code is created
1839 by concatenating @samp{%u} with the value of
1840 @code{bbdb/gnus-summary-user-format-letter}.  In the default case this
1841 results in the creation of the format code @samp{%uB}.  This format code
1842 is intended to @b{replace} the format code previously used in the Summary
1843 buffer format line to indicate the author and/or net address (usually
1844 @samp{%a}, @samp{%n}, and/or @samp{$N}).
1845
1846 The effects of this format code are in two independent parts - the
1847 marking of known posters, and the rewriting of posters names.  The
1848 first, the marking of posters, occurs only when
1849 @code{bbdb/gnus-summary-mark-known-posters} is @code{t} (the default)
1850 and the posters have entries in the @b{BBDB}.  When this variable is
1851 true, the marking occurs as described in the previous section, Marking
1852 Posters, above.
1853
1854 The poster name rewriting is done for all posters - not just for those
1855 with records in the @b{BBDB}.  That said, rewriting rules for posters in
1856 the @b{BBDB} are more flexible than for those not listed.  The rewriting is
1857 governed by two variables, as described below.
1858
1859 @code{bbdb/gnus-summary-prefer-real-names} can have one of three values -
1860 @samp{t}, @samp{bbdb}, or @code{nil}.  In general, this variable governs
1861 the preference between net addresses and names.  If it is @samp{t}, the
1862 name (if any) will be used.  If @samp{nil}, the net address will be
1863 used.  The third value, @samp{bbdb}, can be used as a method for
1864 distinguishing between authors with records in the @b{BBDB} and those
1865 without.  If the variable is set to @samp{bbdb}, the name from the
1866 @b{BBDB} record will be used if the author has a record in the
1867 @b{BBDB}.  If the author is not in the @b{BBDB}, the net address from
1868 the message will be printed.  This variable makes little sense if
1869 @code{bbdb/gnus-summary-prefer-bbdb-data} is @samp{nil}, as no names
1870 will be printed in the Summary buffer in this case - only net addresses.
1871
1872 @code{bbdb/gnus-summary-prefer-bbdb-data} is used to (dis)allow use of
1873 the @b{BBDB} for author data retrieval.  If it is @samp{t}, data from
1874 the @b{BBDB} will be used if available.  If it is @samp{nil}, data from
1875 the @b{BBDB} will not be used.
1876
1877 @noindent
1878 In the following examples, assume the following:
1879
1880 @enumerate
1881 @item 
1882 Message: @code{From: Jamie <jwz@@netscape.com>}@*
1883 @b{BBDB}: No record
1884 @item 
1885 Message: @code{From: Matt <simmonmt@@acm.org>}@*
1886 @b{BBDB}: Name: @samp{Matthew}, Net: @samp{simmonmt@@purdue.edu}
1887 @end enumerate
1888
1889 @multitable @columnfractions .47 .17 .18 .18
1890 @item @code{bbdb/gnus-summary-prefer-bbdb-data}
1891 @tab @center @code{t}
1892 @tab @center @code{t}
1893 @tab @center @code{nil}
1894 @item @code{bbdb/gnus-summary-prefer-real-names}
1895 @tab @center @code{t}
1896 @tab @center @code{bbdb}
1897 @tab @center @code{t}
1898 @item Printed in Summary buffer for
1899 @tab
1900 @tab
1901 @tab
1902 @item @center Case 1
1903 @tab @center Jamie
1904 @tab @center jwz@@netscape.com
1905 @tab @center Jamie
1906 @item @center Case 2 
1907 @tab @center Matthew
1908 @tab @center Matthew
1909 @tab @center Matt
1910 @end multitable
1911
1912 @node GNUS Subject List,  , Gnus Summary Buffer, Gnus Features
1913 @subsubsection GNUS Summary Buffer Enhancements
1914
1915 @i{This section is remarkably terse, as I don't have a copy of @b{GNUS}.
1916 If anybody can provide more descriptive information, please let me
1917 know.}
1918
1919 @example
1920 (autoload 'bbdb/gnus-lines-and-from "bbdb-gnus")
1921 (setq gnus-optional-headers 'bbdb/gnus-lines-and-from)
1922 @end example
1923
1924 @table @code
1925 @item bbdb/gnus-mark-known-posters
1926 @vindex bbdb/gnus-mark-known-posters
1927 @cindex GNUS Subject-buffer
1928 If @code{t} (the default), then the @b{GNUS} subject list will contain an
1929 indication of those messages posted by people who have entries in
1930 the Insidious Big Brother Database (they will be marked with an
1931 asterisk.) @refill
1932
1933 @cindex mark-char
1934 You can change the character used to mark records on a record-by-record
1935 basis by adding a @code{mark-char} property to the record, whose value
1936 is be the string to display (preferably one character.) @refill
1937
1938 @item bbdb/gnus-header-prefer-real-names
1939 @vindex bbdb/gnus-header-prefer-real-names
1940 Default: @code{nil}.  if @code{t}, then the @b{GNUS} subject list will
1941 display real names instead of network addresses. @refill
1942
1943 @item bbdb/gnus-header-show-bbdb-names
1944 @vindex bbdb/gnus-header-show-bbdb-names
1945 Default: @code{t}.  If both this variable and
1946 the @code{bbdb/gnus-header-prefer-real-names} variable are true, then
1947 for news messages from people who are in your database, the name displayed
1948 will be the primary name from the database, rather than the one from
1949 the @samp{From:} line of the message.  This doesn't affect the names of
1950 people who aren't in the database, of course.@refill
1951
1952 @item bbdb/gnus-lines-and-from-length
1953 @vindex bbdb/gnus-lines-and-from-length
1954 Default: 18.  The number of characters used to display @samp{From:} info in
1955 @b{GNUS}, if you have set @code{gnus-optional-headers} to
1956 @code{bbdb/gnus-lines-and-from}. @refill
1957 @end table
1958
1959 @node VM Features,  , Gnus Features, Reader-specific Features
1960 @subsection VM-specific features
1961
1962 The @b{BBDB} can be used to integrate database information into the
1963 message summary.
1964
1965 @menu
1966 * VM Message Summary::                  @b{BBDB} information in message summary
1967 * VM what records are displayed::
1968 * VM automatic setup of vm-set-auto-folder-alist::
1969 * VM automatic adding of labels::
1970 @end menu
1971
1972 @node VM Message Summary, VM what records are displayed, VM Features, VM Features
1973 @subsubsection VM Message Summary Enhancements
1974
1975 @vindex vm-summary-format
1976 @findex vm-summary-function-B
1977 @cindex %F
1978 @cindex %UB
1979 VM users can cause their summary buffer to display the name of the
1980 message sender according to @b{BBDB} data, instead of according to the
1981 contents of the current message's headers.  In VM 5.40 or later, use
1982 the summary format control @code{%UB"} instead of @code{"%F"}, and the
1983 current record name will be shown there if available.  If no entry is
1984 found it behaves like @code{"%F"}.  See the documentation for
1985 @code{vm-summary-format} for more details.  Warning, this may
1986 significantly slow down summary generation for large folders.
1987
1988 @node VM what records are displayed, VM automatic setup of vm-set-auto-folder-alist, VM Message Summary, VM Features
1989 @subsubsection VM configuration of what records the @b{BBDB} buffer shows
1990
1991 @vindex vm-summary-uninteresting-senders
1992
1993 Email addresses which match @code{vm-summary-uninteresting-senders} are
1994 ignored.
1995
1996 The records in the @b{BBDB} buffer are listed in the same order as found.
1997
1998 @node VM automatic setup of vm-set-auto-folder-alist, VM automatic adding of labels, VM what records are displayed, VM Features
1999 @subsubsection VM automatic setup of @code{vm-set-auto-folder-alist}
2000
2001 @vindex bbdb/vm-set-auto-folder-alist-field
2002 VM users can setup the @code{vm-set-auto-folder-alist} automatically by
2003 calling @code{bbdb/vm-set-auto-folder-alist}.  This adds for each @b{BBDB}
2004 record containing a @code{bbdb/vm-set-auto-folder-alist-field} an entry
2005 to @code{vm-set-auto-folder-alist}.
2006
2007 The record field can contain a string which is used as folder name or
2008 if it starts with a @code{'} it is treated as lisp expression returning
2009 a folder name.
2010
2011 @node VM automatic adding of labels, , VM automatic setup of vm-set-auto-folder-alist, VM Features
2012 @subsubsection VM automatic adding of labels
2013
2014 @vindex bbdb/vm-auto-add-label-list
2015 @vindex bbdb/vm-auto-add-label-field
2016 @findex bbdb/vm-auto-add-label
2017
2018 @code{bbdb/vm-auto-add-label-list} is a
2019 List used by @code{bbdb/vm-auto-add-label} to automatically label messages.
2020 Each element in the list is either a string or a list of two strings.
2021 If a single string then it is used as both the field value to check for
2022 and the label to apply to the message.  If a list of two strings, the first
2023 is the field value to search for and the second is the label to apply.
2024
2025 @code{bbdb/vm-auto-add-label-field bbdb-define-all-aliases-field} is the
2026 field used by @code{bbdb/vm-auto-add-label} to automatically label messages.
2027 Value is either a single symbol or a list of symbols of bbdb fields that
2028 @code{bbdb/vm-auto-add-label} uses to check for labels to apply to messages.
2029 Defaults to @code{bbdb-define-all-aliases-field} which is typically
2030 @code{mail-alias}.
2031
2032 @code{bbdb/vm-auto-add-label} automatically adds labels to messages
2033 based on the @code{bbdb/vm-auto-add-label-field
2034 bbdb-define-all-aliases-field} field.  Add this to
2035 @code{bbdb-notice-hook} and if using VM each message that bbdb notices
2036 will be checked.  If the sender has a value in the
2037 @code{bbdb/vm-auto-add-label-field} in their BBDB record that matches a
2038 value in @code{bbdb/vm-auto-add-label-list} then a VM label will be
2039 added to the message.
2040
2041 This works great when `bbdb-user-mail-names' is set.  As a result mail
2042 that you send to people (and copy yourself on) is labeled as well.
2043
2044 @node Other Packages, Options, Reader-specific Features, Top
2045 @section Using the @b{BBDB} with other packages
2046
2047 The @b{BBDB} adds functionality to several packages.  The following sections
2048 detail these augmentations.
2049
2050 @menu
2051 * Using Message Mode::          Using the @b{BBDB} with Message Mode
2052 * Using Reportmail::            Using the @b{BBDB} with Reportmail
2053 * Using Supercite::             Using the @b{BBDB} with Supercite
2054 * Using Web Browsers::          Using the @b{BBDB} with Web Browsers
2055 @end menu
2056
2057 @node Using Message Mode, Using Reportmail, Other Packages, Other Packages
2058 @subsection Using the @b{BBDB} with Message Mode
2059
2060 At this time, the only feature the @b{BBDB} adds to Message mode is the binding
2061 to @kbd{M-TAB} which allows for @b{BBDB} record completion.
2062
2063 @node Using Reportmail, Using Supercite, Using Message Mode, Other Packages
2064 @subsection Using the @b{BBDB} with Reportmail
2065
2066 The @b{BBDB} can modify the @file{reportmail.el} package to use information
2067 from @b{BBDB} records when identifying the senders or recipients of e-mail
2068 messages.
2069
2070 In normal operation, Reportmail displays the name and net address sender and
2071 recipient of incoming messages.  The @b{BBDB} can be configured to intercept
2072 and rewrite this information before it appears in the Emacs mode-line.  It
2073 first attempts to rewrite the sender and/or recipient information by
2074 substituting those addresses with information from the @b{BBDB}. Replacement
2075 information is first sought from the @code{mail-name} field in the respective
2076 @b{BBDB} records.  If no such field is found, the @code{name} field is
2077 returned.  If no @b{BBDB} record is found, no rewriting is performed.
2078
2079 The @b{BBDB}-Reportmail augmentation is accomplished through the advising of
2080 the Reportmail @code{display-time-get-field} function in order to do
2081 a-posteriori modification of the returned value.  The augmentation uses the
2082 @code{bbdb/reportmail-alternate-full-name} function to retrieve data from the
2083 @b{BBDB} for use in rewriting.
2084
2085 @node Using Supercite, Using Web Browsers, Using Reportmail, Other Packages
2086 @subsection Using the @b{BBDB} with Supercite
2087
2088 @c <rewrite>
2089
2090 The @b{BBDB} can be used with Supercite to store attributions with @b{BBDB}
2091 records.  Normally, when a non-default attribution is entered for a given
2092 message, the entered attribution is used for that message, and is then
2093 discarded.  When the @b{BBDB}-Supercite augmentation is enabled, the
2094 non-default attribution will be added to the record (if any) for the entity
2095 being cited.  This poor explanation sounds complicated, but it's not.  If a
2096 message from @samp{Jamie Zawinski <jwz@@netscape.com>} is being replied to,
2097 Supercite will, by default, suggest the citation @samp{Jamie}.  If the
2098 non-default citation @samp{jwz} is entered, Supercite can save it with the
2099 @b{BBDB} record for @samp{Jamie Zawinski} in the @code{attribution} field.
2100
2101 @c </rewrite>
2102
2103 The field used can be changed by changing the value of
2104 @code{bbdb/sc-attribution-field}.
2105
2106 @node Using Web Browsers,  , Using Supercite, Other Packages
2107 @subsection Using the @b{BBDB} with Web Browsers
2108
2109 The @b{BBDB}/Web Browser integration is in two parts, one which is
2110 automatically enabled, and one which must be manually enabled (@pxref{Web
2111 Browser Prep}).  The first feature added is the ability to display the URL
2112 associated with a given record in a Web Browser.  The second is the ability to
2113 add URLs to @b{BBDB} records from within W3, the Emacs Web Browser.
2114
2115 Pressing @kbd{W} in the @code{*BBDB*} buffer while the cursor is positioned
2116 over a record with a @code{www} field will cause the first URL in the field to
2117 be loaded in a Web Browser.  This functionality uses @code{browse-url} to
2118 display URLs - see the documentation for @code{browse-url} for information on
2119 selecting the browser to be used.
2120
2121 If W3 is used, and if the @b{BBDB}/W3 functionality has been enabled as
2122 described in @ref{Web Browser Prep}, pressing the @kbd{:} key will add the URL
2123 currently being displayed in W3 to a user-specified @b{BBDB} record.
2124
2125 @node Options, Utilities, Other Packages, Top
2126 @section Options
2127
2128 There are many variables which control the behavior of the Insidious Big
2129 Brother Database, and there are many hook-variables which can be used to
2130 modify its behavior in more complex ways.  Several pieces of functionality
2131 are included which use the hooks in this way. @refill
2132
2133 @menu
2134 * Customization Parameters::    Customization Parameters
2135 * Customization Hooks::         Customization Hooks
2136 * Predefined Hooks::            Predefined Hooks
2137 @end menu
2138
2139 @node Customization Parameters, Customization Hooks, Options, Options
2140 @subsection Customization Parameters
2141
2142 @table @code
2143 @item bbdb-file
2144 @vindex bbdb-file
2145 The name of the file which contains your personal database.  Default:
2146 @file{~/.bbdb}.
2147
2148 @item bbdb-default-area-code
2149 @vindex bbdb-default-area-code
2150 @cindex Phone numbers
2151 The default area code to use when prompting for a new phone number.
2152 Default: 415.  This must be a number, not a string.@refill
2153
2154 @item bbdb-north-american-phone-numbers-p
2155 @vindex bbdb-north-american-phone-numbers-p
2156 @cindex North American phone numbers
2157 @cindex European phone numbers
2158 Whether syntax-checking of phone numbers should be enforced.  Default:
2159 @code{t}.  This only works for Bell-system phone numbers.  If this is true,
2160 then you can't enter invalid phone numbers, and all phone numbers are
2161 pretty-printed in the same way.  European phone numbers don't have as
2162 strict a syntax, however, so this is a harder problem for them (on which
2163 I am punting). @refill
2164
2165 You can have both styles of phone number in your database by providing a
2166 prefix argument to the @code{bbdb-insert-new-field} command. @refill
2167
2168 @item bbdb-check-zip-codes-p
2169 @vindex bbdb-check-zip-codes-p
2170 @vindex bbdb-legal-zip-codes
2171 @cindex Zip code checking 
2172 @cindex Checking zip codes
2173 @cindex Invalid zip codes
2174 @cindex Not a valid zip code
2175 @cindex List of valid zip codes
2176 @cindex Valid zip codes
2177 Whether syntax-checking of zip codes should be enforced.  Default:
2178 @code{t}.  If this is true, you can't enter invalid zip codes.  A zip
2179 code is valid if it matches one of the regular expressions in the
2180 variable @code{bbdb-legal-zip-codes}. @refill
2181
2182 @item bbdb-address-formatting-alist
2183 @vindex bbdb-address-formatting-alist
2184 @cindex Formatting addresses
2185 @cindex Display of addresses
2186 @cindex Address display
2187 Controls the display of addresses in the buffer.  Each entry in this
2188 list consists of an identifying function and a formatting function.
2189 The identifying function must accept an address and return @code{t} if
2190 the associated formatting function is to be used.  The formatting
2191 function must insert the formatted address in the current buffer.
2192 Identifying functions usually base their decision on the zip code
2193 format or on the country name.  The default entries will format an
2194 address using continental style if the zip code matches
2195 @code{bbdb-continental-zip-regexp}.  If the zip code does not match,
2196 addresses are formatted in US style.
2197
2198 @item bbdb-continental-zip-regexp
2199 @vindex bbdb-continental-zip-regexp
2200 @cindex Continental addresses
2201 @cindex European addresses
2202 Decides whether an address should be formatted using US or European
2203 style.  If the zip code of an address matches the regular expression,
2204 the European style is used.  This works only if the expression
2205 @code{(bbdb-address-is-continental . bbdb-format-address-continental)}
2206 is part of @code{bbdb-address-formatting-alist}.
2207
2208 @item bbdb-electric-p
2209 @vindex bbdb-electric-p
2210 @cindex Electric display
2211 Whether bbdb mode should be @i{``electric''} like @code{electric-buffer-list}.
2212 Default: @code{t}.  What this means is that the BBDB buffer which pops
2213 up when you use it can be disposed of by pressing the space bar, at
2214 which point your window configuration will be restored to what it was
2215 before you invoked the db list.  (The @code{bbdb-mode} commands still
2216 work as well.) @refill
2217
2218 There are some problems with electric modes; for example, keyboard
2219 macros and incremental search don't work.  (This is not a bug in BBDB,
2220 but in @file{electric.el}.)@refill
2221
2222 @item bbdb-case-fold-search
2223 @vindex bbdb-case-fold-search
2224 Default: the same as @code{case-fold-search}.  @code{case-fold-search} is
2225 bound to this by @w{@kbd{M-x bbdb}} and related commands.  This variable lets
2226 the case-sensitivity of @kbd{^S} and of the bbdb searching commands be
2227 different.
2228
2229 @item bbdb/mail-auto-create-p
2230 @vindex bbdb/mail-auto-create-p
2231 If this is @code{t} (the default), then @b{VM}, @b{MH}, and @b{RMAIL}
2232 will automatically create new bbdb records for people you receive mail
2233 from.  If this variable is a function name or lambda expression, then it
2234 is called with no arguments to decide whether an entry should be
2235 automatically created.  You can use this to, for example, not create
2236 records for messages which have reached you through a particular mailing
2237 list, or to only create records automatically if the mail has a
2238 particular subject.  See the variables
2239 @code{bbdb-ignore-most-messages-alist} and
2240 @code{bbdb-ignore-some-messages-alist} (@xref{Predefined Hooks}.) @refill
2241
2242 @item bbdb/news-auto-create-p
2243 @vindex bbdb/news-auto-create-p
2244 @cindex Automatically creating records
2245 If this is @code{t} (default: @code{nil}), then @b{GNUS} will
2246 automatically create new @b{BBDB} records for people you read messages
2247 by.  If this is a function name or lambda expression, then it is called
2248 with no arguments to decide whether an entry should be automatically
2249 created.  You can use this to, for example, create or not create
2250 messages which have a particular subject.  See the variable
2251 @code{bbdb-auto-notes-alist} (@xref{Predefined Hooks}.). @refill
2252
2253 If you want to autocreate messages based on the current newsgroup, it's
2254 probably a better idea to set this variable to @code{t} or @code{nil} from your
2255 @code{gnus-select-group-hook} instead. @refill
2256
2257 To automatically remember users in certain groups, you can do something
2258 like @refill
2259 @example
2260 @exdent (setq gnus-select-group-hook
2261 @exdent   '(lambda ()
2262 @exdent      (setq bbdb/news-auto-create-p
2263 @exdent            (or (string= "some.news.group" gnus-newsgroup-name)
2264 @exdent                (string= "other.news.group" gnus-newsgroup-name)))))
2265 @end example
2266
2267 @item bbdb-quiet-about-name-mismatches
2268 @vindex bbdb-quiet-about-name-mismatches
2269 If this is false (the default), then @b{BBDB} will prompt you when it notices a
2270 name change, that is, when the ``real name'' in a message doesn't correspond
2271 to a record already in the database with the same network address.  As in,
2272 @w{@i{``John Smith <jqs@@frob.com>''}} versus
2273 @w{@i{``John Q. Smith <jqs@@frob.com>''.}}  If this is true, then you will
2274 not be asked if you want to change it (and it will not be changed.)
2275 If a number then it is the number of seconds to sit-for while
2276 displaying the name mismatch.
2277 @refill
2278
2279 @item bbdb-use-alternate-names
2280 @vindex bbdb-use-alternate-names
2281 @cindex Alternate names
2282 @cindex AKA
2283 If this is false, then the @b{BBDB} will not use the @b{AKA} field.
2284 Otherwise (the default) then the mail and news interfaces will ask you
2285 if you want to add an alternate name when a name-change is noticed, and
2286 will ask you whether the new name should be made the primary one.
2287 Note that if @code{bbdb-quiet-about-name-mismatches} is true, you will
2288 not be asked any questions about alternate names.
2289
2290 @item bbdb-readonly-p
2291 @vindex bbdb-readonly-p
2292 If this is true (default: @code{nil}), then nothing will attempt to change the
2293 database implicitly, and you will be prevented from doing it
2294 explicitly.  If you have more than one emacs running at the same time,
2295 you might want to arrange for this to be set to @code{t} in all but one of
2296 them. @refill
2297
2298 @item bbdb-auto-revert-p
2299 @vindex bbdb-auto-revert-p
2300 If this variable is true (default: @code{nil}) and the @b{BBDB} file is noticed to
2301 have changed on disk, it will be automatically reverted without
2302 prompting you first.  Otherwise you will be asked.  (But if the file has
2303 changed and you have made changes in memory as well, you will always be
2304 asked.) @refill
2305
2306 @item bbdb-notice-auto-save-file
2307 @vindex bbdb-notice-auto-save-file
2308 @cindex Auto-save files
2309 If this is true (default: @code{nil}), then the @b{BBDB} will notice when its
2310 auto-save file is newer than the file is was read from, and will offer
2311 to revert. @refill
2312
2313 @item bbdb-use-pop-up
2314 @vindex bbdb-use-pop-up
2315 @cindex Automatic display of the corresponding record
2316 If true (the default), display a continuously-updating @b{BBDB}
2317 window while in @b{VM}, @b{MH}, @b{RMAIL}, or @b{GNUS}.
2318 Each time a new message is selected, the record corresponding to
2319 that message's sender will be displayed in another window.  The
2320 buffer in this other window will be in bbdb-mode, and all
2321 corresponding commands will be available. @refill
2322
2323 This buffer will be positioned on the screen by finding the tallest
2324 of the windows present, and splitting it such that the bottom
2325 @code{bbdb-pop-up-target-lines} lines of the window display the
2326 @samp{*BBDB*} buffer.  With the default configurations of @b{VM},
2327 @b{MH}, @b{RMAIL}, and @b{GNUS}, this means that the bbdb-list
2328 buffer will be just below the message-body buffer. @refill
2329
2330 If this is the symbol @code{horiz}, then the @b{BBDB} window will be
2331 stacked horizontally instead of vertically, if there is room to do that
2332 tastefully. @refill
2333
2334 @item bbdb-pop-up-target-lines
2335 @vindex bbdb-pop-up-target-lines
2336 Desired number of lines in a @b{VM/MH/RMAIL/GNUS} pop-up @b{BBDB} window,
2337 default 5. @refill
2338
2339 @item bbdb-completion-type
2340 @vindex bbdb-completion-type
2341 @cindex Completion
2342 @cindex Name completion
2343 @cindex Mail address completion
2344 @cindex Address completion
2345 Controls the behavior of the @code{bbdb-complete-name} command.  If @code{nil}
2346 (the default), completion is done across the set of all full-names and
2347 user-ids in the database; if the symbol @code{name}, completion is
2348 done on real-names only; if the symbol @code{net}, completion is done
2349 on network addresses only; if it is @code{primary}, then completion is
2350 done only across the set of primary network addresses (the first address
2351 in the list of addresses for a given user).  If it is
2352 @code{primary-or-name}, completion is done across primaries and real
2353 names. @refill
2354
2355 @item bbdb-expand-mail-aliases
2356 @vindex bbdb-expand-mail-aliases
2357 @cindex Completion
2358 @cindex Name completion
2359 @cindex Mail address completion
2360 @cindex Address completion
2361 If non-nil, expand mail aliases in `bbdb-complete-name'.
2362 @refill
2363
2364 @item bbdb-complete-name-allow-cycling
2365 @vindex bbdb-complete-name-allow-cycling
2366 @cindex Completion
2367 @cindex Name completion
2368 @cindex Mail address completion
2369 @cindex Address completion
2370 Whether to allow cycling of email addresses when calling
2371 `bbdb-complete-name' on a completed address in a composition buffer."
2372 @refill
2373
2374 @item bbdb-complete-name-full-completion
2375 @vindex bbdb-complete-name-full-completion
2376 @cindex Completion
2377 @cindex Name completion
2378 @cindex Mail address completion
2379 @cindex Address completion
2380 Show full expanded completion rather than partial matches.
2381 If t then do it always, if a number then just is the number of
2382 completions for a specific match is below that number.
2383 @refill
2384
2385 @item bbdb-user-mail-names
2386 @vindex bbdb-user-mail-names
2387 A regular expression identifying the addresses that belong to you.  If a
2388 message from an address matching this is seen, the @b{BBDB} record for the
2389 @samp{To:} line will be shown instead of the one for the @samp{From:}
2390 line.  If this is @code{nil}, it will default to the value of
2391 @code{(user-login-name)}. @refill
2392
2393 @item bbdb-always-add-addresses
2394 @vindex bbdb-always-add-addresses
2395 If this is @code{t}, then whenever the Insidious Big Brother Database
2396 notices a new email address corresponding to a person who is in the
2397 database, it will add it to the database.  If this is @code{nil} (the
2398 default), then whenever a new network address is noticed for a person in
2399 the database, you will be asked whether to add the address.  If this is
2400 the symbol @code{never} (really if it is not @code{t} and not @code{nil})
2401 then new network addresses will never be automatically added. @refill
2402
2403 @item bbdb-new-nets-always-primary
2404 @vindex bbdb-new-nets-always-primary
2405 If this is @code{t}, then when the Insidious Big Brother Database adds a new
2406 address to a record, it will always add it to the front of the list of
2407 addresses, making it the primary address.  If this is @code{nil} (the default),
2408 then you will be asked.  If this is the symbol @code{never} (really if
2409 it is not @code{t} and not @code{nil}) then new network addresses will
2410 always be added to the end of the list. @refill
2411
2412 @item bbdb-canonicalize-redundant-nets-p
2413 @vindex bbdb-canonicalize-redundant-nets-p
2414 If this is non-@code{nil}, redundant network addresses will be ignored.
2415 If a record has an address of the form @code{foo@@baz.com}, setting this
2416 to @code{t} will cause subsequently-noticed addresses
2417 like @code{foo@@bar.baz.com} to be ignored (since we already have a more
2418 general form of that address.)  This is similar in function to one of
2419 the possible uses of the variable @code{bbdb-canonicalize-net-hook}
2420 but is somewhat more automatic.  (This can't quite be implemented in
2421 terms of the canonicalize-net-hook because it needs access to the
2422 database to determine whether an address is redundant, and the
2423 canonicalize-net-hook is purely a textual manipulation which is
2424 performed before any database access.)
2425
2426 @item bbdb-message-caching-enabled
2427 @vindex bbdb-message-caching-enabled
2428 Whether caching of the message->bbdb-record association should be
2429 used for the interfaces which support it (@b{VM}, @b{MH}, and
2430 @b{RMAIL}).  This can speed things up a lot.  One implication of
2431 this variable being true (the default) is that the
2432 @code{bbdb-notice-hook} will not be called each time a message is
2433 selected, but only the first time.  Likewise, if selecting a message
2434 would generate a question (whether to add an address, change the
2435 name, etc) you will only be asked that question the very first time
2436 the message is selected. @refill
2437
2438 @item bbdb-offer-save
2439 @vindex bbdb-offer-save
2440 If @code{t} (the default), then certain actions will cause the @b{BBDB} to
2441 ask you whether you wish to save the database.  If @code{nil}, then the
2442 offer to save will never be made.  If not @code{t} and not @code{nil}, then
2443 any time it would ask you, it will just save it without asking. @refill
2444
2445 @end table
2446
2447 @node Customization Hooks, Predefined Hooks, Customization Parameters, Options
2448 @subsection Customization Hooks
2449
2450 All of the hooks variables described below may be set to a symbol or
2451 lambda expression, which will be funcalled; or may be set to a list of
2452 symbols or lambda expressions, each of which will be funcalled in turn.
2453 Almost all hooks in Emacs work this way.  But notice that some of the
2454 hooks described below are called with arguments.
2455
2456 @table @code
2457 @item bbdb-list-hook
2458 @vindex bbdb-list-hook
2459 Hook or hooks invoked after the bbdb-list-buffer is filled in.  Invoked
2460 with no arguments. @refill
2461
2462 @item bbdb-create-hook
2463 @vindex bbdb-create-hook
2464 Hook or hooks invoked each time a new bbdb-record is created.  Invoked
2465 with one argument, the new record.  This is called @emph{before} the record is
2466 added to the database.  Note that @code{bbdb-change-hook} will be called as
2467 well. @refill
2468
2469 @item bbdb-change-hook
2470 @vindex bbdb-change-hook
2471 Hook or hooks invoked each time a bbdb-record is altered.  Invoked with
2472 one argument, the record.  This is called @emph{before} the database buffer
2473 is modified.  Note that if a new bbdb record is created, both this hook and
2474 @code{bbdb-create-hook} will be called. @refill
2475
2476 @item bbdb-mode-hook
2477 @vindex bbdb-mode-hook
2478 Hook or hooks invoked when the @samp{*BBDB*} buffer is created.
2479
2480 @item bbdb-notice-hook
2481 @vindex bbdb-notice-hook
2482 Hook or hooks invoked each time a bbdb-record is ``noticed,'' that
2483 is, each time it is displayed by the news or mail interfaces.
2484 Invoked with one argument, the new record.  The record need not have
2485 been modified for this to be called - use @code{bbdb-change-hook} for that.
2486 You can use this to, for example, add something to the notes field
2487 based on the subject of the current message.  It is up to your hook
2488 to determine whether it is running in @b{GNUS}, @b{VM},
2489 @b{MH}, or @b{RMAIL}, and to act appropriately. @refill
2490
2491 Also note that @code{bbdb-change-hook} will @emph{not} be called as a
2492 result of any modifications you may make to the record inside this
2493 hook. @refill
2494
2495 Beware that if the variable @code{bbdb-message-caching-enabled} is
2496 true (a good idea) then when you are using @b{VM}, @b{MH}, or
2497 @b{RMAIL}, this hook will be called only the first time that
2498 message is selected.  (The @b{GNUS} interface does not use caching.)
2499 When debugging the value of this hook, it is a good idea to set
2500 caching-enabled to @code{nil}. @refill
2501
2502 @item bbdb-after-read-db-hook
2503 @vindex bbdb-after-read-db-hook
2504 Hook or hooks invoked (with no arguments) just after the Insidious Big
2505 Brother Database is read in.  Note that this can be called more than once if
2506 the @b{BBDB} is reverted.  One possible use for this is to rename the
2507 @file{.bbdb} buffer; for example @refill
2508
2509 @code{(setq bbdb-after-read-db-hook '(lambda () (rename-buffer " bbdb")))}
2510
2511 @noindent
2512 will cause the buffer visiting the @code{bbdb-file} to be
2513 called @w{@code{" bbdb"}}.  The leading space in its name will prevent
2514 it from showing up in the buffer list.
2515
2516 @item bbdb-load-hook
2517 @vindex bbdb-load-hook
2518 Hook or hooks invoked (with no arguments) when the Insidious Big Brother
2519 Database code is first loaded.  WARNING:  Slow functions should not be
2520 put on this hook, as the @b{BBDB} code will, if not loaded before, be
2521 loaded during the first use of @b{BBDB}-related Customization
2522 functions.  Slow functions should be put on @code{bbdb-initialize-hook}.
2523
2524 @item bbdb-initialize-hook
2525 @vindex bbdb-initialize-hook
2526 @findex bbdb-initialize
2527 Hook or hooks invoked (with no arguments) when the
2528 @code{bbdb-initialize} function is called.
2529
2530 @item bbdb-canonicalize-net-hook
2531 @vindex bbdb-canonicalize-net-hook
2532 If this is non-@code{nil}, it should be a function of one argument: a
2533 network address string.  (Note that, unlike the other hook-variables
2534 described above, this may not be a list of functions.)  Whenever the
2535 Insidious Big Brother Database ``notices'' a message, the corresponding
2536 network address will be passed to this function first, as a kind of
2537 ``filter'' to do whatever transformations upon it you like before it is
2538 compared against or added to the database.  For example: it is the case
2539 that @code{CS.CMU.EDU} is a valid return address for all mail
2540 originating at a machine in the @code{.CS.CMU.EDU} domain.  So, if you
2541 wanted all such addresses to be canonically hashed as
2542 @code{user@@CS.CMU.EDU}, instead of as @code{user@@somehost.CS.CMU.EDU},
2543 you might set this variable to a function like this: @refill
2544
2545 @example
2546 (setq bbdb-canonicalize-net-hook
2547      '(lambda (addr)
2548         (cond ((string-match
2549                  "\\`\\([^@@]+@@\\).*\\.\\(CS\\.CMU\\.EDU\\)\\'"
2550                  addr)
2551                (concat (substring addr
2552                          (match-beginning 1) (match-end 1))
2553                        (substring addr
2554                          (match-beginning 2) (match-end 2))))
2555               (t addr))))
2556 @end example
2557
2558 You could also use this function to rewrite UUCP-style addresses into
2559 domain-style addresses, or any number of other things.@refill
2560
2561 This function will be called repeatedly until it returns a value EQ to the
2562 value passed in.  So multiple rewrite rules might apply to a single
2563 address.@refill
2564
2565 There is an example of the use of this variable in the
2566 file @file{bbdb-hooks.el}: the function
2567 @code{sample-bbdb-canonicalize-net-hook}.@refill
2568 @end table
2569
2570 @vindex bbdb-change-hook
2571 @findex bbdb-delete-redundant-nets
2572 The @code{bbdb-canonicalize-net-hook} is powerful in that it allows
2573 arbitrary rewriting of addresses, however, in many cases that is
2574 overkill.  The function @code{bbdb-delete-redundant-nets} can be
2575 used as a value of @code{bbdb-change-hook} to cause network addresses
2576 which appear to be ``redundant'' to be deleted each time a modification
2577 is made to a record. @refill
2578
2579 This works as follows: suppose one gets mail from @code{user@@foo.bar.com},
2580 and then later gets mail from @code{user@@bar.com}.  At this point, one
2581 can generally delete the @code{user@@foo.bar.com} address, since the
2582 @code{user@@bar.com} address is more general.  (See also the
2583 variable `bbdb-canonicalize-redundant-nets-p', which has the effect of
2584 ignoring subsequent addresses from @code{user@@quux.bar.com} if the
2585 address @code{user@@bar.com} is already known.)@refill
2586
2587 @node Predefined Hooks,  , Customization Hooks, Options
2588 @subsection Predefined Hooks
2589
2590 @findex bbdb-timestamp-hook
2591 @cindex Timestamping records
2592 If the variable @code{bbdb-change-hook} is set to the symbol
2593 @code{bbdb-timestamp-hook} (the default), then every record in the
2594 database will have a field named @samp{timestamp}, which will always
2595 contain the date and time at which this record was created or last
2596 modified.
2597
2598 @findex bbdb-creation-date-hook
2599 If the variable @code{bbdb-create-hook} is set to the symbol
2600 @code{bbdb-creation-date-hook} (the default), then every record in the
2601 database will have a field named @samp{creation-date}, which will
2602 contain the date and time at which this record was added to the
2603 database.
2604
2605 @findex bbdb-ignore-most-messages-hook
2606 @vindex bbdb-ignore-most-messages-alist
2607 @cindex Automatically creating records
2608 If the variable @code{bbdb/mail-auto-create-p} is set to the symbol
2609 @code{bbdb-ignore-most-messages-hook}, then the variable
2610 @code{bbdb-ignore-most-messages-alist} will determine which messages
2611 should have records automatically created for them.  The format of this
2612 alist is @refill
2613 @example
2614 (( @var{HEADER-NAME} . @var{REGEXP} ) @dots{} )
2615 @end example
2616 @noindent
2617 for example,
2618 @example
2619 (("From" . "@@.*\\.maximegalon\\.edu")
2620  ("Subject" . "time travel"))
2621 @end example
2622
2623 @noindent
2624 will cause @b{BBDB} entries to be made only for messages sent by
2625 people at Maximegalon U., or (that's @emph{or}) people posting
2626 about time travel. @refill
2627
2628 There may be only one entry per header in this alist: that is, @refill
2629
2630 @example
2631 (("From" . "addr1\\|addr2") @dots{} )
2632 @end example
2633
2634 @noindent
2635 is legal, but
2636
2637 @example
2638 (("From" . "addr1") ("From" . "addr2") @dots{} )
2639 @end example
2640
2641 @noindent
2642 is not.
2643
2644 @vindex bbdb/mail-auto-create-p
2645 @vindex bbdb/news-auto-create-p
2646 @findex bbdb-ignore-some-messages-hook
2647 @vindex bbdb-ignore-some-messages-alist
2648 If the variable @code{bbdb/mail-auto-create-p} is set to the symbol
2649 @code{bbdb-ignore-some-messages-hook}, then the variable
2650 @code{bbdb-ignore-some-messages-alist} will determine which messages
2651 should have records automatically created for them.  This is the exact
2652 inverse of the semantics of the @code{bbdb-ignore-most-messages-alist}:
2653 the alist specifies which messages should @emph{not} have records
2654 automatically created for them, instead of which should.  For
2655 example, @refill
2656
2657 @example
2658 (("From" . "mailer.daemon")
2659  ("To" . "mailing-list-1\\|mailing-list-2")
2660  ("CC" . "mailing-list-1\\|mailing-list-2"))
2661 @end example
2662
2663 @noindent
2664 will cause @b{BBDB} entries to not be made for messages from any mailer daemon,
2665 or messages sent to or @b{CC}ed to either of two mailing lists. @refill
2666
2667 The variable @code{bbdb/news-auto-create-p} may be set to either of the
2668 above-mentioned functions as well, to get this behavior for netnews
2669 messages instead of mail messages.@refill
2670
2671 @vindex bbdb-notice-hook
2672 @vindex bbdb-auto-notes-alist
2673 @cindex Automatically adding text to records
2674 If the variable @code{bbdb-notice-hook} is set to the symbol
2675 @code{bbdb-auto-notes-hook}, then the variable @code{bbdb-auto-notes-alist}
2676 may be used to automatically add text to the notes fields of the records
2677 corresponding to certain messages.  The format of this alist is @refill
2678
2679 @example
2680 (( @var{HEADER-NAME}
2681    (@var{REGEXP} . @var{STRING}) @dots{} )
2682     @dots{} )
2683 @end example
2684
2685 @noindent
2686 for example,
2687
2688 @example
2689 (("To" ("-vm@@" . "VM mailing list"))
2690  ("Subject" ("sprocket" . "mail about sprockets")
2691             ("you bonehead" . "called me a bonehead")))
2692 @end example
2693
2694 @noindent
2695 will cause the text @code{"VM mailing list"} to be added to the notes field of
2696 the record corresponding to anyone you get mail from via one of the @b{VM}
2697 mailing lists.  If, that is, @code{bbdb/mail-auto-create-p} is set such
2698 that the record would have been created, or if the record already
2699 existed.@refill
2700
2701 The format of elements of this list may also be
2702
2703 @example
2704 (@var{REGEXP} @var{FIELD-NAME} @var{STRING})
2705 @end example
2706 @noindent
2707 or
2708 @example
2709 (@var{REGEXP} @var{FIELD-NAME} @var{STRING} @var{REPLACE-P})
2710 @end example
2711
2712 @noindent
2713 meaning add the given string to the named field.  The field-name may not
2714 be @samp{name}, @samp{aka}, @samp{address}, @samp{phone}, or @samp{net}
2715 (builtin fields) but must be either @samp{notes}, @samp{company}, or the
2716 name of a user-defined note-field. @refill
2717
2718 @example
2719 ("pattern" . "string to add")
2720 @end example
2721
2722 @noindent
2723 is equivalent to
2724
2725 @example
2726 ("pattern" notes "string to add")
2727 @end example
2728
2729 @noindent
2730 @var{STRING} can contain @code{\&} or @code{\N} escapes like in the function
2731 @code{replace-match}.  For example, to automatically add the contents of the
2732 @b{organization} field of a message to the @code{company} field of a @b{BBDB}
2733 record, you can use this: @refill
2734
2735 @example
2736 ("Organization" (".*" company "\\&"))
2737 @end example
2738
2739 @noindent
2740 (Note you need two \ to get a single \ into a lisp string literal.)
2741
2742 If STRING is an integer @i{N}, the @i{N}th matching subexpression is
2743 used, so the above example could be written more efficiently as @refill
2744
2745 @example
2746 ("Organization" (".*" company 0))
2747 @end example
2748
2749 If STRING is neither a string or an integer, it should be a function
2750 which is called with the contents of the field, and the result of the
2751 function call is used.
2752
2753 If the @var{REPLACE-P} flag is true, then the string replaces the old
2754 contents instead of being appended to it.
2755
2756 If multiple clauses match the message, all of the corresponding strings
2757 will be added. @refill
2758
2759 If the string is being appended (@var{REPLACE-P} is false or not
2760 provided) then the new string is appended to the end of the existing
2761 field value, with an intervening newline.  So each piece of text
2762 automatically added to this field will go on its own line. @refill
2763
2764 You can control what the separator is by putting a @code{field-separator}
2765 property on the symbol naming the field.  For example, to make text
2766 automatically added to a field named @code{newsgroups} be separated by
2767 commas, you could do @refill
2768
2769 @example
2770 (put 'newsgroups 'field-separator "; ")
2771 @end example
2772
2773 This variable works for news as well.  You might want to arrange for
2774 this to have a different value when in mail as when in news. @refill
2775
2776 There may be only one entry per header in this alist: that is,@refill
2777
2778 @example
2779  (("Subject" ("\\bfoo\\b" . "Foo!!")
2780              ("bar" . "Bar!")))
2781 @end example
2782
2783 @noindent
2784 will work, but
2785
2786 @example
2787  (("Subject" ("\\bfoo\\b" . "Foo!!"))
2788   ("Subject" ("bar" . "Bar!")))
2789 @end example
2790
2791 @noindent
2792 will not.
2793
2794 Here's a more complicated example: some people include bitmaps of
2795 themselves in their mail messages in an @b{X-Face:} header field.
2796 You can capture this field into the @samp{*BBDB*} with the
2797 following:
2798
2799 @example
2800 (setq bbdb-auto-notes-alist
2801       (append bbdb-auto-notes-alist
2802               (list "x-face"
2803                     (list (concat "[ \t\n]*\\([^ \t\n]*\\)"
2804                                   "\\([ \t\n]+\\([^ \t\n]+\\)\\)?"
2805                                   "\\([ \t\n]+\\([^ \t\n]+\\)\\)?"
2806                                   "\\([ \t\n]+\\([^ \t\n]+\\)\\)?"
2807                                   )
2808                           'face
2809                           "\\1\\3\\5\\7"))))
2810 @end example
2811
2812 @noindent
2813 (The calls to @code{list} and @code{concat} are just for readability, it
2814 could easily be a constant.)  The tricky bit here is that it strips out
2815 the newlines and whitespace used for header continuation, which are not
2816 actually a part of the face data.  So though the mail message may have
2817 the face data on multiple lines, the entry in the @samp{*BBDB*} will
2818 be just one line.
2819
2820 @vindex bbdb-auto-notes-ignore
2821 @code{bbdb-auto-notes-ignore} is an alist of headers and regexps to
2822 ignore in @code{bbdb-auto-notes-hook}.  Each element looks like @refill
2823
2824 @example
2825 (@var{HEADER} . @var{REGEXP})
2826 @end example
2827
2828 @noindent
2829 for example,
2830
2831 @example
2832 ("Organization" . "^Gatewayed from\\|^Source only")
2833 @end example
2834
2835 @noindent
2836 would exclude the phony @code{Organization:} headers in GNU mailing-lists
2837 gatewayed to the @code{gnu.*} newsgroups.  Note that this exclusion
2838 applies only to a single field, not to the entire message.  For that,
2839 use the variable @code{bbdb-auto-notes-ignore-all}.
2840
2841 @vindex bbdb-auto-notes-ignore-all
2842 @code{bbdb-auto-notes-ignore-all} is an alist of headers and regexps
2843 which cause the entire message to be ignored in @code{bbdb-auto-notes-hook}.
2844 Each element looks like @refill
2845
2846 @example
2847 (@var{HEADER} . @var{REGEXP})
2848 @end example
2849
2850 @noindent
2851 for example,
2852
2853 @example
2854 ("From" . "BLAT\\.COM")
2855 @end example
2856
2857 @noindent
2858 would exclude any notes recording for message coming from @code{BLAT.COM}.
2859 Note that this is different from @code{bbdb-auto-notes-ignore}, which
2860 applies only to a particular header field, rather than the entire message.
2861
2862 @node Utilities, Internals, Options, Top
2863 @section Utilities
2864
2865 This section describes @b{BBDB} functionality that does not fit neatly into
2866 other sections.
2867
2868 @menu
2869 * bbdb-ftp::                    Storing FTP sites in the @b{BBDB}
2870 * bbdb-print::                  Print the @b{BBDB}
2871 * bbdb-snarf::                  Record generation from raw text
2872 * bbdb-srv::                    External control of the @b{BBDB}
2873 @end menu
2874
2875 @node bbdb-ftp
2876 @subsection @code{bbdb-ftp}
2877 @cindex Storing FTP sites in the BBDB
2878 @findex bbdb-ftp
2879
2880 The @code{bbdb-ftp} utility enables the storage of FTP sites as @b{BBDB}
2881 records.  The @code{bbdb-create-ftp-site} function is used to create a
2882 @b{BBDB} record for an FTP site.  The command will prompt for information
2883 needed to create the record.  The FTP site for a given record can be accessed
2884 with the @code{bbdb-ftp} command.
2885
2886 @node bbdb-print, bbdb-snarf, bbdb-ftp, Utilities
2887 @subsection @code{bbdb-print}
2888 @cindex Printing records in the database
2889 @findex bbdb-print
2890
2891 @code{bbdb-print} is a utility for pretty-printing entries from the @b{BBDB}
2892 using TeX.  It is invoked by pressing @kbd{P} in the @code{*BBDB*} buffer -
2893 this will cause all records in the @b{BBDB} to be printed as governed by the
2894 variables described below.  If @kbd{P} is prefixed by a @kbd{*}, only the
2895 currently-displayed records will be printed.  Once invoked, @code{bbdb-print}
2896 will generate the TeX output in a buffer named @file{~/bbdb.tex} (controlled
2897 by @code{bbdb-print-file-name}).  The generated output will be shown, and must
2898 be @b{manually} saved.
2899
2900 For each record printed, @code{bbdb-print} will look for the presence of the
2901 @code{tex-name} field.  If this field is found, its value will be printed
2902 instead of the @code{name} field for the record in question.  This field is
2903 intended to allow the storage of names with accents or other characters that
2904 would be illegal in the address portion of a message.  While other fields have
2905 special characters quoted by @code{bbdb-print} as described below, the
2906 contents of the @code{tex-name} field (if present) are used verbatim.
2907
2908 The following variables govern the printing of records (and of the printing of
2909 the fields therein):
2910
2911 @table @code
2912 @item bbdb-print-omit-fields
2913 @vindex bbdb-print-omit-fields
2914 This variable should be set to a list of the fields that are not to be printed
2915 by @code{bbdb-print}.  It defaults to:@*
2916 @center @code{(omit tex-name aka mail-alias)}
2917
2918 @item bbdb-print-file-name
2919 @vindex bbdb-print-file-name
2920 The name of the file where generated TeX output is to be stored.  The default
2921 is @file{~/bbdb.tex}.
2922
2923 @item bbdb-print-require
2924 @vindex bbdb-print-require
2925 The fields required for printing a record.  This allows, for example, only
2926 records with phone numbers to be printed.  The value of the value of the
2927 variable will be evaluated once for each record, and the record will be
2928 printed only if the evaluation returns a non-nil value.  The symbols
2929 @code{name}, @code{company}, @code{net}, @code{phone}, @code{address}, and
2930 @code{notes} will be set to the appropriate values during evaluation; they
2931 will be nil if the field does not exist or is elided.
2932
2933 The value of this variable can be any lisp expression, but typically
2934 it will be used for a boolean combination of the field variables, as
2935 in the following simple examples:
2936
2937 @itemize @bullet
2938 @item Print only people whose phone numbers are known:@*
2939 @center @code{(setq bbdb-print-require 'phone)}
2940 @item Print people whose names AND companies are known:@*
2941 @center @code{(setq bbdb-print-require '(and name company))}
2942 @item Print people whose names, and either addresses OR phone numbers are
2943 known:@*
2944 @center @code{(setq bbdb-print-require '(and name (or address phone))).}
2945
2946 The default value is:@*
2947 @center @code{(or address phone)}
2948 @end itemize
2949
2950 @item bbdb-print-alist
2951 @vindex bbdb-print-alist
2952 Formatting options for all formats of @code{bbdb-print}.  The value is an
2953 alist of the form@*
2954 @center @code{((@var{OPTION} . @var{VALUE}) (@var{OPTION} . @var{VALUE}) ...)}
2955
2956 Separate settings can be configured using @code{bbdb-print-brief-alist} and
2957 @code{bbdb-print-full-alist}.  Settings in these variables will override the
2958 ones in @code{bbdb-print-alist}.
2959
2960 The possible options and legal settings are:
2961 @table @code
2962 @item columns
2963 @code{1}, @code{2}, @code{3}, @code{4}, @code{quad} (4 little
2964 2-column pages per sheet) or @code{grid} (12 credit-card-sized pages per
2965 sheet).
2966
2967 @item separator
2968 @code{0}-@code{7}, the style of heading for each letter.  @code{0}=none,
2969 @code{1}=line, @code{2}=boxed letters, @code{3}=large boxed letters,
2970 @code{4}=large letters, @code{5}=letters with lines, @code{6}=letters with
2971 suits, @code{7}=boxed letters with suits.
2972
2973 @item omit-area-code
2974 A regular expression matching area codes to omit.
2975
2976 @item phone-on-first-line
2977 If @code{t}, the first phone number will be put on the same line as the name.
2978 If @code{nil}, the name will be the only text on the line.  If set to a
2979 string, the field of type @code{phone} whose name matches the string will be
2980 used.  The string should be a valid regular expression.
2981
2982 @item n-phones
2983 Maximum number of phone numbers to include.
2984
2985 @item n-addresses
2986 Maximum number of addresses to include.
2987
2988 @item include-files
2989 List of TeX files to @code{\input}.  If the filenames are not absolute, the
2990 files must be located somewhere in the TeX input path.
2991
2992 @item ps-fonts
2993 Postscript fonts (TimesNewRoman and Courier) will be used if the value
2994 is non-@code{nil}.  Standard TeX fonts (ec-fonts) will be used
2995 otherwise.
2996
2997 @item font-size
2998 The integer point size of the font to be used.
2999
3000 @item hsize
3001 The horizontal dimension of the pages.  The value must be a string, and must
3002 be a valid TeX dimension.  Alternatively, the TeX default will be used if the
3003 value is @code{nil}.
3004
3005 @item vsize
3006 The vertical dimension of the pages.  The value must be a string, and must
3007 be a valid TeX dimension.  Alternatively, the TeX default will be used if the
3008 value is @code{nil}.
3009
3010 @item hoffset
3011 The TeX output will be offset to the right by the value of this option.  The
3012 value must be either a string containing a valid TeX dimension or @code{nil}
3013 or @code{0} to use the default TeX horizontal offset.
3014
3015 @item voffset
3016 The TeX output will be offset downward by the value of this option.  The
3017 value must be either a string containing a valid TeX dimension or @code{nil}
3018 or @code{0} to use the default TeX vertical offset.
3019
3020 @item quad-hsize
3021 Horizontal size to be used for the individual pages in the quad format.  The
3022 value must be a string containing a valid TeX dimension.
3023
3024 @item quad-vsize
3025 Vertical size to be used for the individual pages in the quad format.  The
3026 value must be a string containing a valid TeX dimension.
3027 @end table
3028
3029 The default value is
3030 @example
3031 ((omit-area-code . "(@var{AREA-CODE})")
3032  (phone-on-first-line . "^[ \t]*$")
3033  (ps-fonts . nil)
3034  (font-size . 6)
3035  (quad-hsize . "3.15in")
3036  (quad-vsize . "4.5in"))
3037 @end example
3038
3039 Where @var{AREA-CODE} is the value of @code{bbdb-default-area-code} or
3040 @samp{000} if there is no default area code.
3041
3042 @item bbdb-print-brief-alist
3043 @vindex bbdb-print-brief-alist
3044 Extra options for the @code{bbdb-print} brief format.  The value(s) of
3045 this variable can either supplement or override the values in
3046 @code{bbdb-print-alist}.  The format and possible values of this variable are
3047 as in @code{bbdb-print-alist}, described above.
3048
3049 The default value is
3050 @example
3051 ((columns . 1)
3052  (separator . 1)
3053  (n-phones . 2)
3054  (n-addresses . 1)
3055  (include-files "bbdb-print-brief" "bbdb-cols"))
3056 @end example
3057
3058 @item bbdb-print-full-alist
3059 @vindex bbdb-print-full-alist
3060 Extra options for the @code{bbdb-print} non-brief format.  The value(s) of
3061 this variable can either supplement or override the values in
3062 @code{bbdb-print-alist}.  The format and possible values of this variable are
3063 as in @code{bbdb-print-alist}, described above.
3064
3065 The default value is
3066 @example
3067 ((columns . 3)
3068  (separator . 2)
3069  (include-files "bbdb-print" "bbdb-cols"))
3070 @end example
3071
3072 @item bbdb-print-prolog
3073 @vindex bbdb-print-prolog
3074 TeX statements to include at the beginning of the @code{bbdb-print} output
3075 file.
3076
3077 @item bbdb-print-epilog
3078 @vindex bbdb-print-epilog
3079 TeX statements to include at the end of the @code{bbdb-print} output file.
3080
3081 @end table
3082
3083 @node bbdb-snarf, bbdb-srv, bbdb-print, Utilities
3084 @subsection @code{bbdb-snarf}
3085
3086 @code{bbdb-snarf} provides the ability to generate @b{BBDB} records from raw
3087 text.  If invoked as @code{bbdb-snarf}, it attempts to generate the record
3088 from the information around point (the cursor).  If invoked as
3089 @code{bbdb-snarf-region}@footnote{@code{bbdb-snarf} is actually a wrapper for
3090 @code{bbdb-snarf-region} that determines the relevant region and passes it
3091 on.}, the active region is used to generate the record.
3092
3093 @noindent
3094 @b{Restrictions:}
3095
3096 @enumerate
3097 @item
3098 @code{bbdb-snarf} currently recognizes only US-style phone numbers.
3099 @item
3100 @code{bbdb-snarf} works best with things that look like mailing addresses.
3101 @end enumerate
3102
3103 @noindent
3104 Example of an address that @code{bbdb-snarf} will recognize:
3105
3106 @example
3107 another test person
3108 1234 Gridley St.
3109 Los Angeles, CA 91342
3110 555-1212
3111 test@@person.net
3112 http://www.foo.bar/
3113 other stuff about this person
3114 @end example
3115
3116 @node bbdb-srv,  , bbdb-snarf, Utilities
3117 @subsection @code{bbdb-srv}
3118
3119 @code{bbdb-srv} provides the ability to initiate the display of @b{BBDB}
3120 records from outside of Emacs.  This allows external programs to cause
3121 the @b{BBDB} record for a given person to appear in the running Emacs
3122 when, for example, mail is recieved from that person.  One specific
3123 application, described below, is the integration of Netscape and the
3124 @b{BBDB}, allowing the display of @b{BBDB} records corresponding to Mail
3125 and/or News messages displayed in Netscape.
3126
3127 @code{bbdb-srv} is composed of two parts - an external Perl script
3128 (@file{utils/bbdb-srv.pl}), and an Emacs Lisp file
3129 (@file{lisp/bbdb-srv.el}).  The external portion is used to send
3130 commands to the internal portion.
3131
3132 @b{NOTE:} @code{bbdb-srv} requires @code{gnuserv} and @code{itimer},
3133 both included with XEmacs. @code{gnuserv} must be started with the
3134 @code{gnuserv-start} command before @code{bbdb-srv} can be used.
3135
3136 In it's most basic form, mail or news headers are passed to the Perl
3137 script.  The Perl script then causes the @b{BBDB} record (if any)
3138 corresponding to the passed headers to be displayed in the running
3139 Emacs.  While @code{bbdb-srv} will operate with just a @samp{From:}
3140 field, it works better when passed both @samp{From:} and @samp{To:}
3141 headers.  When @code{bbdb-srv} notices that the logged-in user is named
3142 in the @samp{From:} header, it will attempt to display the record (if
3143 any) for the person named in the @samp{To:} header.  If no @samp{To:}
3144 header is passed, it falls back on the record (if any) for the logged-in
3145 user (the person named in the @samp{From:} header).
3146
3147 An example manual invocation of @code{bbdb-srv} is as follows:
3148
3149 @example
3150 % cat |bbdb-srv.pl
3151 From: Jamie Zawinski <jwz@@netscape.com>
3152 To: Matt Simmons <simmonmt@@acm.org>
3153 @key{CTRL-D}
3154 @end example
3155
3156 If the invoking user is Jamie Zawinski, the record for Matt Simmons (if
3157 any) will be displayed.  If the invoking user is not Jamie Zawinski, the
3158 record for Jamie Zawinski (if any) will be displayed.
3159
3160 As mentioned above @code{bbdb-srv} can be used with Netscape Mail and
3161 Netscape News.  Please note that it can only be used with the UNIX
3162 versions 3.0b2 and greater of these applications.  To allow Netscape to
3163 use @code{bbdb-srv}, set the @samp{NS_MSG_DISPLAY_HOOK} variable to
3164 @code{bbdb-srv.pl}@footnote{Use the full path to @code{bbdb-srv.pl} if
3165 it is not in the default path.} as follows:
3166
3167 @noindent
3168 Bourne Shell (@file{/bin/sh}) and variants:
3169 @example
3170 # NS_MSG_DISPLAY_HOOK bbdb-srv.pl
3171 # export NS_MSG_DISPLAY_HOOK
3172 @end example
3173
3174 @noindent
3175 C-Shell (@file{/bin/csh}) and variants:
3176 @example
3177 % setenv NS_MSG_DISPLAY_HOOK bbdb-srv.pl
3178 @end example
3179
3180 The following variables can be used to customize the behavior of
3181 @code{bbdb-srv}:
3182
3183 @table @code
3184 @vindex bbdb/srv-auto-create-p
3185 @item bbdb/srv-auto-create-p
3186 This variable is similar to @code{bbdb/news-auto-create-p} and
3187 @code{bbdb/mail-auto-create-p}.  That is, when headers are passed in to
3188 @code{bbdb-srv}, a new @b{BBDB} record can be created if none exists,
3189 depending on the value of this variable.  Possible values are:
3190 @table @asis
3191 @item @code{t}
3192 Automatically create new @b{BBDB} records if the headers passed in do
3193 not correspond to an already-existing record.
3194 @item @code{nil}
3195 Do not automatically create new @b{BBDB} records.
3196 @item @var{FUNCTION}
3197 @var{FUNCTION} is called.  If it returns @code{t}, a record will be
3198 created for the person named in the @samp{From:} header.  If it returns
3199 @code{nil}, no record will be created.
3200
3201 A suggested function for use is
3202 @code{bbdb/srv-auto-create-mail-news-dispatcher}.  This function will
3203 attempt to determine the source of the passed headers - whether they
3204 were part of a mail message or of a news article.  The action (if any)
3205 dictated by the value of either @code{bbdb/mail-auto-create-p} or
3206 @code{bbdb/news-auto-create-p}, based on the determined source of the
3207 passed headers.
3208
3209 @end table
3210
3211 @vindex bbdb/srv-display-delay
3212 @item bbdb/srv/display-delay
3213 @code{bbdb-srv} pauses between displaying the records corresponding to
3214 each passed set of headers.  This variable controls the length of time
3215 (in seconds) of the delay between the display of different records.
3216 Note when setting this variable that only one set of headers can be
3217 queued at a time.  If three sets of headers are passed to
3218 @code{bbdb-srv} in less than the delay time, only the first and last
3219 will be displayed.
3220 @end table
3221
3222 @node Internals, Mailing Lists, Utilities, Top
3223 @section Internals
3224
3225 @b{This section is currently a dumping ground for things that should
3226 eventually go here, but were found elsewhere in the file.}
3227
3228 @b{INFORMATION IN THIS SECTION IS FOR INFORMATIONAL PURPOSES ONLY.  IT
3229 SHOULD NOT BE TAKEN AS DOCUMENTATION OF AN EXTERNAL API.  EVERYTHING
3230 LISTED BELOW IS SUBJECT TO CHANGE WITHOUT NOTICE}
3231
3232 The first time you use
3233 one of the @b{BBDB} commands, this file is read into an emacs buffer, and
3234 remains there.  As you make changes to the database, this buffer is
3235 changed as well, ensuring that if it is auto-saved, it will be saved in
3236 its most current state. @refill
3237
3238 @subsection BBDB data file format
3239
3240 The data file is arranged in a hierarchical fashion.  At the top level
3241 are vectors, with one vector per database record.  It is @b{very}
3242 important that each vector be on its own line, as the BBDB builds and
3243 stores markers based on this layout.  The markers are then used to
3244 increase the speed of database modifications (more on this later).  The
3245 record vectors contain the individual fields of the record.  These
3246 fields can be of any type, but are currently integers, strings, lists of
3247 strings, alists, vectors, or lists of vectors.  In the case of fields
3248 that contain one or more vectors, they can be further broken down in
3249 terms of the fields of their component vectors.
3250
3251 In an effort to provide a more concrete example to illustrate the above,
3252 and to provide a reference for database accessor and modifier functions,
3253 we describe the database format below.  This description starts with the
3254 fields of the individual record vectors, and drills down through the
3255 vectors used by some of the fields.
3256
3257 @subsubsection Record Vectors
3258
3259 @multitable @columnfractions .13 .19 .36 .32
3260 @item @b{Name}
3261 @tab  @b{Type}
3262 @tab  @b{Accessor and Modifier}
3263 @tab  @b{Description}
3264
3265 @item First name
3266 @tab  String
3267 @tab  @code{bbdb-record-firstname}@*
3268       @code{bbdb-record-set-firstname}
3269 @tab  Entity's first name
3270
3271 @item Last name
3272 @tab  String
3273 @tab  @code{bbdb-record-lastname}@*
3274       @code{bbdb-record-set-lastname}
3275 @tab  Entity's last name
3276
3277 @item AKAs
3278 @tab  List of Strings
3279 @tab  @code{bbdb-record-aka}@*
3280       @code{bbdb-record-set-aka}
3281 @tab  Alternate names for entity
3282
3283 @item Company
3284 @tab  String
3285 @tab  @code{bbdb-record-company}@*
3286       @code{bbdb-record-set-company}
3287 @tab  Company with which entity is associated
3288
3289 @item Phones
3290 @tab  List of Vectors
3291 @tab  @code{bbdb-record-phones}@*
3292       @code{bbdb-record-set-phones}
3293 @tab  List of phone number vectors
3294
3295 @item Addresses
3296 @tab  List of Vectors
3297 @tab  @code{bbdb-record-addresses}@*
3298       @code{bbdb-record-set-addresses}
3299 @tab  List of address vectors
3300
3301 @item Net address
3302 @tab  List of Strings
3303 @tab  @code{bbdb-record-net}@*
3304       @code{bbdb-record-set-net}
3305 @tab  List of network addresses
3306
3307 @item Notes
3308 @tab  String or Alist
3309 @tab  @code{bbdb-record-raw-notes}@*
3310       @code{bbdb-record-set-raw-notes}
3311 @tab  String or Association list of note fields (strings)
3312
3313 @item Cache
3314 @tab  Vector
3315 @tab  @code{bbdb-record-cache}@*
3316       @code{bbdb-record-set-cache}
3317 @tab  Record cache.@*
3318       @i{Internal version only.}
3319
3320 @end multitable
3321
3322 The phone, address and cache vector fields are described below.  Please
3323 note that, as indicated in the table above, the cache is present only in
3324 the internal version of the database - it is not written out as part of
3325 the @file{.bbdb} file.
3326
3327 In addition, the accessor and modifier functions for the notes alist
3328 are described.
3329
3330 @subsubsection Phone Vectors
3331
3332 To access the fields in the below table, you must first get the list of
3333 phone vectors using the @code{bbdb-record-phones} function.  Note that
3334 if you alter the phones field with the @code{bbdb-record-set-phones}
3335 function, you are altering the entire phones list for the given record.
3336 Use the modifier functions below for modifications to individual phone
3337 vectors.
3338
3339 @multitable @columnfractions .13 .19 .36 .32
3340 @item @b{Name}
3341 @tab  @b{Type}
3342 @tab  @b{Accessor and Modifier}
3343 @tab  @b{Description}
3344
3345 @item Location
3346 @tab  String
3347 @tab  @code{bbdb-phone-location}@*
3348       @code{bbdb-phone-set-location}
3349 @tab  Phone number identifier
3350
3351 @item Area
3352 @tab  Integer
3353 @tab  @code{bbdb-phone-area}@*
3354       @code{bbdb-phone-set-area}
3355 @tab  Area code for phone number
3356
3357 @item Exchange
3358 @tab  Integer
3359 @tab  @code{bbdb-phone-exchange}@*
3360       @code{bbdb-phone-set-exchange}
3361 @tab  Exchange (aka prefix) for phone number
3362
3363 @item Suffix
3364 @tab  Integer
3365 @tab  @code{bbdb-phone-suffix}@*
3366       @code{bbdb-phone-set-suffix}
3367 @tab  Suffix for phone number
3368
3369 @item Extension
3370 @tab  Integer
3371 @tab  @code{bbdb-phone-extension}@*
3372       @code{bbdb-phone-set-extension}
3373 @tab  Phone number extension (@samp{0} if none)
3374
3375 @end multitable
3376
3377 @subsubsection Address Vectors
3378
3379 To access the fields in the below table, you must first get the list of
3380 address vectors using the @code{bbdb-record-addresses} function.  Note
3381 that if you alter the addresses field with the
3382 @code{bbdb-record-set-addresses} function, you are altering the entire
3383 addresses list for the given record.  Use the modifier functions below
3384 for modifications to individual address vectors.
3385
3386 @multitable @columnfractions .13 .19 .36 .32
3387 @item @b{Name}
3388 @tab  @b{Type}
3389 @tab  @b{Accessor and Modifier}
3390 @tab  @b{Description}
3391
3392 @item Location
3393 @tab  String
3394 @tab  @code{bbdb-address-location}@*
3395       @code{bbdb-address-set-location}
3396 @tab  Address identifier
3397
3398 @item Streets
3399 @tab  List
3400 @tab  @code{bbdb-address-streets}@*
3401       @code{bbdb-address-set-streets}
3402 @tab  List of street address lines.  @code{nil} if none.
3403
3404 @item Street3
3405 @tab  String
3406 @tab  @code{bbdb-address-street3}@*
3407       @code{bbdb-address-set-street3}
3408 @tab  Third line of street address.  ``'' if none.
3409
3410 @item City
3411 @tab  String
3412 @tab  @code{bbdb-address-city}@*
3413       @code{bbdb-address-set-city}
3414 @tab  City name
3415
3416 @item State
3417 @tab  String
3418 @tab  @code{bbdb-address-state}@*
3419       @code{bbdb-address-set-state}
3420 @tab  State abbreviation
3421
3422 @item Zip
3423 @tab  Integer (american)
3424       List (non-american)
3425 @tab  @code{bbdb-address-zip}@*
3426       @code{bbdb-address-set-zip}
3427 @tab  Zip code
3428
3429 @item Country
3430 @tab String
3431 @tab @code{bbdb-address-country}@*
3432      @code{bbdb-address-set-country}
3433 @tab Country
3434
3435 @end multitable
3436
3437 @subsubsection Cache Vector
3438
3439 This vector is present only in the internal database representation.  It
3440 is not written out to the database file because it contains information
3441 aggregated from the rest of the record that is reconstructed when the
3442 database is read.  To write the cache information to the database file
3443 would increase the risk of database inconsistency, and would violate the
3444 principles of normalization.
3445
3446 To access the cache fields using the functions listed below that begin
3447 with @code{bbdb-cache-}, you must first get the cache vector using the
3448 @code{bbdb-record-cache} function.  The functions that begin with
3449 @code{bbdb-record-} get the cache vector internally.  Note that if you
3450 alter the cache field in the high-level record with the
3451 @code{bbdb-record-set-cache} function, you are altering the entire cache
3452 vector for the given record.  Use the modifier functions below for
3453 modifications to individual cache fields.
3454
3455 @multitable @columnfractions .15 .17 .36 .32
3456 @item @b{Name}
3457 @tab  @b{Type}
3458 @tab  @b{Accessor and Modifier}
3459 @tab  @b{Description}
3460
3461 @item Name Cache
3462 @tab  String
3463 @tab  @code{bbdb-cache-namecache}@*
3464       @code{bbdb-cache-set-namecache}
3465 @tab  Preconcatenated name of entity
3466
3467 @item Sort Key
3468 @tab  String
3469 @tab  @code{bbdb-cache-sortkey}@*
3470       @code{bbdb-cache-set-sortkey}
3471 @tab  Preconcatenated sort key for record
3472
3473 @item Marker
3474 @tab  Marker
3475 @tab  @code{bbdb-cache-marker}@*
3476       @code{bbdb-record-marker}@*
3477       @code{bbdb-cache-set-marker}@*
3478       @code{bbdb-record-set-marker}@*
3479 @tab  Marker in @file{.bbdb} for start of record
3480
3481 @item Deleted
3482 @tab  Boolean
3483 @tab  @code{bbdb-cache-deleted-p}@*
3484       @code{bbdb-record-deleted-p}@*
3485       @code{bbdb-cache-set-deleted-p}@*
3486       @code{bbdb-record-set-deleted-p}
3487 @tab  Set to @code{t} if record has been deleted, @code{nil} if not
3488
3489 @end multitable
3490
3491 The functions listed above will return @code{nil} if their respective
3492 cache fields are not set.  The functions listed below will return the
3493 value of their cache fields if set, but will also build (and set) the
3494 correct field values if the fields are unset:
3495
3496 @table @code
3497 @item bbdb-record-name
3498 Return the name in the Name Cache field of the cache (if set).  If
3499 the name has not been built yet (if the field is @code{nil}), the name is
3500 built, stored in the Name Cache field, and returned.
3501
3502 @item bbdb-record-sortkey
3503 Return the name it the Sort Key field of the cache (if set).  If the
3504 Sort Key field has not yet been set (if the field is @code{nil}), the
3505 Sort Key is built, stored in the Sort Key field, and returned.
3506
3507 @end table
3508
3509 @subsubsection Notes String or Alist
3510
3511 If there is only a single note for a given record, the notes field for
3512 that record will be a string.  If there is more than one note, the notes
3513 field will be an association list (alist) with elements of the form
3514
3515 @center ( @var{NAME} . @var{VALUE} )
3516
3517 @noindent
3518 where @var{NAME} is the symbol for the name of the note, and
3519 @var{VALUE} is the value of the note.
3520
3521 @subsubsection Example BBDB record
3522
3523 @node Mailing Lists, Changes, Internals, Top
3524 @section Mailing Lists
3525
3526 (If you are looking for a way to create mailing lists with @b{BBDB}, you
3527 should be looking at the section on @xref{Mail Sending Interfaces}.)
3528
3529 There are three mailing lists for the @b{BBDB}.
3530 @code{bbdb-info@@lists.sourceforge.net} gets moderate traffic, and is
3531 intended for the discussion and distribution of development versions of
3532 the @b{BBDB}. Users of development versions of the @b{BBDB} should be
3533 subscribed to this list. It is also to this list that bugs should be
3534 reported. @xref{Known Bugs}. for instructions on submitting bug reports.
3535
3536 The second mailing list @code{bbdb-announce@@lists.sourceforge.net} has
3537 very low volume. Any user of the @b{BBDB} should consider subscribing to
3538 this list, as new releases and security issues will be posted here.
3539
3540 A third mailing list, @code{bbdb-cvs@@lists.sourceforge.net}, is
3541 intended for developers to follow the changes made to the @b{BBDB}
3542 development version. Developers of the @b{BBDB} should consider to
3543 subscribe to this list.
3544
3545 @node Changes, The Latest Version, Mailing Lists, Top
3546 @section Changes in this Version
3547
3548 @menu
3549 * Major Changes::                Major changes in this version
3550 * Other Changes::                Not-so-major changes
3551 @end menu
3552
3553 @node Major Changes, Other Changes, Changes, Changes
3554 @subsection Major Changes
3555
3556 @subsubheading Database File Version Change
3557
3558 (the following version-migration text will move in a future version.  It is in
3559 this section currently because new users will likely not experience it)
3560
3561 There has been a version change in the @b{BBDB} database file.  The new
3562 version supports non-US zip codes, and an additional ``Country'' field
3563 in addresses.
3564
3565 An automatic version-migration mechanism has been implemented that allows
3566 older version @file{.bbdb} files to either be migrated to the new version, or
3567 used as-is without migrating.  When the @b{BBDB} detects a database file with
3568 an old version, it will display the features that have been introduced @b{in
3569 the database file} from the time of the older version's implementation.  It
3570 will offer the choice of migration or use of the @b{BBDB} with the
3571 older-version file.
3572
3573 If migration is chosen, the database file will be automatically changed to the
3574 new format.  If migration is declined, the file will kept in the older format
3575 in the @code{.bbdb} buffer, but will be stored internally in the new format.
3576 When changes need to be made to the @code{.bbdb} buffer, changed records will
3577 be reverse-migrated from their internal version to that of the disk file.
3578
3579 @node Other Changes,  , Major Changes, Changes
3580 @subsection Other Changes
3581
3582 @subsubheading TeX Output
3583
3584 By default, ec fonts are used for TeX output instead of cm fonts. With
3585 the @code{ps-fonts} option set in @code{bbdb-print-alist}, TimesNewRoman
3586 and Courier fonts are used.
3587
3588 @itemize @bullet
3589 @end itemize
3590
3591 @node The Latest Version, The Future, Changes, Top
3592 @section The Latest Version
3593
3594 @noindent
3595 Released versions of the @b{BBDB} can be found at the
3596 following site:
3597
3598 @itemize @bullet
3599 @item
3600 WWW: @code{http://bbdb.sourceforge.net}
3601 @item
3602 FTP: @code{ftp://ftp.sourceforge.net/pub/bbdb}
3603 @end itemize
3604
3605 @noindent
3606 Development versions of the @b{BBDB} can be obtained in the
3607 following ways:
3608
3609 @itemize @bullet
3610 @item
3611 WWW: @code{http://bbdb.sourceforge.net}
3612 @item
3613 Anonymous CVS: See @code{http://bbdb.sourceforge.net} for instructions.
3614 @end itemize
3615
3616 Users of development versions of the @b{BBDB} should subscribe to the
3617 @code{bbdb-info} mailing list.  @xref{Mailing Lists}.
3618
3619 @node The Future,  , The Latest Version, Top
3620 @section The Future
3621
3622 The future consists of Bugs and Features.
3623
3624 @menu
3625 * Known Bugs::          Known Bugs, and how to submit new ones
3626 * TODO List::           The TODO List
3627 * EOL Statements::      EOL (End Of Life) Statements
3628 @end menu
3629
3630 @node Known Bugs, TODO List, The Future, The Future
3631 @subsection Known Bugs
3632
3633 @enumerate
3634 @item
3635 @b{@kbd{M-TAB} conflicts with ispell.}  Workaround: The binding
3636 installed by the @b{BBDB} for address completion/expansion conflicts with
3637 that used by ispell.  The suggested workarounds are to rebind the ispell
3638 key (the @b{BBDB} binding is not configurable at this time), to manually
3639 invoke ispell via @kbd{M-x}, or to not use ispell completion functionality
3640 in @b{BBDB}-enabled message composition buffers. The following is an
3641 example of such a rebinding, supplied by Kai Großjohan:
3642
3643 @lisp
3644 (defun my-message-mode-keys ()
3645   (define-key message-mode-map (kbd "M-TAB") 'bbdb-complete-name))
3646   (add-hook 'message-mode-hook 'my-message-mode-keys)
3647 @end lisp
3648
3649 @item
3650 @b{@b{BBDB} and abbrev expansion is inconsistent.}  Workaround:
3651 Currently, @kbd{M-TAB} must be used to expand/complete against @b{BBDB}
3652 names and net addresses, and @kbd{TAB} must be used to expand abbrevs (the
3653 values in the @code{mail-alias} field).  Unification is planned for a
3654 future version.
3655
3656 @item
3657 @b{The @code{*BBDB*} buffer does not always come up when the first
3658 article in a Gnus Summary Buffer is selected.}  Workaround:  Pressing
3659 @kbd{g} to reload the article.  This will cause the @code{*BBDB*} buffer
3660 to be displayed.
3661
3662 @item
3663 @b{Expansion will fail when the name to be expanded is a subset of
3664 the name for another record.}  For example, if you have entries for
3665 @samp{John} and @samp{Johnathan}, you will not be able to expand the
3666 name for @samp{John}.  Workaround:  Use the net address for the subset
3667 name (@samp{John} in this example).
3668
3669 @end enumerate
3670
3671 @cindex Bug Reports
3672 It is commonly known that there are no bugs in the @b{BBDB}. Bugs
3673 found in defiance of this rule should be submitted using @kbd{M-x
3674 bbdb-submit-bug-report}.  These bug reports will bbe sent to the
3675 @code{bbdb-info} mailing list (@pxref{Mailing Lists}) and are
3676 available from public archives.  Other big brothers may be reading
3677 your bug reports.
3678
3679 @node TODO List, EOL Statements, Known Bugs, The Future
3680 @subsection TODO List
3681
3682 @subsubheading The Near Future
3683
3684 @itemize @bullet
3685 @item
3686 Add bbdb/@i{MUA}-delete-sender-record
3687
3688 @item
3689 Configurable completion.  Should allow user to specify "complete on
3690 names first, then nets", etc.
3691
3692 @item
3693 More variables for upgrading.  Specifically a variable that lets users
3694 specify extra fields for upgrading (an alist @samp{(a . b)} that says
3695 field @samp{a} should be upgraded the same way as field @samp{b}.
3696
3697 @item
3698 Change all functions that switch on MUAs to use compose-mail (ex:
3699 @code{bbdb-send-mail-internal}).
3700
3701 @item
3702 Soren Dayton's method for generically extending the @b{BBDB} with
3703 special-purpose fields
3704
3705 @item
3706 Sorting records on alternate keys.  @code{bbdb-sort-by} from Boris
3707 Goldowsky.
3708 @c nnml:bbdb-maint
3709
3710 @item
3711 Sorting individual types of fields - Sam Steingold's method.
3712
3713 @item
3714 Button 3 menus (Mark Moll and Soren Dayton)
3715
3716 @c @item
3717 @c @b{BBDB}-controlled mail splitting in Gnus.  Add hook for Soren to make
3718 @c splitting better.  Routine from Brian Edmonds.
3719 @c Anyone have contact info for Soren Dayton?
3720
3721 @item
3722 Conditionalized erasure of properties when text is pasted into the @b{BBDB}.
3723
3724 @item
3725 Should notice when there are @samp{Reply-To:} addresses.@refill
3726
3727 @item
3728 Should have a command for merging together two divergent copies of
3729 a @file{.bbdb} file (in case you read mail on one machine and news on
3730 another, for instance.)@refill
3731
3732 @item
3733 The @samp{*BBDB*} buffer should be resized to exactly fit what it's
3734 displaying, even when not in ``electric'' mode.@refill
3735
3736 @item
3737 It should be possible to do completion on last names as well as first
3738 names.@refill
3739
3740 @item
3741 The BBDB buffer is left at the top of the stack when GNUS is exited
3742 because GNUS runs its exit-hooks too early.  This should be fixed.@refill
3743
3744 @item
3745 String area codes (German area codes can begin with zeroes) patch from
3746 @code{Michael Sperber <sperber@@informatik.uni-tuebingen.de>}
3747
3748 @c @item
3749 @c Internationalization of addresses.  Country code to control formats for
3750 @c printing, etc.  Country->Format mapping.
3751
3752 @item
3753 Default country variable, similar to @code{bbdb-default-area-code}.
3754
3755 @item
3756 Make format self-describing in comment
3757
3758 @item
3759 ISO-8859-x characters in records for printing.
3760
3761 @item
3762 Prefix for @kbd{W} (@code{bbdb-www}) command to allow selection of
3763 different addresses.
3764
3765 @item
3766 Generalized buttons (via extents) for fields.  Example: @samp{(a . b)}
3767 means create button that calls @samp{b} for each entry in the @samp{a}
3768 field.
3769
3770 @item
3771 Remove support for GNUS.  Start with lisp Makefile (remove nntp and gnus
3772 loads).
3773
3774 @item
3775 More flexible auto-addition.  Conditionalizing of addition (conditions
3776 or supplied function).  Prompt if multiple records that meet criteria exist.
3777
3778 @item
3779 Different output formats.  See Toby Speight's @code{<s8iurdodvm.fsf@@plato.ansa.co.uk>}
3780 and Bin Mu's @code{<199801221605.KAA23663@@DerivaTech.Com>}.
3781
3782 @item
3783 Generalized area-code-split program that could split, for example, based
3784 on input copied (or straight fetch of page) from the Bellcore NANP page.
3785
3786 @item
3787 Print multivalue (comma-separated) fields with one value per line
3788
3789 @item
3790 Easier BBDB extension.  See @code{<xcdyb30f3hb.fsf@@ra.cs.uchicago.edu>}
3791 from Soren Dayton.
3792
3793 @item
3794 Take birthdays from the @b{BBDB}, add them to calendar.  From Boris
3795 Goldowsky.
3796 @c In nnml:bbdb-maint
3797
3798 @item
3799 Make mail aliases file for other mailers.  From Boris Goldowsky.
3800 @c In nnml:bbdb-maint
3801
3802 @item
3803 Various patches from Boris Goldowsky in @file{bbdb-ext}.
3804
3805 @item
3806 Various other patches:
3807 @itemize @minus
3808 @item
3809 @code{bbdb-filters-0.2}
3810 @item
3811 @code{bbdb-frame.el}
3812 @item
3813 @code{bbdb-letter-1.0}
3814 @item
3815 @code{bbdb-plz}
3816 @item
3817 @code{bbdb-query}
3818 @item
3819 @code{country}
3820 @item
3821 @code{country-info}
3822 @end itemize
3823 @noindent
3824 Note that these files have not been investigated.  They may or
3825 may not be incorporated.
3826
3827 @item
3828 Ability to remove all properties from copied strings.
3829
3830 @end itemize
3831
3832
3833 @subsubheading Not-So-Near Future
3834
3835 @itemize @bullet
3836 @item
3837 Fix Gnus scoring so it rebuilds when gnus-score disappears
3838
3839 @item
3840 Multiline note fields
3841
3842 @item
3843 Change key to be some kind of unique number
3844
3845 @item
3846 There should be better support for non-American addresses and phone
3847 numbers.  This might be Near Future if somebody volunteers to send me patches.
3848
3849 @item
3850 Should reimplement ``electric'' mode to not be so broken.@refill
3851
3852 @item
3853 The @kbd{*C-o} keystroke should add a field to all displayed records.
3854 Perhaps @kbd{*;} should append some text to an arbitrary field of all
3855 displayed records. @refill
3856
3857 @item
3858 Multiple @file{.bbdb} files with precedence relationships.  See Wes
3859 Hardaker's @*@code{<sdu3awz75a.fsf@@oakdale.ucdavis.edu>}
3860
3861 @item
3862 Automatically grab information about a person from their sig.  See
3863 Graham Clark's @code{info-bbdb} post
3864 @code{<6282.199706161624@@havra.dcs.ed.ac.uk>} and Adrian Aichner's
3865 @code{info-bbdb} post
3866 @code{<rxsiuzebpgp.fsf@@midnight.ecf.teradyne.com>}.  Would like to have
3867 @code{bbdb-snarf} attack the sig then compare the snarfed data with the
3868 header data.
3869
3870 @end itemize
3871
3872 @subsubheading Thoughts
3873
3874 @itemize @bullet
3875 @item
3876 Are there enough hooks?
3877
3878 @item
3879 The interfaces should share more code. @refill
3880
3881 @item
3882 The @code{bbdb-create-internal} function should be more forgiving.@refill
3883
3884 @item
3885 More @kbd{*} commands in general, including @kbd{*d}.
3886 @end itemize
3887
3888 @node EOL Statements,  , TODO List, The Future
3889 @subsection End of Life (EOL) Statements
3890
3891 The items in the following list describe items for which support will be
3892 removed in coming versions of the @b{BBDB}.  The items listed are
3893 guaranteed to be supported and present only until the EOL date.  They
3894 may be removed without warning at any time thereafter.
3895
3896 @enumerate
3897 @item
3898 @code{advertized-bbdb-delete-current-field-or-record}@*
3899 Support for this function will be removed for version 2.2.  It is
3900 recommended that all code depending on this variable be switched to use
3901 @code{bbdb-delete-current-field-or-record}.  The two functions have the
3902 same calling conventions and effects.  This EOL statement was added for
3903 version 2.1.
3904
3905 @item
3906 Support for the GNUS (not Gnus) newsreader@*
3907 The GNUS-specific parts of the @b{BBDB} will be actively removed for the
3908 2.2 release.  No further maintenance and/or bugfixes are planned for
3909 GNUS code at this time.  This EOL statement was added for version 2.1.
3910 @end enumerate
3911
3912 @node Thanks,  , , Top
3913 @section Thanks
3914
3915 Thanks to everyone on the info-bbdb mailing list for many useful
3916 suggestions. This hack would be far less insidious without their input!
3917
3918 @subheading Thanks list for versions after 2.00.06.
3919 @c I'm trying to include as many code contributors as possible here. It
3920 @c doesn't happen without your help!
3921
3922 Thanks to Alex Schroeder, Ronan Waide, Thomas DeWeese, Robert Fenk,
3923 Didier Verna, Bill Carpenter.
3924
3925 @subheading Thanks list for versions after 1.51 prior to and including 2.00.06.
3926
3927 Thanks to Adrian Aichner, Kees de Bruin, David Carlton, Soren Dayton,
3928 Brian Edmonds, Boris Goldowsky, Seth Golub, John Heidemann, Christopher
3929 Kline, Carsten Leonhardt, Hrvoje Niksic, Jens-Ulrik Hoger Petersen,
3930 Colin Rafferty, Matt Simmons, Sam Steingold, Marco Walther, Christoph
3931 Wedler.
3932
3933 @subheading Thanks list for versions prior to and including 1.51.
3934
3935 And special thanks to Sebastian Kremer, Joe Wells, Todd Kaufmann, Andy
3936 Norman, Ivan Vazquez, Stewart Clamen, Roland McGrath, Dave Brennan,
3937 Kimball Collins, Dirk Grunwald, Philippe Queinnec, Boris Putanec, Dave
3938 Disser, Francois Felix Ingrand, Sean Owens, Guido Bosch, Lance Brown,
3939 Tom Emerson, George Hartzell, Luis Miguel Silveira, Kimmo Suominen,
3940 Derek Upham, David Zuhn, Rod Whitby, Richard Mlynarik.
3941
3942 Last, but not least, thanks to Jamie Zawinski for writing @b{BBDB} in the
3943 first place.
3944
3945 @ifnottex
3946 @node _,,,(dir)
3947 @unnumbered _
3948 @example
3949 in.sid.i.ous aj   \in-'sid-e-*s\
3950    [L insidiosus, fr. insidiae ambush, fr. insidere to sit in, sit on,
3951       fr. in- + sedere to sit -- more at SIT]
3952      1  a : awaiting a chance to entrap  TREACHEROUS
3953         b : harmful but enticing  SEDUCTIVE
3954      2  a : having a gradual and cumulative effect  SUBTLE
3955         b of a disease
3956           : developing so gradually as to be well established before
3957             becoming apparent
3958   in.sid.i.ous.ly av
3959   in.sid.i.ous.ness n
3960 @end example
3961
3962
3963
3964 @menu
3965 * Top::
3966 @end menu
3967
3968 @end ifnottex
3969
3970 @node Concept Index, Variable Index,, Top
3971 @unnumbered Concept Index
3972 @printindex cp
3973
3974 @node Variable Index,  , Concept Index, Top
3975 @unnumbered Variable Index
3976 @printindex vr
3977
3978 @contents
3979 @bye