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