-
Notifications
You must be signed in to change notification settings - Fork 11
/
ebdb.info
2874 lines (2309 loc) · 123 KB
/
ebdb.info
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
This is ebdb.info, produced by makeinfo version 6.8 from ebdb.texi.
Copyright © 2016 Free Software Foundation, Inc.
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.”
INFO-DIR-SECTION Emacs
START-INFO-DIR-ENTRY
* EBDB: (ebdb). Contact management package.
END-INFO-DIR-ENTRY
File: ebdb.info, Node: Top, Next: Getting Started, Up: (dir)
EBDB Manual
***********
* 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::
— 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::
File: ebdb.info, Node: Getting Started, Next: The EBDB Database, Prev: Top, Up: Top
1 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 Github
(https:github.com/girzel/ebdb) 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
‘ebdb-sources’ (see *note 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.
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:
(setq ebdb-mua-auto-update-p nil)
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 ‘M-x ebdb-shutdown’.
* Menu:
* Starting a New Database::
* Migration from BBDB::
* Migration from Org Contacts::
File: ebdb.info, Node: Starting a New Database, Next: Migration from BBDB, Up: Getting Started
1.1 Starting a New Database
===========================
If you have no records you want to migrate from other contact management
software, start by calling the command ‘ebdb-open’. This will open a
new buffer in ‘ebdb-mode’, and prompt you to create a database, if one
doesn’t already exist. From there, you can use ‘c’ to make new records
(see *note Creating Records::). You can also hook EBDB into a mail-user
agent (see *note 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.
File: ebdb.info, Node: Migration from BBDB, Next: Migration from Org Contacts, Prev: Starting a New Database, Up: Getting Started
1.2 Migration from BBDB
=======================
* Menu:
* Record Migration::
* Variables and Options::
File: ebdb.info, Node: Record Migration, Next: Variables and Options, Up: Migration from BBDB
1.2.1 Record Migration
----------------------
It’s possible to migrate records from a BBDB database. The ‘bbdb-file’
variable should point to your current BBDB file; alternately EBDB will
look in the default location, found using ‘(locate-user-emacs-file
"bbdb" ".bbdb)’. Then call ‘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.
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
‘ebdb-default-phone-country’ to the (integer) value of that country’s
code.
File: ebdb.info, Node: Variables and Options, Prev: Record Migration, Up: Migration from BBDB
1.2.2 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.
File: ebdb.info, Node: Migration from Org Contacts, Prev: Migration from BBDB, Up: Getting Started
1.3 Migration from Org Contacts
===============================
EBDB also provides limited support for migrating from Org Contacts:
simply call the command ‘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.
File: ebdb.info, Node: The EBDB Database, Next: Creating Records, Prev: Getting Started, Up: Top
2 The EBDB Database
*******************
EBDB supports multiple databases, and each database definition is saved
in a file on disk. The default database class, ‘ebdb-db-file’, stores
its contacts in the same file as the database itself, though other
database classes may store contacts elsewhere.
-- User Option: 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 ‘ebdb-db’ class. The database at the head of
the list will be considered the default database.
Databases have a few user-facing settings:
-- Instance Variable of Database: boolean read-only
If non-nil, records can only be read from the database, not edited
or deleted.
-- Instance Variable of Database: boolean auto-save
If non-nil, the database’s records will not be autosaved.
-- Instance Variable of Database: character buffer-char
A single character that will be displayed next to records in the
*EBDB* buffer, indicating which database they belong to.
-- Instance Variable of Database: 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
‘ebdb-disable-database’ below.
-- Instance Variable of Database: symbol record-class
The default record class to use when creating new records in this
database. The default is ‘ebdb-default-record-class’.
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.
‘d e’
Use the customize interface to edit the definition of a database
(‘ebdb-customize-database’).
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.
‘d m’
Move a record from its current database to another
(‘ebdb-move-record’).
‘d c’
Copy a record into a new database, leaving it in its existing
database(s) (‘ebdb-copy-record’).
Other database-related commands:
‘d r’
Reload all records from a database. This also redisplays any of
those records that were visible in *EBDB* buffers
(‘ebdb-reload-database’).
‘d d’
This command (‘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 ‘ebdb-customize-database’, set ‘disabled’
to nil, and then reload it with ‘ebdb-reload-database’.
Typically, databases are saved using the ‘s’ binding in ‘ebdb-mode’
buffers, which runs ‘ebdb-save’. If you have open *EBDB* buffers and
unsaved changes, you’ll also be prompted to save the database when
running ‘save-some-buffers’. If this isn’t enough, you can also set
‘ebdb-save-on-exit’ to non-nil to have EBDB saved automatically (and
silently) when killing Emacs. Because killing Emacs already runs
‘save-some-buffers’, this option is typically redundant and defaults to
nil.
Loading and initializing the EBDB can be slow for large databases.
If you find yourself annoyed by the wait, try setting
‘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 ‘nil’ first.
File: ebdb.info, Node: Creating Records, Next: Record Fields, Prev: The EBDB Database, Up: Top
3 Creating Records
******************
Create a record using ‘c’ (‘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 ‘ebdb-sources’.
-- User Option: ebdb-default-record-class
The default record class to use when creating new records.
Defaults to ‘ebdb-record-person’.
Alternately create a record using ‘C’
(‘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:
-- User Option: ebdb-record-self
The value of this option should be the UUID of your own record.
You can find this by pressing ‘T’ (to show all fields) on your
record.
Currently this option’s only use is to serve as a source for
‘ebdb-user-mail-address-re’.
* Menu:
* Record classes::
* Record names::
File: ebdb.info, Node: Record classes, Next: Record names, Up: Creating Records
3.1 Record classes
==================
EBDB comes with two record classes, representing individuals
(‘ebdb-record-person’) and organizations (‘ebdb-record-organization’).
Records can have “roles” at organizations, *note Role Fields: Role
fields.
File: ebdb.info, Node: Record names, Prev: Record classes, Up: Creating Records
3.2 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”.
File: ebdb.info, Node: Record Fields, Next: MUA Interaction, Prev: Creating Records, Up: Top
4 Record Fields
***************
* Menu:
* Inserting New Fields::
* Editing Existing Fields::
* Deleting Records and Fields::
* Field Types::
File: ebdb.info, Node: Inserting New Fields, Next: Editing Existing Fields, Up: Record Fields
4.1 Inserting New Fields
========================
Pressing ‘i’ (‘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 ‘C-g’. The first ‘C-g’ will cancel the
current data prompt; the second ‘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 ‘C-g’.
File: ebdb.info, Node: Editing Existing Fields, Next: Deleting Records and Fields, Prev: Inserting New Fields, Up: Record Fields
4.2 Editing Existing Fields
===========================
Pressing ‘e’ (‘ebdb-edit-field’) with point on a field will allow you to
edit an existing field, with the previous values as defaults.
Alternately, press ‘E’ (‘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.
File: ebdb.info, Node: Deleting Records and Fields, Next: Field Types, Prev: Editing Existing Fields, Up: Record Fields
4.3 Deleting Records and Fields
===============================
Pressing ‘C-k’ on a field will ask you for confirmation, then delete the
field. Pressing ‘C-k’ while point is on or before a record’s main name
will instead prompt to delete the whole record.
File: ebdb.info, Node: Field Types, Prev: Deleting Records and Fields, Up: Record Fields
4.4 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 ‘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 *note 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 ‘C-g’ to omit
the label altogether.
Loading secondary libraries may make more field types available.
* Menu:
* Role fields::
* Tag field::
* Mail folder field::
File: ebdb.info, Node: Role fields, Next: Tag field, Up: Field Types
4.4.1 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 ‘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.
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 ‘R’. This will
create a new organization if point is on a person record, or a new
person if point is on an organization.
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
‘ebdb-create-update-roles’ to nil to disable it.
File: ebdb.info, Node: Tag field, Next: Mail folder field, Prev: Role fields, Up: Field Types
4.4.2 Tag field
---------------
EBDB comes with a field holding arbitrary tags for records. When
searching on the tags field (using ‘/ t’ and selecting “tags”), EBDB
provides the same tag search syntax as Org does, eg.
“work|laptop+night”. *Note (org)Matching tags and properties:: for more
information.
The ‘ebdb-org’ library alters the behavior of this class, offering
all the user’s Org-file tags for completion. *note Org Integration::.
File: ebdb.info, Node: Mail folder field, Prev: Tag field, Up: Field Types
4.4.3 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.
File: ebdb.info, Node: MUA Interaction, Next: Specific MUAs, Prev: Record Fields, Up: Top
5 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::
File: ebdb.info, Node: Loading MUA Code, Next: Display and Updating, Up: MUA Interaction
5.1 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:
(require 'ebdb-gnus)
(require 'ebdb-message)
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.
File: ebdb.info, Node: Display and Updating, Next: EBDB and MUA summary buffers, Prev: Loading MUA Code, Up: MUA Interaction
5.2 Display and Updating
========================
When a message is opened in an MUA, EBDB can do certain things with the
records referenced in that message. It can:
• Pop up a buffer displaying the records.
• Create new records, or alter existing records, based on information
provided by the MUA.
• Run automatic rules to edit the records.
• Provide keybindings to manually edit the records.
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::
File: ebdb.info, Node: Pop-up Buffers, Next: Auto-Updating Records, Up: Display and Updating
5.2.1 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 ‘ebdb’
command, or by cloning or renaming existing buffers.
-- User Option: 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).
-- User Option: 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
‘ebdb-formatter-ebdb-multiline’ or the
‘ebdb-formatter-ebdb-oneline’ class; it defaults to
‘ebdb-default-multiline-formatter’. Other likely options would be
the value of ‘ebdb-default-oneline-formatter’, or a custom-made
formatter, see *note Customizing Record Display::.
EBDB can also integrate with atomic windows (*Note (elisp)Atomic
Windows::).
-- User Option: 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.
-- User Option: 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.
In addition, each MUA has its own customization option for
controlling the window size of pop-up buffers. Each option is named as
‘ebdb-<MUA>-window-size’, and each defaults to
‘ebdb-default-window-size’.
The Gnus and Message MUAs have their own special window configuration
system (*Note (Gnus)Window Layout::). 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 ‘ebdb-gnus-window-configuration’ and
‘ebdb-message-window-configuration’ options to do so. They should be
set to two arbitrary (but distinct) symbols, which will be added to the
‘gnus-window-to-buffer’ alist, and can be used in
‘gnus-add-configuration’ calls, for example:
(gnus-add-configuration
'(article
(vertical 1.0
(summary 0.25 point)
(horizontal 1.0
(article 1.0)
(ebdb-gnus 0.4)))))
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.
File: ebdb.info, Node: Auto-Updating Records, Next: Noticing and Automatic Rules, Prev: Pop-up Buffers, Up: Display and Updating
5.2.2 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:
-- User Option: 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 ‘existing’ (only search for and display
existing records), ‘update’ (only find existing records, and update
their name and mail fields as necessary), ‘query’ (find existing
records, and query about the editing and creation of new records),
and ‘create’ (automatically create new records). A value of ‘t’ is
considered equivalent to ‘create’. The option can also be set to a
function (called with no arguments) which returns one of the above
symbols.
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 ‘message-mode’, you could use the
following:
(setq ebdb-message-auto-update-p
(lambda ()
(unless (ebdb-mua-message-header "Newsgroups")
'query)))
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 ‘ebdb-mua-auto-update-p’:
-- User Option: ebdb-mua-sender-update-p
The default “update-p” value for all mail-sending MUAs.
-- User Option: ebdb-mua-reader-update-p
The default “update-p” value for all mail-reading MUAs.
Even finer-grained control is available using per-MUA versions of the
option, all of them named after the pattern ‘ebdb-<MUA>-auto-update-p’.
When updating records either automatically or interactively, a few
more options come into play:
-- User Option: ebdb-add-name
Whether to automatically change record names. See docstring for
details.
-- User Option: ebdb-add-aka
Whether to automatically add new names as akas. See docstring for
details.
-- User Option: ebdb-add-mails
How to handle apparently new mail addresses. See docstring for
details.
There are also options governing whether EBDB will consider a mail
address or not:
-- User Option: ebdb-accept-header-alist
An alist governing which addresses in which headers will be
accepted. See docstring for details.
-- User Option: ebdb-ignore-header-alist
An alist governing which addresses in which headers will be
ignored. See docstring for details.
-- User Option: ebdb-user-mail-address-re
A regular expression matching the user’s own mail address(es). In
addition to a regexp, this can also be the symbol ‘message’, in
which case the value will be copied from
‘message-alternative-emails’, or the symbol ‘self’, in which case
the value will be constructed from the record pointed to by the
option ‘ebdb-record-self’.
When auto update is set to ‘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.
-- User Option: 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.
When EBDB queries to create or update a record, the ‘i’ key will
ignore the mail permanently; the ‘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.
File: ebdb.info, Node: Noticing and Automatic Rules, Next: Interactive Commands, Prev: Auto-Updating Records, Up: Display and Updating
5.2.3 Noticing and 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:
-- User Option: ebdb-notice-record-hook
This hook is run once per record noticed, with two arguments: the
record, and one of the symbols ‘sender’ and ‘recipient’, indicating
where in the message headers the record was found.
-- User Option: 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.
When a record is noticed, it will also call the method
‘ebdb-notice-field’ on all of its fields. Using this method requires a
bit of familiarity with *note (elisp)Generic Functions::; suffice it to
say that the first argument is the field instance being noticed, the
second argument is one of the symbols ‘sender’ or ‘recipient’, and the
third argument is the record being noticed.
A useful function here is ‘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
‘(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, *note
Manipulating Field Data Programmatically::.
File: ebdb.info, Node: Interactive Commands, Prev: Noticing and Automatic Rules, Up: Display and Updating
5.2.4 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
‘ebdb-mua-update-records’.
‘:’
If the option ‘ebdb-mua-auto-update-p’ is nil, this command
(‘ebdb-mua-update-records’) can be used to do the same thing, and
will behave as if that option were set to ‘query’.
‘;’
If the option ‘ebdb-mua-pop-up’ is nil, this command can be used to
do the same thing (‘ebdb-mua-display-all-records’).
‘'’
Edit the notes field of the message sender
(‘ebdb-mua-edit-sender-notes’).
‘”’
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 ‘q’
will move point back to the previously-selected window, rather than
quitting the EBDB buffer.
‘s’
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.
‘t’
This command toggles the displayed records between the multiline
and oneline display formats.
Other command are not bound by default:
-- Command: ebdb-mua-yank-cc
Prompt for an existing *EBDB* buffer, and add addresses for all the
records displayed there to the “CC:” line of the message being
composed. This command is not bound by default, because the EBDB
keymap is not bound by default in message composition MUAs.
-- Command: ebdb-mua-display-sender
Only display the sender.
-- Command: ebdb-mua-display-recipients
Only display the recipients.
-- Command: ebdb-mua-display-all-recipients
Only display recipients, using all mail addresses from the message.
File: ebdb.info, Node: EBDB and MUA summary buffers, Next: Mail Address Completion, Prev: Display and Updating, Up: MUA Interaction
5.3 EBDB and MUA summary buffers
================================
EBDB can affect the way message senders are displayed in your MUA’s
summary buffer. It can do this in two ways: 1) by changing the way the
contact name is displayed, and 2) by optionally displaying a
one-character mark next to the contact’s name.
* Menu:
* Sender name display::
* Summary buffer marks::
File: ebdb.info, Node: Sender name display, Next: Summary buffer marks, Up: EBDB and MUA summary buffers
5.3.1 Sender name display
-------------------------
EBDB can “unify” the name displayed for a sender that exists in the
database. In general, an MUA will display the name part of the From:
header in the mailbox summary buffer. EBDB can replace that display
name with information from the database. This only works for Gnus,
which allows for overriding how message senders are displayed. The
format letter (see below) should be added to ‘gnus-summary-line-format’
for Gnus (which see).
-- User Option: ebdb-message-clean-name-function
A function used to clean up the name extracted from the headers of
a message.
-- User Option: ebdb-message-mail-as-name
If non-nil, the mail address will be used as a fallback for new
record names.
-- User Option: ebdb-mua-summary-unification-list
A list of fields used by ‘ebdb-mua-summary-unify’ to return a value
for unification. See docstring for details.
-- User Option: ebdb-mua-summary-unify-format-letter
Format letter to use for the EBDB-unified sender name in a Gnus
summary buffer. Defaults to “E”.
File: ebdb.info, Node: Summary buffer marks, Prev: Sender name display, Up: EBDB and MUA summary buffers
5.3.2 Summary buffer marks
--------------------------
EBDB can display a one-character mark next to the name of senders that