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