Update the list of supported language environments.
[bpt/emacs.git] / man / eudc.texi
CommitLineData
3139018f
GM
1\input texinfo.tex
2@c %**start of header
3@setfilename ../info/eudc
4@settitle Emacs Unified Directory Client (EUDC) Manual
5@iftex
6@afourpaper
7@end iftex
8@c %**end of header
9
10@footnotestyle end
11
12@ifinfo
4c2ca4f3 13@dircategory Emacs
3139018f 14@direntry
eee9fd25 15* EUDC: (eudc). A client for directory servers (LDAP, PH)
3139018f
GM
16@end direntry
17
18This file documents EUDC v1.30b
19
20EUDC is part of Emacs.
21
22EUDC is the Emacs Unified Directory Client, a common interface to
23directory servers using various protocols such as LDAP or the CCSO white
24pages directory system (PH/QI)
25
26Copyright @copyright{} 1998, 2000 Free Software Foundation, Inc.
27
28Permission is granted to make and distribute verbatim
29copies of this manual provided the copyright notice and
30this permission notice are preserved on all copies.
31
32@ignore
33Permission is granted to process this file through TeX
34and print the results, provided the printed document
35carries a copying permission notice identical to this
36one except for the removal of this paragraph (this
37paragraph not being relevant to the printed manual).
38@end ignore
39
40Permission is granted to copy and distribute modified
41versions of this manual under the conditions for
42verbatim copying and the terms of the ``GNU General
43Public License'', and provided that the entire
44resulting derived work is distributed under the terms
45of a permission notice identical to this one.
46
47Permission is granted to copy and distribute
48translations of this manual into another language,
49under the above conditions for modified versions,
50except that this permission notice may be stated in a
51translation approved by the Free Software Foundation.
52@end ifinfo
53
54@titlepage
55@title{EUDC Manual}
56@subtitle{The Emacs Unified Directory Client}
57@author by Oscar Figueiredo
58@code{1.30b}
59
60@page
61@vskip 0pt plus 1fill
62 Copyright @copyright{} 1998, 2000 Free Software Foundation, Inc.
63
64 Permission is granted to make and distribute verbatim
65 copies of this manual provided the copyright notice and
66 this permission notice are preserved on all copies.
67
68 @ignore
69 Permission is granted to process this file through TeX
70 and print the results, provided the printed document
71 carries a copying permission notice identical to this
72 one except for the removal of this paragraph (this
73 paragraph not being relevant to the printed manual).
74
75 @end ignore
76
77 Permission is granted to copy and distribute modified
78 versions of this manual under the conditions for
79 verbatim copying and the terms of the ``GNU General
80 Public License'', and provided that the entire
81 resulting derived work is distributed under the terms
82 of a permission notice identical to this one.
83
84 Permission is granted to copy and distribute
85 translations of this manual into another language,
86 under the above conditions for modified versions,
87 except that this permission notice may be stated in a
88 translation approved by the Free Software Foundation.
89@end titlepage
90
91@ifinfo
92@node Top, Overview, (dir), (dir)
93@comment node-name, next, previous, up
94
95
96This manual documents EUDC v1.30b, the Emacs Unified Directory Client.
97
98A common interface to directory servers using various protocols such as
99LDAP or the CCSO white pages directory system (PH/QI)
100
101@end ifinfo
102
103@menu
104* Overview:: Summary of EUDC features
105* Installation:: How to install EUDC
106* Usage:: The various usage possibilities explained
107* Credits:: Who's done what
108* Variables Index::
109@end menu
110
111
112
113
114
115@node Overview, Installation, Top, Top
116@comment node-name, next, previous, up
117@chapter Overview
118
119EUDC, the Emacs Unified Directory Client, provides a common user
120interface to access directory servers using different directory
121protocols.
122
123Currently supported back-ends are:
124
125@itemize @bullet
126@item
127LDAP, Lightweight Directory Access Protocol
128@item
129CCSO PH/QI
130@item
131BBDB, Big Brother's Insiduous Database
132@end itemize
133
134The main features of the EUDC interface are:
135
136@itemize @bullet
137@item
138Queries using a customizable form
139@item
140Inline query expansion (for instance you can expand a name
141to an email address in a mail message buffer using a server as an
142address book)
143@item
144Multiple servers can be tried in turn until a match is found for an
145inline query
146@item
147Fast minibuffer queries for email addresses and phone numbers
148@item
149Interface to BBDB to let you insert server records into your own BBDB database
150(@pxref{Top,,BBDB,bbdb,BBDB Manual})
151@end itemize
152
153@menu
154* LDAP:: What is LDAP ?
155* CCSO PH/QI:: What is CCSO, PH, QI ?
156* BBDB:: What is BBDB ?
157@end menu
158
159
160
161@node LDAP, CCSO PH/QI, Overview, Overview
162@comment node-name, next, previous, up
163@section LDAP
164
165LDAP, Lightweight Directory Access Protocol, is a communication
166protocol for directory applications defined in RFC 1777.
167
168Quoted from RFC 1777:
169
170@quotation
171[LDAP] is designed to provide access to the X.500 Directory while not
172incurring the resource requirements of the Directory Access Protocol
173(DAP). This protocol is specifically targeted at simple management
174applications and browser applications that provide simple read/write
175interactive access to the X.500 Directory, and is intended to be a
176complement to the DAP itself.
177@end quotation
178
179LDAP servers usually store (but are not limited to) information about
180people such as their name, phone number, email address, office
181location, etc@enddots{} More information about LDAP can be found at
182@url{http://www.openldap.org/}
183
184EUDC requires external support to access LDAP directory servers
185(@pxref{LDAP Requirements})
186
187
188@node CCSO PH/QI, BBDB, LDAP, Overview
189@comment node-name, next, previous, up
190@section CCSO PH/QI
191
192The Central Computing Services Office (CCSO) of the University of
193Illinois at Urbana Champaign (UIUC) created and freely distributes a
194directory system that is currently in use in more than 300 organizations
195around the world. The system records information about people such as
196their address, phone number, email, academic information or any other
197details it was configured to.
198
199The system consists of two parts: a database server traditionally called
200@samp{qi} and a command-line client called @samp{ph}.
201@url{ftp://uiarchive.cso.uiuc.edu/pub/packages/ph} is the main
202distribution site. @url{http://www.uiuc.edu/cgi-bin/ph/lookup?Query=.}
203provides a listing of the active @samp{qi} servers.
204
205The original command-line @samp{ph} client that comes with the
206@samp{ph/qi} distribution provides additional features like the
207possibility to communicate with the server in login-mode which makes it
208possible to change records in the database. This is not implemented in
209EUDC.
210
211
212@node BBDB, , CCSO PH/QI, Overview
213@comment node-name, next, previous, up
214@section BBDB
215
216BBDB is the Big Brother's Insiduous Database, a package for Emacs
217originally written by Jamie Zawinski which provides rolodex-like
218database functionality featuring tight integration with the Emacs mail
219and news readers.
220
221It is often used as an enhanced email address book.
222
223EUDC considers BBDB as a directory server backend just like LDAP or
224PH/QI servers though BBDB has no client/server protocol and thus always
225resides locally on your machine. The point in this is not to offer an
226alternate way to query your BBDB database (BBDB itself provides much
227more flexible ways to do that) but rather to offer an interface to your
228local directory that is consistent with the interface to external
229directories (LDAP, PH/QI). This is particularly interesting when
230performing queries on multiple servers.
231
232EUDC also offers a means to insert results from directory queries into
233your own local BBDB (@pxref{Creating BBDB Records})
234
235@node Installation, Usage, Overview, Top
236@comment node-name, next, previous, up
237@chapter Installation
238
239Add the following to your @file{.emacs} init file:
240@lisp
241(require 'eudc)
242@end lisp
243This will install EUDC at startup.
244
245After installing EUDC you will find (the next time you launch Emacs) a
246new @code{Directory Search} submenu in the @samp{Tools} menu that will
247give you access to EUDC.
248
249You may also find it useful to add the following to your @file{.emacs}
250initialization file to add a shortcut for email address expansion in
251email composition buffers (@pxref{Inline Query Expansion})
252
253@lisp
254(eval-after-load
255 "message"
256 '(define-key message-mode-map [(control ?c) (tab)] 'eudc-expand-inline))
257(eval-after-load
258 "sendmail"
259 '(define-key mail-mode-map [(control ?c) (tab)] 'eudc-expand-inline))
260@end lisp
261
262@menu
263* LDAP Requirements:: EUDC needs external support for LDAP
264@end menu
265
266@node LDAP Requirements, , Installation, Installation
267@comment node-name, next, previous, up
268@section LDAP Requirements
269
270LDAP support is added by means of @file{ldap.el} which is part of Emacs.
271@file{ldap.el} needs an external command line utility named
272@file{ldapsearch} which is available as part of LDAP toolkits. above.
273
274@itemize @bullet
275@item
276Open LDAP Libraries
277(@url{http://www.openldap.org/})
278@item
279University of Michigan's LDAP Client software
280(@url{http://www.umich.edu/~dirsvcs/ldap/})
281@end itemize
282
283
284@node Usage, Credits, Installation, Top
285@comment node-name, next, previous, up
286@chapter Usage
287
288This chapter describes the usage of EUDC. Most functions and
289customization options are available through the @samp{Directory Search}
290submenu of the @samp{Tools} submenu.
291
292@menu
293* Querying Servers:: How queries are performed and handled
294* Query Form:: How to use and customize the query form
295* Display of Query Results:: Controlling how query results are presented
296* Inline Query Expansion:: How to use and customize inline queries
297* The Server Hotlist:: How to use and manage the server hotlist
298* Multi-server Queries:: How to query multiple servers sucessively
299* Creating BBDB Records:: How to insert query results into your BBDB
300* Server/Protocol Locals:: Customizing on a per server/protocol basis
301@end menu
302
303
304@node Querying Servers, Query Form, Usage, Usage
305@comment node-name, next, previous, up
306@section Querying Servers
307
308EUDC's basic functionality is to let you query a directory server and
309return the results back to you. There are several things you may want
310to customize in this process.
311
312
313@menu
314* Selecting a Server:: The first thing to do
315* Return Attributes:: Configuring what the server should return
316* Duplicate Attributes:: What to do when records have duplicate attributes
317@end menu
318
319@node Selecting a Server, Return Attributes, Querying Servers, Querying Servers
320@subsection Selecting a Server
321
322Before doing any query you will need to set the directory server. You
323need to specify the name of the host machine running the server software
324and the protocol to use. If you do not set the server in any fashion,
325EUDC will ask you for one when you make your first query.
326
327You can set the server by selecting one from your hotlist of servers
328(@pxref{The Server Hotlist}) available in the @samp{Server} submenu or
329by selecting @samp{New Server} in that same menu.
330
331LDAP servers generally require some configuration before you can perform
332queries on them. In particular, the @dfn{search base} must be
333configured. If the server you select has no configured search base then
334EUDC will propose you to configure it at this point. A customization
335buffer will be displayed where you can edit the search base and other
336parameters for the server.
337
338@defvar eudc-server
339The name or IP address of the remote directory server. A TCP port number
340may be specified by appending a colon and a number to the name of the
341server. You will not need this unless your server runs on a port other
342than the default (which depends on the protocol).
343If the directory server resides on your own computer (which is the case
344if you use the BBDB backend) then `localhost' is a reasonable value but
345it will be ignored anyway.
346@end defvar
347
348@defvar eudc-protocol
349The directory protocol to use to query the server. Currently supported
350protocols in this version of EUDC are @code{ph}, @code{ldap} and @code{bbdb}.
351@end defvar
352
353@deffn Command eudc-set-server
354This command accessible from @samp{Server} submenu lets you specify a
355new directory server and protocol.
356@end deffn
357
358@node Return Attributes, Duplicate Attributes, Selecting a Server, Querying Servers
359@subsection Return Attributes
360
361Directory servers may be configured to return a default set of
362attributes for each record matching a query if the query specifies none.
363The variable @code{eudc-default-return-attributes} controls the return
364attributes you want to see, if different from the server defaults.
365
366@defvar eudc-default-return-attributes
367A list of the default attributes to extract from directory entries. If
368set to the symbol @code{all} then all available attributes are
369returned. A value of @code{nil}, the default, means to return the
370default attributes as configured in the server.
371@end defvar
372
373The server may return several matching records to a query. Some of the
374records may however not contain all the attributes you requested. You can
375discard those records.
376
377@defopt eudc-strict-return-matches
378If non-@code{nil}, entries that do not contain all the requested return
379attributes are ignored. Default is @code{t}.
380@end defopt
381
382@node Duplicate Attributes, , Return Attributes, Querying Servers
383@subsection Duplicate Attributes
384
385Directory standards may authorize different instances of the same
386attribute in a record. For instance the record of a person may contain
387several email fields containing different email addresses. When using
388a QI directory server this is difficult to distinguish from attributes
389having multi-line values such as the postal address that may contain a
390line for the street and another one for the zip code and city name. In
391both cases, EUDC will consider the attribute duplicated.
392
393EUDC has several methods to deal with duplicated attributes. The
394available methods are:
395
396@table @code
397@item list
398Makes a list with the different values of the duplicate attribute. The
399record is returned with only one instance of the attribute with a list
400of all the different values as a value. This is the default method that
401is used to handle duplicate fields for which no other method has been
402specified.
403@item first
404Discards all the duplicate values of the field keeping only the first
405one.
406@item concat
407Concatenates the different values using a newline as a separator. The
408record keeps only one instance of the field the value of which is a
409single multi-line string.
410@item duplicate
411Duplicates the whole record into as many instances as there are different
412values for the field. This is the default for the email field. Thus a
413record containing 3 different email addresses is duplicated into three
414different records each having a single email address. This is
415particularly useful in combination with @code{select} as the method to
416handle multiple matches in inline expansion queries (@pxref{Inline Query
417Expansion}) because you are presented with the 3 addresses in a
418selection buffer
419@end table
420
421Because a method may not be applicable to all fields, the variable
422@code{eudc-duplicate-attribute-handling-method} lets you specify either a
423default method for all fields or a method for each individual field.
424
425@defvar eudc-duplicate-attribute-handling-method
426A method to handle entries containing duplicate attributes. This is
427either an alist @code{(@var{attr} . @var{method})} or a symbol
428@var{method}. The alist form of the variable associates a method to an
429individual attribute name, the second form specifies a method applicable
430to all attribute names. Available methods are: @code{list},
431@code{first}, @code{concat}, @code{duplicate} (see above). Defaults to
432@code{list}.
433@end defvar
434
435
436
437@node Query Form, Display of Query Results, Querying Servers, Usage
438@comment node-name, next, previous, up
439@section Query Form
440
441The simplest way to query your directory server is to use the query
442form. You display the query form with the @samp{Query with Form} menu
443item or by invoking the command @kbd{M-x eudc-query-form}. The attribute
444names presented in this form are defined by the
445@code{eudc-query-form-attributes} variable (unless a non-@code{nil}
446argument is supplied to @code{eudc-query-form}).
447
448Since the different directory protocols to which EUDC interfaces may
449use different names for equivalent attributes, EUDC defines its own set
450of attribute names and a mapping between these names and their
451protocol-specific equivalent through the variable
452@code{eudc-protocol-attributes-translation-alist}. Names currently
453defined by EUDC are @code{name}, @code{firstname}, @code{email} and
454@code{phone}.
455
456@defvar eudc-query-form-attributes
457A list of attributes presented in the query form. Attribute names in
458this list should be either EUDC attribute names or valid attribute
459names. You can get a list of valid attribute names for the current
460protocol with the @samp{List Valid Attribute Names} menu item or the
461@kbd{M-x eudc-get-attribute-list} command. Defaults to @code{name},
462@code{email} and @code{phone}.
463@end defvar
464
465@deffn Command eudc-query-form get-fields-from-server
466Display a form to query the directory server. If given a non-@code{nil}
467argument the function first queries the server for the existing fields
468and displays a corresponding form. Not all protocols may support a
469non-@code{nil} argument here.
470@end deffn
471
472Since the names of the fields may not be explicit enough or adapted to
473be directly displayed as prompt strings in the form, the variable
474@code{eudc-user-attribute-names-alist} lets you define more explicit
475names for directory attribute names. This variable is ignored if
476@code{eudc-use-raw-directory-names} is non-@code{nil}.
477
478@defvar eudc-user-attribute-names-alist
479This is an alist of user-defined names for the directory attributes used in
480query/response forms. Prompt strings for attributes that are not in this
481alist are derived by splitting the attribute name at underscores and
482capitalizing the individual words.
483@end defvar
484
485@defvar eudc-use-raw-directory-names
486If non-@code{nil}, use attributes names as defined in the directory.
487Otherwise, directory query/response forms display the user attribute
488names defined in @code{eudc-user-attribute-names-alist}.
489@end defvar
490
491@node Display of Query Results, Inline Query Expansion, Query Form, Usage
492@comment node-name, next, previous, up
493@section Display of Query Results
494
495Upon successful completion of a form query, EUDC will display a buffer
496containing the results of the query.
497
498The fields that are returned for each record
499are controlled by @code{eudc-default-return-attributes} (@pxref{Return
500Attributes}).
501
502The display of each individual field can be performed by an arbitrary
503function which allows specific processing for binary values like images
504or audio samples as well as values with computer semantics like URLs.
505
506@defvar eudc-attribute-display-method-alist
507An alist specifying methods to display attribute values. Each member of
508the list is of the form @code{(@var{name} . @var{func})} where
509@var{name} is a lowercased string naming a directory attribute
510(translated according to @code{eudc-user-attribute-names-alist} if
511@code{eudc-use-raw-directory-names} is non-nil) and @var{func} a
512function that will be passed the corresponding attribute values for
513display.
514@end defvar
515
516This variable has protocol-local definitions (see @pxref{Server/Protocol
517Locals}). For instance, it is defined as follows for LDAP:
518
519@lisp
520(eudc-protocol-set 'eudc-attribute-display-method-alist
521 '(("jpegphoto" . eudc-display-jpeg-inline)
522 ("labeledurl" . eudc-display-url)
523 ("audio" . eudc-display-sound)
524 ("labeledurl" . eudc-display-url)
525 ("url" . eudc-display-url))
526 'ldap)
527@end lisp
528
529EUDC provides a set of built-in functions to display binary value types:
530
531@defun eudc-display-generic-binary data
532Display a button for unidentified binary @var{data}.
533@end defun
534
535@defun eudc-display-url url
536Display URL and make it clickable.
537@end defun
538
539@defun eudc-display-sound data
540Display a button to play the sound @var{data}.
541@end defun
542
543@defun eudc-display-jpeg-inline data
544Display the JPEG @var{data} inline at point if possible.
545@end defun
546
547@defun eudc-display-jpeg-as-button data
548Display a button for the JPEG @var{data}.
549@end defun
550
551Right-clicking on a binary value button pops up a contextual menu with
552options to process the value. Among these are saving the attribute
553value to a file or sending it to an external viewer command. External
554viewers should expect the value on their standard input and should
555display it or perform arbitrary processing on it. Messages sent to
556standard output are discarded. External viewers are listed in the
557variable @code{eudc-external-viewers} which you can customize.
558
559@defvar eudc-external-viewers
560This is a list of viewer program specifications. Each specification is
561a list whose first element is a string naming the viewer for unique
562identification, the second element is the executable program which
563should be invoked and the following elements are arguments that should
564be passed to the program.
565@end defvar
566
567
568@node Inline Query Expansion, The Server Hotlist, Display of Query Results, Usage
569@comment node-name, next, previous, up
570@section Inline Query Expansion
571
572Inline query expansion is a powerful method to get completion from your
573directory server. The most common usage is for expanding names to email
574addresses in mail message buffers. The expansion is performed by the
575command @kbd{M-x eudc-expand-inline} which is available from the
576@samp{Directory Search} menu but can also be conveniently bound to a key
577shortcut (@pxref{Installation}) The operation is controlled by the
578variables @code{eudc-inline-expansion-format},
579@code{eudc-inline-query-format},
580@code{eudc-expanding-overwrites-query} and
581@code{eudc-multiple-match-handling-method}.
582
583If the query fails for a server, other servers may be tried successively
584until one of them finds a match (@pxref{Multi-server Queries}).
585
586@deffn Command eudc-expand-inline replace-p
587Query the server and expand the query string before point. The query
588string consists of the buffer substring from the point back to the
589preceding comma, colon or beginning of
590line. @code{eudc-inline-query-format} controls how individual words
591are mapped onto directory attribute names. After querying the server
592for the given string, the expansion specified by
593@code{eudc-inline-expansion-format} is inserted in the buffer at
594point. If @var{replace-p} is @code{t} then this expansion replaces the
595query string in the buffer. If @code{eudc-expanding-overwrites-query}
596is non-@code{nil} then the meaning of @var{replace-p} is negated.
597@end deffn
598
599@defvar eudc-inline-query-format
600Format of an inline expansion query.
601This is actually a list of @var{format}s. A @var{format} is a list of
602one or more EUDC attribute names. A @var{format} applies if it contains
603as many attributes as individual words in the inline query string. If
604several @var{format}s apply then they are tried in order until a match
605is found. If @code{nil} all the words will be mapped onto the default
606server/protocol attribute name (generally @code{name}).
607
608For instance, use the following
609@lisp
610(setq eudc-inline-query-format '((name)
611 (firstname)
612 (firstname name)))
613@end lisp
614to indicate that single word expansion queries are to be considered as
615surnames and if no match is found then they should be tried as first
616names. Inline queries consisting of two words are considered as
617consisting of a first name followed by a surname. If the query consists
618of more than two words, then the first one is considered as the first
619name and the remaining words are all considered as surname constituents.
620
621@var{format}s are in fact not limited to EUDC attribute names, you can
622use server or protocol specific names in them. It may be safer if you
623do so, to set the variable @code{eudc-inline-query-format} in a protocol
624or server local fashion (see @pxref{Server/Protocol Locals}).
625
626For instance you could use the following to match up to three words
627against the @code{cn} attribute of LDAP servers:
628@lisp
629(eudc-protocol-set 'eudc-inline-query-format
630 '((cn)
631 (cn cn)
632 (cn cn cn))
633 'ldap)
634@end lisp
635@end defvar
636
637@defvar eudc-inline-expansion-format
638This variable lets you control exactly what is inserted into the buffer
639upon an inline expansion request. It is a list whose first element is a
640string passed to @code{format}. Remaining elements are symbols
641corresponding to directory attribute names. The corresponding attribute
642values are passed as additional arguments to @code{format}. Default is
643@code{("%s" email)} but you may want to consider a value like @code{("%s
644<%s>" name email)}
645@end defvar
646
647@defvar eudc-multiple-match-handling-method
648This variable controls what to do when multiple entries match a query
649for an inline expansion. Possible values are:
650@table @code
651@item first
652The first match is considered as being the only one, the others are
653discarded.
654@item select
655A selection buffer pops up where you can choose a particular match. This
656is the default value of the variable.
657@item all
658The expansion uses all records successively
659@item abort
660An error is signaled. The expansion aborts.
661@end table
662
663
664Defaults to @code{select}
665@end defvar
666
667
668
669@node The Server Hotlist, Multi-server Queries, Inline Query Expansion, Usage
670@comment node-name, next, previous, up
671@section The Server Hotlist
672
673EUDC lets you maintain a list of frequently used servers so that you
674can easily switch from one to another. This hotlist appears in the
675@samp{Server} submenu. You select a server in this list by clicking on
676its name. You can add the current server to the list with the command
677@kbd{M-x eudc-bookmark-current-server}. The list is contained in the variable
678@code{eudc-server-hotlist} which is stored in and retrieved from the file
679designated by @code{eudc-options-file}. EUDC also provides a facility to
680edit the hotlist interactively (@pxref{The Hotlist Edit Buffer}).
681
682The hotlist is also used to make queries on multiple servers
683successively (@pxref{Multi-server Queries}). The order in which the
684servers are tried is the order they appear in the hotlist, therefore it
685is important to sort the hotlist appropriately.
686
687@deffn Command eudc-bookmark-server server
688Add @var{server} to the hotlist of servers
689@end deffn
690
691@deffn Command eudc-bookmark-current-server
692Add the current server to the hotlist of servers
693@end deffn
694
695@defvar eudc-options-file
696The name of a file where EUDC stores its internal variables
697(the hotlist and the current server). EUDC will try to load
698that file upon initialization so, if you choose a file name
699different from the defaults @file{~/.eudc-options}, be sure to set this
700variable to the appropriate value @emph{before} EUDC is itself
701loaded.
702@end defvar
703
704@menu
705* The Hotlist Edit Buffer:: An interactive hotlist editing facility
706@end menu
707
708@node The Hotlist Edit Buffer, , The Server Hotlist, The Server Hotlist
709@comment node-name, next, previous, up
710@subsection The Hotlist Edit Buffer
711
712The hotlist edit buffer offers a means to manage a list of frequently
713used servers. Commands are available in the context pop-up menu
714generally bound to the right mouse button. Those commands also have
715equivalent keybindings.
716
717@deffn Command eudc-hotlist-add-server
718Bound to @kbd{a}.
719Add a new server to the hotlist on the line after point
720@end deffn
721
722@deffn Command eudc-hotlist-delete-server
723Bound to @kbd{d}.
724Delete the server on the line point is on
725@end deffn
726
727@deffn Command eudc-hotlist-select-server
728Bound to @kbd{s}.
729Select the server the point is on as the current directory server for
730the next queries
731@end deffn
732
733@deffn Command eudc-hotlist-transpose-servers
734Bound to @kbd{t}.
735Bubble up the server the point is on to the top of the list
736@end deffn
737
738@deffn Command eudc-hotlist-quit-edit
739Bound to @kbd{q}.
740Save the changes and quit the hotlist edit buffer. Use @kbd{x} or
741@kbd{M-x kill-buffer} to exit without saving.
742@end deffn
743
744
745@node Multi-server Queries, Creating BBDB Records, The Server Hotlist, Usage
746@comment node-name, next, previous, up
747@section Multi-server Queries
748
749When using inline query expansion (@pxref{Inline Query Expansion}), EUDC
750can try to query successively a sequence of directory servers until one
751of them successfully finds a match for the query.
752
753@defvar eudc-inline-expansion-servers
754This variable controls which servers are tried and in which order when
755trying to perform an inline query. Possible values are:
756@table @code
757@item current-server
758Only the current directory server is tried
759@item hotlist
760The servers in the hotlist are tried in order until one finds a match
761for the query or `eudc-max-servers-to-query' is reached
762@item server-then-hotlist
763The current server then the servers in the hotlist are tried in the
764order they appear in the hotlist until one of them finds a match or
765`eudc-max-servers-to-query' is reached. This is the default.
766@end table
767@end defvar
768
769@defvar eudc-max-servers-to-query
770This variable indicates the maximum number of servers to query when
771performing a multi-server query. The default, @code{nil}, indicates
772that all available servers should be tried.
773@end defvar
774
775
776
777@node Creating BBDB Records, Server/Protocol Locals, Multi-server Queries, Usage
778@comment node-name, next, previous, up
779@section Creating BBDB Records
780
781With EUDC, you can automatically create BBDB records
782(@pxref{Top,,BBDB,bbdb,BBDB Manual}) from records you get from a
783directory server. You do this by moving point to the appropriate
784record in a query result display buffer and invoking the command
785@kbd{M-x eudc-insert-record-at-point-into-bbdb} with the
786keyboard binding @kbd{b} @footnote{This keybinding does not actually
787call @code{eudc-insert-record-at-point-into-bbdb} but uses
788@code{eudc-try-bbdb-insert} instead.}, or with the menu. EUDC
789cannot update an existing BBDB record and will signal an error if you
790try to insert a record matching an existing one.
791
792It is also possible to export to BBDB the whole batch of records
793contained in the directory query result with the command
794@kbd{M-x eudc-batch-export-records-to-bbdb}.
795
796Because directory systems may not enforce a strict record format, local
797server installations may use different attribute names and have
798different ways to organize the information. Furthermore BBDB has its own
799record structure. For these reasons converting a record from its
800external directory format to the BBDB format is a highly customizable
801process.
802
803@defvar eudc-bbdb-conversion-alist
804The value of this variable should be a symbol naming an alist defining a
805mapping between BBDB field names onto directory attribute names records.
806This is a protocol-local variable and is initialized upon protocol
807switch (@pxref{Server/Protocol Locals}) The alist is made of cells of the
808form @code{(@var{bbdb-field} . @var{spec-or-list})}.
809@var{bbdb-field} is the name of a field
810that must be defined in your BBDB environment (standard field names are
811@code{name}, @code{company}, @code{net}, @code{phone}, @code{address}
812and @code{notes}).
813@var{spec-or-list} is either a single mapping specification or a list of
814mapping specifications. Lists of mapping specifications are valid for
815the @code{phone} and @code{address} BBDB fields only. @var{spec}s are
816actually s-expressions which are evaluated as follows:
817
818@table @asis
819@item a string
820evaluates to itself
821@item a symbol
822evaluates to the symbol value. Symbols corresponding to directory
823attribute names present in the record evaluate to the value of the field
824in the record
825@item a form
826is evaluated as a function. The argument list may contain attribute
827names which evaluate to the corresponding values in the record. The form
828evaluation should return something appropriate for the particular
829@var{bbdb-field} (see @code{bbdb-create-internal}).
830@code{eudc-bbdbify-phone} and @code{eudc-bbdbify-address} are provided as
831convenience functions to parse phones and addresses.
832@end table
833@end defvar
834
835The default value of the PH-specific value of that variable is
836@code{eudc-ph-bbdb-conversion-alist}:
837
838@lisp
839((name . name)
840 (net . email)
841 (address . (eudc-bbdbify-address address "Address"))
842 (phone . ((eudc-bbdbify-phone phone "Phone")
843 (eudc-bbdbify-phone office_phone "Office Phone"))))
844@end lisp
845
846This means that:
847
848@itemize @bullet
849@item
850the @code{name} field of the BBDB record gets its value
851from the @code{name} attribute of the directory record
852@item
853the @code{net} field of the BBDB record gets its value
854from the @code{email} attribute of the directory record
855@item
856the @code{address} field of the BBDB record is obtained by parsing the
857@code{address} attribute of the directory record with the function
858@code{eudc-bbdbify-address}
859@item
860two @code{phone} fields are created (when possible) in the BBDB record.
861The first one has @cite{Phone} for location and its value is obtained by
862parsing the @code{phone} attribute of the PH/QI record with the function
863@code{eudc-bbdbify-phone}. The second one has @cite{Office Phone} for location
864its value is obtained by parsing the @code{office_phone} attribute of the
865PH/QI record with the function @code{eudc-bbdbify-phone}.
866@end itemize
867
868@defun eudc-bbdbify-phone phone location
869This is a convenience function provided for use in
870@code{eudc-bbdb-conversion-alist}. It parses @var{phone} into a vector
871compatible with @code{bbdb-create-internal}. @var{phone} is either a string
872supposedly containing a phone number or a list of such strings which are
873concatenated. @var{location} is used as the phone location for BBDB.
874@end defun
875
876@defun eudc-bbdbify-address addr location
877This is a convenience function provided for use in
878@code{eudc-bbdb-conversion-alist}. It parses @var{addr} into a vector
879compatible with @code{bbdb-create-internal}. @var{addr} should be an
880address string of no more than four lines or a list of lines. The last
881line is searched for the zip code, city and state name. @var{location}
882is used as the phone location for BBDB.
883@end defun
884
885Note that only a subset of the attributes you selected with
886@code{eudc-default-return-attributes} and that are actually displayed may
887actually be inserted as part of the newly created BBDB record.
888
889
890@node Server/Protocol Locals, , Creating BBDB Records, Usage
891@comment node-name, next, previous, up
892@section Server/Protocol Locals
893
894EUDC can be customized independently for each server or directory
895protocol. All variables can be given local bindings that are activated
896when a particular server and/or protocol becomes active. This is much
897like buffer-local bindings but on a per server or per protocol basis.
898
899@menu
900* Manipulating local bindings:: Functions to set and query local bindings
901@end menu
902
903@node Manipulating local bindings, , Server/Protocol Locals, Server/Protocol Locals
904@comment node-name, next, previous, up
905@subsection Manipulating local bindings
906
907EUDC offers functions that let you set and query variables on a per
908server or per protocol basis.
909
910The following predicates allow you to test the existence of
911server/protocol local bindings for a particular variable.
912
913@defun eudc-server-local-variable-p var
914Return non-@code{nil} if @var{var} has server-local bindings
915@end defun
916
917@defun eudc-protocol-local-variable-p var
918Return non-@code{nil} if @var{var} has protocol-local bindings
919@end defun
920
921The following functions allow you to set the value of a variable with
922various degrees of localness.
923
924@defun eudc-default-set var val
925Set the EUDC default value of @var{var} to @var{val}.
926The current binding of @var{var} (if local to the current server or
927protocol) is not changed.
928@end defun
929
930@defun eudc-protocol-set var val &optional protocol
931Set the binding of @var{var} local to @var{protocol} to @var{val}. If
932omitted, @var{protocol} defaults to the current value of
933@code{eudc-protocol}. The current binding of @var{var} is changed only
934if @var{protocol} is omitted.
935@end defun
936
937@defun eudc-server-set var val &optional server
938Set the binding of @var{var} local to @var{server} to @var{val}. If
939omitted, @var{server} defaults to the current value of
940@code{eudc-server}. The current binding of @var{var} is changed only if
941@var{server} is omitted.
942@end defun
943
944@defun eudc-set var val
945Set the most local (server, protocol or default) binding of @var{var} to
946@var{val}. The current binding of @var{var} is also set to @var{val}.
947@end defun
948
949The following variables allow you to query the various bindings of a
950variable (local or non-local).
951
952@defun eudc-variable-default-value var
953Return the default binding of @var{var} (outside of a particular server
954or protocol local binding).
955Return @code{unbound} if @var{var} has no EUDC default value.
956@end defun
957
958@defun eudc-variable-protocol-value var &optional protocol
959Return the value of @var{var} local to @var{protocol}. Return
960@code{unbound} if @var{var} has no value local to @var{protocol}.
961@var{protocol} defaults to @code{eudc-protocol}.
962@end defun
963
964@defun eudc-variable-server-value var [server]
965Return the value of @var{var} local to @var{server}.
966Return @code{unbound} if @var{var} has no value local to @var{server}.
967@var{server} defaults to @code{eudc-server}.
968@end defun
969
970
971Changing a protocol-local or server-local value of a variable has no
972effect on its current value. The following command is used to
973synchronize the current values of variables with their local values
974given the current @code{eudc-server} and @code{eudc-protocol}:
975
976@defun eudc-update-local-variables
977Update all EUDC variables according to their local settings.
978@end defun
979
980
981
982@node Credits, Variables Index, Usage, Top
983@comment node-name, next, previous, up
984@chapter Credits
985
986EUDC was written by Oscar Figueiredo based on @file{ph.el} by the
987same author.
988
989Thanks to Soren Dayton for his suggestions, his enthusiasm and his help
990in testing and proofreading the code and docs of @file{ph.el}.
991
992@node Variables Index, , Credits, Top
993@comment node-name, next, previous, up
994@unnumbered Variables Index
995
996@printindex vr
997
56f7c94a 998@setchapternewpage odd
3139018f
GM
999@contents
1000@bye