-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathebdb.texi
2614 lines (2129 loc) · 90.3 KB
/
ebdb.texi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
\input texinfo @c -*- texinfo -*-
@c %**start of header
@setfilename ebdb.info
@settitle EBDB Manual
@documentencoding UTF-8
@documentlanguage en
@syncodeindex vr cp
@syncodeindex fn cp
@syncodeindex ky cp
@c %**end of header
@copying
Copyright @copyright{} 2016 Free Software Foundation, Inc.
@quotation
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with the Front-Cover Texts being “A GNU Manual,”
and with the Back-Cover Texts as in (a) below. A copy of the license
is included in the section entitled “GNU Free Documentation License.”
(a) The FSF’s Back-Cover Text is: “You have the freedom to copy and
modify this GNU manual.”
@end quotation
@end copying
@dircategory Emacs
@direntry
* EBDB: (ebdb). Contact management package.
@end direntry
@finalout
@titlepage
@title EBDB Manual
@subtitle This manual is for version 0.6.7, updated 19 April, 2019
@page
@vskip 0pt plus 1filll
@insertcopying
@end titlepage
@contents
@ifnottex
@node Top
@top EBDB Manual
@end ifnottex
@menu
* Getting Started::
* The EBDB Database::
* Creating Records::
* Record Fields::
* MUA Interaction::
* Specific MUAs::
* EBDB Buffers::
* Completion::
* Snarfing::
* Internationalization::
* Diary Integration::
* Mail Aliases::
* vCard Support::
* Org Integration::
* Citing Records::
* Hacking EBDB::
* Index::
@detailmenu
--- The Detailed Node Listing ---
Getting Started
* Starting a New Database::
* Migration from BBDB::
* Migration from Org Contacts::
Migration from BBDB
* Record Migration::
* Variables and Options::
Creating Records
* Record classes::
* Record names::
Record Fields
* Inserting New Fields::
* Editing Existing Fields::
* Deleting Records and Fields::
* Field Types::
Field Types
* Role fields::
* Tag field::
* Mail folder field::
MUA Interaction
* Loading MUA Code::
* Display and Updating::
* EBDB and MUA summary buffers::
* Mail Address Completion::
Display and Updating
* Pop-up Buffers::
* Auto-Updating Records::
* Noticing and Automatic Rules::
* Interactive Commands::
EBDB and MUA summary buffers
* Sender name display::
* Summary buffer marks::
Mail Address Completion
* A Note on Completion::
Specific MUAs
* Gnus::
Gnus
* Posting Styles::
EBDB Buffers
* Searching::
* The Basics of ebdb-mode::
* Customizing Record Display::
* Marking::
* Image Display::
* Exporting/Formatting::
Searching
* Changing Search Behavior::
Hacking EBDB
* Field Classes::
* Writing Internationalization Libraries::
* Writing Integration For New MUAs::
Field Classes
* Init and Delete Methods::
* Manipulating Field Data Programmatically::
* The Labeled Field Class::
* The Singleton Field Class::
* Actions::
* Custom Field Searching::
* Fast Lookups::
* Formatting in the EBDB Buffer::
Writing Integration For New MUAs
* Article snarfing::
@end detailmenu
@end menu
@node Getting Started
@chapter Getting Started
EBDB is a contact management package: it records information about
people and organizations, and integrates with other Emacs software
packages, mostly those concerned with sending and reading mail. The
principle parts of EBDB are records, which represent people and
organizations; fields, representing detailed data about records; and
databases, which hold and persist records.
It's easiest to install EBDB from the ELPA package repositories,
though it's also possible to clone the package from @uref{https:github.com/girzel/ebdb, Github} and put it
on your load path. Questions and bug reports can be raised on the
Github issues page, or on the Emacs bug tracker or mailing lists,
provided you cc the maintainer.
There are a large number of configuration options listed in this
manual, but the only one you might want to tweak in advance is
@code{ebdb-sources} (see @ref{The EBDB Database}), which controls where EBDB
stores its records.
EBDB comes with integration for a few other Emacs packages, including
Org and a number of mail user agents; see the following sections below
for details.
@table @asis
@item Emergency Escape Hatch
EBDB strives to be bug-free, naturally,
but due to the nature of the package, when bugs /do/ arise they can
potentially interfere with the reading and sending of email. No one
likes it when their email is interfered with. If, God forbid, you
do encounter such a bug, you can prevent it from doing harm by
running:
@end table
@lisp
(setq ebdb-mua-auto-update-p nil)
@end lisp
That will ensure that EBDB only runs when you explicitly command it
to do so; it won't interpose itself in other MUA operations. If you
really need to kill it and make it go away, use @code{M-x ebdb-shutdown}.
@menu
* Starting a New Database::
* Migration from BBDB::
* Migration from Org Contacts::
@end menu
@node Starting a New Database
@section Starting a New Database
@findex ebdb-open
If you have no records you want to migrate from other contact
management software, start by calling the command @code{ebdb-open}. This
will open a new buffer in @code{ebdb-mode}, and prompt you to create a
database, if one doesn't already exist. From there, you can use
@kbd{c} to make new records (see @ref{Creating Records}). You can also
hook EBDB into a mail-user agent (see @ref{MUA Interaction}) and allow it to
create records automatically.
Otherwise, you'll want to migrate your contact information from other
contact management software as described in the sections below.
Currently EBDB only knows about migrating from BBDB and Org Contacts.
@node Migration from BBDB
@section Migration from BBDB
@cindex Migration from BBDB
@menu
* Record Migration::
* Variables and Options::
@end menu
@node Record Migration
@subsection Record Migration
@findex ebdb-migrate-from-bbdb
It's possible to migrate records from a BBDB database. The
@code{bbdb-file} variable should point to your current BBDB file;
alternately EBDB will look in the default location, found using
@code{(locate-user-emacs-file "bbdb" ".bbdb)}. Then call
@code{ebdb-migrate-from-bbdb}. You'll be prompted to create the new
database, and upgrade from BBDB@. If any records could not be
upgraded, they will be displayed in an *EBDB Migration Errors* buffer. Migration bug reports are very welcome.
@cindex Country codes for BBDB phone numbers
@vindex ebdb-default-phone-country
BBDB does not provide a country code field for phone numbers. If
you've stored your BBDB phone numbers as plain strings, and those
strings contain country codes (formatted as ``+44'', etc), then
migration will parse them correctly. Otherwise, if most of the
records you're migrating have phones in the same country, you can set
@code{ebdb-default-phone-country} to the (integer) value of that country's
code.
@node Variables and Options
@subsection Variables and Options
Many of the old BBDB customization options have been changed or
removed entirely in EBDB@. It's probably best to put your BBDB
customizations aside, and set new EBDB options as you come across
them. The most important options are detailed in this manual, you can
also customize the ``EBDB'' group to see what's available.
@node Migration from Org Contacts
@section Migration from Org Contacts
@cindex Migration from Org Contacts
@findex ebdb-migrate-from-org-contacts
EBDB also provides limited support for migrating from Org Contacts:
simply call the command @code{ebdb-migrate-from-org-contacts}. Your
contacts database will be scanned, and all contacts will be migrated.
Any field values that could not be migrated will be displayed in a
*EBDB Migration Errors* buffer.
At present, addresses cannot be migrated automatically. Org Contacts
stores addresses as a free-form string, which is simply too difficult
to parse accurately. Address values will be inserted into the
migration errors buffer, and will have to be added to the records
manually.
@node The EBDB Database
@chapter The EBDB Database
EBDB supports multiple databases, and each database definition is
saved in a file on disk. The default database class, @code{ebdb-db-file},
stores its contacts in the same file as the database itself, though
other database classes may store contacts elsewhere.
@cindex Creating a database
@cindex Databases
@defopt ebdb-sources
User option specifying one or more databases to load. It can be a
single element, or a list of elements. Each element can be a
filename, from which a database is loaded, or it can be an instance of
a subclass of the @code{ebdb-db} class. The database at the head of the
list will be considered the default database.
@end defopt
Databases have a few user-facing settings:
@deftypeivar Database @code{boolean} read-only
If non-nil, records can only be read from the database, not edited or
deleted.
@end deftypeivar
@deftypeivar Database @code{boolean} auto-save
If non-nil, the database's records will not be autosaved.
@end deftypeivar
@deftypeivar Database @code{character} buffer-char
A single character that will be displayed next to records in the
*EBDB* buffer, indicating which database they belong to.
@end deftypeivar
@deftypeivar Database @code{boolean} disabled
When non-nil , the database will essentially be ignored---no records
will be read from it. Setting this to t will only take effect on next
restart; to disable a database immediately, use
@code{ebdb-disable-database} below.
@end deftypeivar
@deftypeivar Database @code{symbol} record-class
The default record class to use when creating new records in this
database. The default is @code{ebdb-default-record-class}.
@end deftypeivar
While it's possible to edit database definitions directly in the file,
it's safer to use the customization interface to do so from the
*EBDB* buffer.
@table @kbd
@item d e
@kindex d e
Use the customize interface to edit the definition of a database
(@code{ebdb-customize-database}).
@end table
Records can be moved or copied from one database to another. It's also
possible for a single record to live in more than one database, though
this functionality is experimental. When a record is loaded from more
than one database, the two copies are compared using the timestamp
field, and the older copy is discarded. In an *EBDB* buffer,
the following keys can be used to manipulate databases and their
records.
@table @kbd
@item d m
@kindex d m
Move a record from its current database to another
(@code{ebdb-move-record}).
@item d c
@kindex d c
Copy a record into a new database, leaving it in its existing
database(s) (@code{ebdb-copy-record}).
@end table
Other database-related commands:
@table @kbd
@item d r
@kindex d r
Reload all records from a database. This also redisplays any of
those records that were visible in *EBDB* buffers
(@code{ebdb-reload-database}).
@item d d
@kindex d d
This command (@code{ebdb-disable-database}) disables a database,
unloading all of its records and essentially ignoring it from now
on. The disabled state persists between restarts. To re-enable
a database, edit it using @code{ebdb-customize-database}, set
@code{disabled} to nil, and then reload it with
@code{ebdb-reload-database}.
@end table
@cindex Saving the database
@vindex ebdb-save-on-exit
Typically, databases are saved using the @kbd{s} binding in
@code{ebdb-mode} buffers, which runs @code{ebdb-save}. If you have open
*EBDB* buffers and unsaved changes, you'll also be prompted
to save the database when running @code{save-some-buffers}. If this isn't
enough, you can also set @code{ebdb-save-on-exit} to non-nil to have EBDB
saved automatically (and silently) when killing Emacs. Because killing
Emacs already runs @code{save-some-buffers}, this option is typically
redundant and defaults to nil.
@cindex Loading databases
@cindex Database load times
@vindex ebdb-try-speedups
Loading and initializing the EBDB can be slow for large databases. If
you find yourself annoyed by the wait, try setting @code{ebdb-try-speedups}
to non-nil. This will disable some checks performed during the object
creation process, which theoretically shouldn't make a difference. If
something does go wrong at load-time, however, try setting this back
to @code{nil} first.
@node Creating Records
@chapter Creating Records
@cindex Creating records
@kindex c
@findex ebdb-create-record
Create a record using @kbd{c} (@code{ebdb-create-record}) in the
*EBDB* buffer. This command will create an instance of the
default record class, in the database at the head of @code{ebdb-sources}.
@defopt ebdb-default-record-class
The default record class to use when creating new records. Defaults
to @code{ebdb-record-person}.
@end defopt
@findex ebdb-create-record-extended
@kindex C
Alternately create a record using @kbd{C}
(@code{ebdb-create-record-extended}), which will prompt for a record class to use,
as well as a database to store the record in, if there is more than
one.
You can also tell EBDB which record represents you:
@defopt ebdb-record-self
The value of this option should be the UUID of your own record. You
can find this by pressing @kbd{T} (to show all fields) on your
record.
@end defopt
Currently this option's only use is to serve as a source for
@code{ebdb-user-mail-address-re}.
@menu
* Record classes::
* Record names::
@end menu
@node Record classes
@section Record classes
EBDB comes with two record classes, representing individuals
(@code{ebdb-record-person}) and organizations (@code{ebdb-record-organization}).
Records can have ``roles'' at organizations, @ref{Role fields, , Role Fields}.
@node Record names
@section Record names
EBDB comes with two classes for name fields: ``simple'' and ``complex''.
Simple names are just a single string, complex names are split out
into surname, given names, suffix, etc. All records have a single
canonical name: person records have a complex name, organization
records have a simple name.
In addition, person records can have one or more ``aka'' names, and
these akas can be either simple or complex. When adding fields to a
record, the simple name class is labeled ``nickname'', and the complex
class is labeled ``alt name''.
@node Record Fields
@chapter Record Fields
@menu
* Inserting New Fields::
* Editing Existing Fields::
* Deleting Records and Fields::
* Field Types::
@end menu
@node Inserting New Fields
@section Inserting New Fields
@cindex Inserting new fields
@kindex i
@findex ebdb-insert-field
Pressing @kbd{i} (@code{ebdb-insert-field}) with point on a record
will prompt for a field type, then field values, and add the field to
the record. See below for more information about the various kinds of
fields.
When entering field data, optional data can be skipped by entering a
blank string, or by pressing @kbd{C-g}. The first @kbd{C-g}
will cancel the current data prompt; the second @kbd{C-g} will
cancel the creation of the field altogether. For instance, when
creating address fields, EBDB will allow you to create an arbitrary
number of street lines. When you've added enough, either enter a
blank string, or hit @kbd{C-g}.
@node Editing Existing Fields
@section Editing Existing Fields
@cindex Editing fields
@kindex e
@findex ebdb-edit-field
Pressing @kbd{e} (@code{ebdb-edit-field}) with point on a field will
allow you to edit an existing field, with the previous values as
defaults.
@kindex E
@findex ebdb-edit-field-customize
Alternately, press @kbd{E} (@code{ebdb-edit-field-customize}) to edit
the field's values using the Customize interface. Some fields have
slots that can only be edited this way; other fields have slots that
cannot be edited at all once the field is created.
@node Deleting Records and Fields
@section Deleting Records and Fields
@cindex Deleting records
@cindex Deleting fields
@kindex C-k
@findex ebdb-delete-record-or-field
Pressing @kbd{C-k} on a field will ask you for confirmation, then
delete the field. Pressing @kbd{C-k} while point is on or before
a record's main name will instead prompt to delete the whole record.
@node Field Types
@section Field Types
Fields can be classed in a few different categories. Some are
``plumbing'' fields, that are present for all records, but not generally
visible or user-editable: these include the creation date, timestamp,
and UUID@. You can view these fields by hitting @kbd{T} on the
record. Other fields are ``built-in'': basic fields that get special
treatment. These include the name, mail, phone, address, and notes
fields. EBDB comes with default classes for these fields: if you
would like to use different defaults, you can create new classes
(inheriting from the existing ones) and use those instead. See
@ref{Hacking EBDB} for more information.
Besides the ``plumbing'' and ``built-in'' fields, all other fields are
referred to as ``user'' fields. These can hold any kind of information
you want to associate with a record. Some user fields are simple
string keys and string values; others have more complicated data
structures and behavior.
When adding a field to a record, you'll be prompted for a field type.
The list will include the built-in fields, more complicated field
types, and also all the simple string keys you've defined so far. If
you enter a string key that EBDB hasn't seen before, it will prompt
for confirmation, then define that key for future use.
EBDB comes with more complicated classes including ``anniversary'',
``url'', ``id'', ``relation'', ``role'' and more. Many of these fields have
their own list of labels: for instance, anniversary fields may be
labeled ``birthday'' or ``wedding'', and URL fields might be labeled
``homepage'' or ``file-sharing''.
In the case of fields with labels, you'll first choose the general
field (``anniversary''), then enter the field data, and lastly choose a
label (``birthday''). Again, if you choose a label that hasn't been
seen before, EBDB will first prompt for confirmation, then define the
label for future use. You can also enter an empty string or hit
@kbd{C-g} to omit the label altogether.
Loading secondary libraries may make more field types available.
@menu
* Role fields::
* Tag field::
* Mail folder field::
@end menu
@node Role fields
@subsection Role fields
One type of field worth mentioning in particular is the role field.
EBDB records come in two types at present: person and organization.
People have roles at organizations: jobs, volunteer positions, etc.
People are also likely to have roles at more than one organization.
When adding a role field to a record, you'll be prompted for a string
label denoting eg.@: a job title, prompted for an
organization, and prompted for a mail address that belongs only to
this role field (ie.@: an institutional email address).
If the organization has a ``domain'' field type, and the person has an
existing mail address that matches that domain, you'll be prompted to
move that address to the role field.
When viewing organization records, the role fields for all related
person records are also displayed as part of the organization record.
If a person's role at an organization later comes to an end, the role
field can be deleted, or marked as ``defunct'', if record keeping is
desired. This can only be done using the customize-based editing
interface (the @kbd{E} key on the role field).
In fact, in addition to a mail field, role fields can contain an
arbitrary number of other fields, representing metadata about the role
(an employee number, employment start date, etc). The author has yet
to come up with a good interface for viewing and manipulating these
extra fields, however, so the functionality remains hidden.
Suggestions are very welcome.
@findex ebdb-create-record-and-role
It can often feel a little clunky creating a new organization to
associate with a person, or vice versa. EBDB provides a convenience
function to create a new person or organization record, and associate
it with the existing record under point, in one step, using
@kbd{R}. This will create a new organization if point is on a
person record, or a new person if point is on an organization.
@vindex ebdb-create-update-roles
Lastly, EBDB will try to assist in creating role fields where it seems
helpful. When adding mail fields to person records, or domain fields
to organization records, it will check if the mail or domain seems to
match any existing records, and offer to create the corresponding role
fields. This behavior is enabled by default; set
@code{ebdb-create-update-roles} to nil to disable it.
@node Tag field
@subsection Tag field
EBDB comes with a field holding arbitrary tags for records. When
searching on the tags field (using @kbd{/ t} and selecting
``tags''), EBDB provides the same tag search syntax as Org does,
eg.@: ``work|laptop+night''. @xref{Matching
tags and properties,,,org} for more information.
The @file{ebdb-org} library alters the
behavior of this class, offering all the user's Org-file tags for
completion. @ref{Org Integration}.
@node Mail folder field
@subsection Mail folder field
The ``mail folder'' field is used to indicate which folder or group
incoming mail from the contact should be filed into. Currently only
Gnus supports this; support in other MUAs is forthcoming.
@node MUA Interaction
@chapter MUA Interaction
One of EBDB's most important features is the ability to create, update
and display records based on messages received or sent in your mail
user agent(s). In theory, EBDB can be integrated with any software
package, but it's most common to use it in conjunction with sending
and receiving emails.
@menu
* Loading MUA Code::
* Display and Updating::
* EBDB and MUA summary buffers::
* Mail Address Completion::
@end menu
@node Loading MUA Code
@section Loading MUA Code
MUA code is activated simply by loading the relevant library. Keep in
mind that mail-reading clients and mail-sending clients are considered
separate MUAs. For instance, if you use the Gnus package for reading
mail, and Message for sending it, you'll want two require statements:
@lisp
(require 'ebdb-gnus)
(require 'ebdb-message)
@end lisp
There are other packages that provide other MUA integration: these are
likewise activated simply by requiring the relevant library, named
``ebdb-<MUA>''. MUAs supported by EBDB include gnus, message, mh-e,
mu4e, wl, and rmail.
@node Display and Updating
@section Display and Updating
@cindex MUA Display
@cindex MUA Updating
When a message is opened in an MUA, EBDB can do certain things with
the records referenced in that message. It can:
@itemize
@item
Pop up a buffer displaying the records.
@item
Create new records, or alter existing records, based on information
provided by the MUA@.
@item
Run automatic rules to edit the records.
@item
Provide keybindings to manually edit the records.
@end itemize
Each of these functionalities is optional, and can be customized
independently of the others.
@menu
* Pop-up Buffers::
* Auto-Updating Records::
* Noticing and Automatic Rules::
* Interactive Commands::
@end menu
@node Pop-up Buffers
@subsection Pop-up Buffers
@cindex Pop-up buffers
Each MUA creates its own EBDB pop-up buffer, with a name like
*EBDB-Gnus* or *EBDB-Rmail*. MUAs will re-use their
own buffers, and will not interfere with buffers the user has created
using the @code{ebdb} command, or by cloning or renaming existing buffers.
@defopt ebdb-mua-pop-up
If nil, MUAs will not automatically pop up buffers. It is still
possible to manually create the buffer using interactive commands (see
below).
@end defopt
@defopt ebdb-mua-default-formatter
The default formatter to use for MUA pop-up buffers. The value of
this option should be an instance of either the
@code{ebdb-formatter-ebdb-multiline} or the @code{ebdb-formatter-ebdb-oneline}
class; it defaults to @code{ebdb-default-multiline-formatter}. Other
likely options would be the value of @code{ebdb-default-oneline-formatter},
or a custom-made formatter, see @ref{Customizing Record Display}.
@end defopt
EBDB can also integrate with atomic windows (@xref{Atomic
Windows,,,elisp}).
@defopt ebdb-join-atomic-windows
When non-nil (the default), EBDB buffers that are popped up within
existing atomic windows will become part of the atomic window.
Otherwise they will be opened to one side of the atomic window.
@end defopt
@defopt ebdb-default-window-size
Set to a float between 0 and 1 to specify how much of an existing
window the popped-up *EBDB* buffer should occupy.
@end defopt
In addition, each MUA has its own customization option for controlling
the window size of pop-up buffers. Each option is named as
@code{ebdb-<MUA>-window-size}, and each defaults to
@code{ebdb-default-window-size}.
@vindex ebdb-gnus-window-configuration
@vindex ebdb-message-window-configuration
The Gnus and Message MUAs have their own special window
configuration system (@xref{Window Layout,,,Gnus}). If
you're not making special use of that system, EBDB will default to
taking up a percentage of the article and message composition
windows. If you are using that system for more control, you use the
@code{ebdb-gnus-window-configuration} and
@code{ebdb-message-window-configuration} options to do so. They should be
set to two arbitrary (but distinct) symbols, which will be added to
the @code{gnus-window-to-buffer} alist, and can be used in
@code{gnus-add-configuration} calls, for example:
@lisp
(gnus-add-configuration
'(article
(vertical 1.0
(summary 0.25 point)
(horizontal 1.0
(article 1.0)
(ebdb-gnus 0.4)))))
@end lisp
Because Gnus and Message use separate EBDB buffers for record update
and display, the two options must be separate, and used in the
appropriate article-display vs message-composition window
configurations.
@node Auto-Updating Records
@subsection Auto-Updating Records
EBDB can automatically update the name and mail addresses of records
based on information in an MUA message. The first and most important
option governing this behavior is:
@defopt ebdb-mua-auto-update-p
This option determines how EBDB acts upon mail addresses found in
incoming messages. If nil, nothing will happen. Other options
include the symbols @code{existing} (only search for and display existing
records), @code{update} (only find existing records, and update their name
and mail fields as necessary), @code{query} (find existing records, and
query about the editing and creation of new records), and @code{create}
(automatically create new records). A value of @code{t} is considered
equivalent to @code{create}. The option can also be set to a function
(called with no arguments) which returns one of the above symbols.
@end defopt
For instance, say you want to automatically create records for
addresses you send mail to, but _not_ when sending messages to
newsgroups. If you're using @code{message-mode}, you could use the
following:
@lisp
(setq ebdb-message-auto-update-p
(lambda ()
(unless (ebdb-mua-message-header "Newsgroups")
'query)))
@end lisp
This option only governs what EBDB does automatically, each time a
message is displayed. The same process can be run interactively using
the commands below.
In many cases it's useful to have different auto-update behavior in
different MUAs. In particular, you might want to automatically create
records for addresses as you send messages to them, but retain manual
control over creating records from messages you receive. EBDB
provides two more-specific versions of @code{ebdb-mua-auto-update-p}:
@defopt ebdb-mua-sender-update-p
The default ``update-p'' value for all mail-sending MUAs.
@end defopt
@defopt ebdb-mua-reader-update-p
The default ``update-p'' value for all mail-reading MUAs.
@end defopt
@vindex ebdb-gnus-auto-update-p
@vindex ebdb-message-auto-update-p
@vindex ebdb-rmail-auto-update-p
@vindex ebdb-mhe-auto-update-p
@vindex ebdb-mu4e-auto-update-p
@vindex ebdb-wl-auto-update-p
@vindex ebdb-vm-auto-update-p
Even finer-grained control is available using per-MUA versions of the
option, all of them named after the pattern
@code{ebdb-<MUA>-auto-update-p}.
When updating records either automatically or interactively, a few
more options come into play:
@defopt ebdb-add-name
Whether to automatically change record names. See docstring for
details.
@end defopt
@defopt ebdb-add-aka
Whether to automatically add new names as akas. See docstring for
details.
@end defopt
@defopt ebdb-add-mails
How to handle apparently new mail addresses. See docstring for
details.
@end defopt
There are also options governing whether EBDB will consider a mail
address or not:
@defopt ebdb-accept-header-list
An alist governing which addresses in which headers will be accepted.
See docstring for details.
@end defopt
@defopt ebdb-ignore-header-list
An alist governing which addresses in which headers will be ignored.
See docstring for details.
@end defopt
@vindex ebdb-record-self
@defopt ebdb-user-name-address-re
A regular expression matching the user's own mail address(es). In
addition to a regexp, this can also be the symbol @code{message}, in which
case the value will be copied from @code{message-alternative-emails}, or
the symbol @code{self}, in which case the value will be constructed from
the record pointed to by the option @code{ebdb-record-self}.
@end defopt
When auto update is set to @code{query}, and the user has already told EBDB
not to automatically create or update a record for a given mail
address, it can be annoying when opening the message a second timed to
be prompted again. It is possible to permanently ignore a mail
address, by saving it to disk.
@cindex Permanently ignoring mail addresses
@defopt ebdb-permanent-ignores-file
A file in which to save permanently-ignored mail addresses. This
defaults to ``.ebdb-permanent-ignores'' in the user's Emacs directory,
but can be set to a different location, or to nil to disable saving of
the ignored list altogether.
@end defopt
When EBDB queries to create or update a record, the @kbd{i} key
will ignore the mail permanently; the @kbd{I} key will ignore the
entire domain. If the above option is nil, the mail will be ignored
for this session only, otherwise it will be saved to disk the next
time EBDB is saved.
It's also possible to add addresses manually, while EBDB is shut down.
The format is one address per line, with no attached name or angle
brackets. Domains to be ignored should start with the ``@@'' symbol.
The addresses are matched literally (though case-insensitively); it's
not possible to use regexps.
@node Noticing and Automatic Rules
@subsection Noticing and Automatic Rules
@cindex Automatic Rules
In addition to updating records' name and mail fields, it's possible
to run other arbitrary edits on records when they are referenced in a
message. This process is called ``noticing''. Two hooks are run as a
part of noticing:
@defopt ebdb-notice-record-hook
This hook is run once per record noticed, with two arguments: the
record, and one of the symbols @code{sender} and @code{recipient}, indicating
where in the message headers the record was found.
@end defopt
@defopt ebdb-notice-mail-hook
This hook is run once per mail message noticed: if multiple addresses
belong to a single record, it will be called once per address. The
hook is run with one argument: the record.
@end defopt
@findex ebdb-notice-field
When a record is noticed, it will also call the method
@code{ebdb-notice-field} on all of its fields. Using this method requires
a bit of familiarity with @ref{Generic
Functions,,,elisp}; suffice it to say that the first argument is the
field instance being noticed, the second argument is one of the
symbols @code{sender} or @code{recipient}, and the third argument is the record
being noticed.
@findex ebdb-mua-message-header
A useful function here is @code{ebdb-mua-message-header}, which can be used
to extract the value of arbitrary headers from the current message.
The header should be provided as a string, for example
@code{(ebdb-mua-message-header "Subject")}. There is currently no shortcut
for extracting the text of the message body; code to do this will have
to be written per-MUA@.
For functions that can be used to edit a record's field data,
@ref{Manipulating Field Data Programmatically}.
@node Interactive Commands
@subsection Interactive Commands
Some interactive commands are also provided for operating on the
relevant EBDB records. In message-reading MUAs, EBDB creates its own
keymap, and binds it to the key ``;''. The following list assumes this
binding, and only specifies the further binding. Ie, press ``;:'' to
call @code{ebdb-mua-update-records}.
@table @kbd
@item :
@kindex ; :
@findex ebdb-mua-update-records
If the option @code{ebdb-mua-auto-update-p} is nil, this command
(@code{ebdb-mua-update-records}) can be used to do the same thing, and
will behave as if that option were set to @code{query}.
@item ;
@kindex ; ;
@findex ebdb-mua-display-all-records
If the option @code{ebdb-mua-pop-up} is nil, this command can be used
to do the same thing (@code{ebdb-mua-display-all-records}).
@item '
@kindex ; '
@findex ebdb-mua-edit-sender-notes
Edit the notes field of the message sender
(@code{ebdb-mua-edit-sender-notes}).
@item @quotedblright{}
@kindex ; "
@findex ebdb-mua-in-ebdb-buffer
This command moves point to the relevant EBDB pop-up buffer
(popping the buffer up first, if necessary). You can then issue
commands in the EBDB buffer as usual, with the exception that
@kbd{q} will move point back to the previously-selected
window, rather than quitting the EBDB buffer.
@item s
@kindex ; s
@findex ebdb-mua-snarf-article
This command scans the body text of the current message, and
attempts to snarf new record information from it. Email
addresses and names in the body text will be handled, as will
information in the headers of forwarded mail, and information in
the signature will be associated with the sender. The user is
always prompted before edits are made. This functionality is
highly unreliable, and probably won't work as advertised.
@item t
@kindex ; t