\input texinfo.tex@c %**start of header@setfilename ../info/eudc@settitle Emacs Unified Directory Client (EUDC) Manual@iftex@afourpaper@end iftex@c %**end of header@footnotestyle end@ifinfo@dircategory Emacs@direntry* EUDC: (eudc). An Emacs client for directory servers (LDAP, PH).@end direntryThis file documents EUDC v1.30bEUDC is part of Emacs.EUDC is the Emacs Unified Directory Client, a common interface todirectory servers using various protocols such as LDAP or the CCSO whitepages directory system (PH/QI)Copyright 1998, 2000, 2001 Free Software Foundation, Inc.Permission is granted to copy, distribute and/or modify this documentunder the terms of the GNU Free Documentation License, Version 1.1 orany later version published by the Free Software Foundation; with noInvariant Sections, with the Front-Cover texts being ``A GNUManual'', and with the Back-Cover Texts as in (a) below. A copy of thelicense is included in the section entitled ``GNU Free DocumentationLicense'' in the Emacs manual.(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modifythis GNU Manual, like GNU software. Copies published by the FreeSoftware Foundation raise funds for GNU development.''This document is part of a collection distributed under the GNU FreeDocumentation License. If you want to distribute this documentseparately from the collection, you can do so by adding a copy of thelicense to the document, as described in section 6 of the license.@end ifinfo@titlepage@title{EUDC Manual}@subtitle{The Emacs Unified Directory Client}@author by Oscar Figueiredo@code{1.30b}@page@vskip 0pt plus 1fillCopyright @copyright{} 1998, 2000, 2001 Free Software Foundation, Inc.Permission is granted to copy, distribute and/or modify this documentunder the terms of the GNU Free Documentation License, Version 1.1 orany later version published by the Free Software Foundation; with noInvariant Sections, with the Front-Cover texts being ``A GNUManual'', and with the Back-Cover Texts as in (a) below. A copy of thelicense is included in the section entitled ``GNU Free DocumentationLicense'' in the Emacs manual.(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modifythis GNU Manual, like GNU software. Copies published by the FreeSoftware Foundation raise funds for GNU development.''This document is part of a collection distributed under the GNU FreeDocumentation License. If you want to distribute this documentseparately from the collection, you can do so by adding a copy of thelicense to the document, as described in section 6 of the license.@end titlepage@ifinfo@node Top, Overview, (dir), (dir)@comment node-name, next, previous, upThis manual documents EUDC v1.30b, the Emacs Unified Directory Client.A common interface to directory servers using various protocols such asLDAP or the CCSO white pages directory system (PH/QI)@end ifinfo@menu* Overview:: Summary of EUDC features* Installation:: How to install EUDC* Usage:: The various usage possibilities explained* Credits:: Who's done what* Command and Function Index::* Variables Index:: @end menu@node Overview, Installation, Top, Top@comment node-name, next, previous, up@chapter OverviewEUDC, the @dfn{Emacs Unified Directory Client}, provides a common userinterface to access directory servers using different directoryprotocols. Currently supported back-ends are:@itemize @bullet@itemLDAP, Lightweight Directory Access Protocol@itemCCSO PH/QI@itemBBDB, Big Brother's Insiduous Database@end itemizeThe main features of the EUDC interface are:@itemize @bullet@item Queries using a customizable form@itemInline query expansion (for instance you can expand a nameto an email address in a mail message buffer using a server as anaddress book)@itemMultiple servers can be tried in turn until a match is found for aninline query@itemFast minibuffer queries for email addresses and phone numbers@itemInterface to BBDB to let you insert server records into your own BBDB database(@pxref{Top,,BBDB,bbdb,BBDB Manual})@end itemize@menu* LDAP:: What is LDAP ?* CCSO PH/QI:: What is CCSO, PH, QI ?* BBDB:: What is BBDB ?@end menu@node LDAP, CCSO PH/QI, Overview, Overview@comment node-name, next, previous, up@section LDAPLDAP, @dfn{the Lightweight Directory Access Protocol}, is a communicationprotocol for directory applications defined in RFC 1777.Quoted from RFC 1777:@quotation[LDAP] is designed to provide access to the X.500 Directory while notincurring the resource requirements of the Directory Access Protocol(DAP). This protocol is specifically targeted at simple managementapplications and browser applications that provide simple read/writeinteractive access to the X.500 Directory, and is intended to be acomplement to the DAP itself.@end quotationLDAP servers usually store (but are not limited to) information aboutpeople such as their name, phone number, email address, officelocation, etc@enddots{} More information about LDAP can be found at@url{http://www.openldap.org/}EUDC requires external support to access LDAP directory servers(@pxref{LDAP Requirements})@node CCSO PH/QI, BBDB, LDAP, Overview@comment node-name, next, previous, up@section CCSO PH/QIThe Central Computing Services Office (CCSO) of the University ofIllinois at Urbana Champaign (UIUC) created and freely distributes adirectory system that is currently in use in more than 300 organizationsaround the world. The system records information about people such astheir address, phone number, email, academic information or any otherdetails it was configured to.The system consists of two parts: a database server traditionally called@samp{qi} and a command-line client called @samp{ph}.@url{ftp://uiarchive.cso.uiuc.edu/pub/packages/ph} is the maindistribution site. @url{http://www.uiuc.edu/cgi-bin/ph/lookup?Query=.}provides a listing of the active @samp{qi} servers.The original command-line @samp{ph} client that comes with the@samp{ph/qi} distribution provides additional features like thepossibility to communicate with the server in login-mode which makes itpossible to change records in the database. This is not implemented inEUDC.@node BBDB, , CCSO PH/QI, Overview@comment node-name, next, previous, up@section BBDBBBDB is the @dfn{Big Brother's Insiduous Database}, a package for Emacsoriginally written by Jamie Zawinski which provides rolodex-likedatabase functionality featuring tight integration with the Emacs mailand news readers.It is often used as an enhanced email address book.EUDC considers BBDB as a directory server back end just like LDAP orPH/QI servers, though BBDB has no client/server protocol and thus alwaysresides locally on your machine. The point in this is not to offer analternate way to query your BBDB database (BBDB itself provides muchmore flexible ways to do that), but rather to offer an interface to yourlocal directory that is consistent with the interface to externaldirectories (LDAP, PH/QI). This is particularly interesting whenperforming queries on multiple servers.EUDC also offers a means to insert results from directory queries intoyour own local BBDB (@pxref{Creating BBDB Records})@node Installation, Usage, Overview, Top@comment node-name, next, previous, up@chapter InstallationAdd the following to your @file{.emacs} init file:@lisp(require 'eudc)@end lispThis will install EUDC at startup.After installing EUDC you will find (the next time you launch Emacs) anew @code{Directory Search} submenu in the @samp{Tools} menu that willgive you access to EUDC.You may also find it useful to add the following to your @file{.emacs}initialization file to add a shortcut for email address expansion inemail composition buffers (@pxref{Inline Query Expansion})@lisp(eval-after-load "message" '(define-key message-mode-map [(control ?c) (tab)] 'eudc-expand-inline))(eval-after-load "sendmail" '(define-key mail-mode-map [(control ?c) (tab)] 'eudc-expand-inline))@end lisp@menu* LDAP Requirements:: EUDC needs external support for LDAP@end menu@node LDAP Requirements, , Installation, Installation@comment node-name, next, previous, up@section LDAP RequirementsLDAP support is added by means of @file{ldap.el} which is part of Emacs.@file{ldap.el} needs an external command line utility named@file{ldapsearch} which is available as part of LDAP toolkits:@itemize @bullet@itemOpen LDAP Libraries(@url{http://www.openldap.org/})@itemUniversity of Michigan's LDAP Client software(@url{http://www.umich.edu/~dirsvcs/ldap/})@end itemize@node Usage, Credits, Installation, Top@comment node-name, next, previous, up@chapter UsageThis chapter describes the usage of EUDC. Most functions andcustomization options are available through the @samp{Directory Search}submenu of the @samp{Tools} submenu.@menu* Querying Servers:: How queries are performed and handled * Query Form:: How to use and customize the query form* Display of Query Results:: Controlling how query results are presented* Inline Query Expansion:: How to use and customize inline queries* The Server Hotlist:: How to use and manage the server hotlist* Multi-server Queries:: How to query multiple servers successively* Creating BBDB Records:: How to insert query results into your BBDB* Server/Protocol Locals:: Customizing on a per server/protocol basis@end menu@node Querying Servers, Query Form, Usage, Usage@comment node-name, next, previous, up@section Querying ServersEUDC's basic functionality is to let you query a directory server andreturn the results back to you. There are several things you may wantto customize in this process.@menu* Selecting a Server:: The first thing to do* Return Attributes:: Configuring what the server should return* Duplicate Attributes:: What to do when records have duplicate attributes@end menu@node Selecting a Server, Return Attributes, Querying Servers, Querying Servers@subsection Selecting a ServerBefore doing any query you will need to set the directory server. Youneed to specify the name of the host machine running the server softwareand the protocol to use. If you do not set the server in any fashion,EUDC will ask you for one when you make your first query.You can set the server by selecting one from your hotlist of servers(@pxref{The Server Hotlist}) available in the @samp{Server} submenu orby selecting @samp{New Server} in that same menu.LDAP servers generally require some configuration before you can performqueries on them. In particular, the @dfn{search base} must beconfigured. If the server you select has no configured search base thenEUDC will propose you to configure it at this point. A customizationbuffer will be displayed where you can edit the search base and otherparameters for the server.@defvar eudc-serverThe name or IP address of the remote directory server. A TCP port numbermay be specified by appending a colon and a number to the name of theserver. You will not need this unless your server runs on a port otherthan the default (which depends on the protocol).If the directory server resides on your own computer (which is the caseif you use the BBDB back end) then `localhost' is a reasonable value butit will be ignored anyway.@end defvar@defvar eudc-protocolThe directory protocol to use to query the server. Currently supportedprotocols in this version of EUDC are @code{ph}, @code{ldap} and @code{bbdb}.@end defvar@deffn Command eudc-set-serverThis command accessible from @samp{New Server} submenu lets you specify anew directory server and protocol.@end deffn@node Return Attributes, Duplicate Attributes, Selecting a Server, Querying Servers@subsection Return AttributesDirectory servers may be configured to return a default set ofattributes for each record matching a query if the query specifies none.The variable @code{eudc-default-return-attributes} controls the returnattributes you want to see, if different from the server defaults.@defvar eudc-default-return-attributesA list of the default attributes to extract from directory entries. Ifset to the symbol @code{all} then all available attributes arereturned. A value of @code{nil}, the default, means to return thedefault attributes as configured in the server.@end defvarThe server may return several matching records to a query. Some of therecords may however not contain all the attributes you requested. You candiscard those records.@defopt eudc-strict-return-matchesIf non-@code{nil}, entries that do not contain all the requested returnattributes are ignored. Default is @code{t}.@end defopt@node Duplicate Attributes, , Return Attributes, Querying Servers@subsection Duplicate AttributesDirectory standards may authorize different instances of the sameattribute in a record. For instance the record of a person may containseveral email fields containing different email addresses. When usinga QI directory server this is difficult to distinguish from attributeshaving multi-line values such as the postal address that may contain aline for the street and another one for the zip code and city name. Inboth cases, EUDC will consider the attribute duplicated.EUDC has several methods to deal with duplicated attributes. Theavailable methods are:@table @code@item listMakes a list with the different values of the duplicate attribute. Therecord is returned with only one instance of the attribute with a listof all the different values as a value. This is the default method thatis used to handle duplicate fields for which no other method has beenspecified.@item firstDiscards all the duplicate values of the field keeping only the firstone.@item concatConcatenates the different values using a newline as a separator. Therecord keeps only one instance of the field the value of which is asingle multi-line string.@item duplicateDuplicates the whole record into as many instances as there are differentvalues for the field. This is the default for the email field. Thus arecord containing 3 different email addresses is duplicated into threedifferent records each having a single email address. This isparticularly useful in combination with @code{select} as the method tohandle multiple matches in inline expansion queries (@pxref{Inline QueryExpansion}) because you are presented with the 3 addresses in aselection buffer@end tableBecause a method may not be applicable to all fields, the variable@code{eudc-duplicate-attribute-handling-method} lets you specify either adefault method for all fields or a method for each individual field.@defvar eudc-duplicate-attribute-handling-methodA method to handle entries containing duplicate attributes. This iseither an alist of elements @code{(@var{attr} . @var{method})}, or a symbol@var{method}. The alist form of the variable associates a method to anindividual attribute name; the second form specifies a method applicableto all attribute names. Available methods are: @code{list},@code{first}, @code{concat}, and @code{duplicate} (see above). The default is@code{list}.@end defvar@node Query Form, Display of Query Results, Querying Servers, Usage@comment node-name, next, previous, up@section Query FormThe simplest way to query your directory server is to use the queryform. You display the query form with the @samp{Query with Form} menuitem or by invoking the command @kbd{M-x eudc-query-form}. The attributenames presented in this form are defined by the@code{eudc-query-form-attributes} variable (unless a non-@code{nil}argument is supplied to @code{eudc-query-form}).Since the different directory protocols to which EUDC interfaces mayuse different names for equivalent attributes, EUDC defines its own setof attribute names and a mapping between these names and theirprotocol-specific equivalent through the variable@code{eudc-protocol-attributes-translation-alist}. Names currentlydefined by EUDC are @code{name}, @code{firstname}, @code{email} and@code{phone}.@defvar eudc-query-form-attributes@findex eudc-get-attribute-listA list of attributes presented in the query form. Attribute names inthis list should be either EUDC attribute names or valid attributenames. You can get a list of valid attribute names for the currentprotocol with the @samp{List Valid Attribute Names} menu item or the@kbd{M-x eudc-get-attribute-list} command. Defaults to @code{name},@code{email} and @code{phone}.@end defvar@deffn Command eudc-query-form get-fields-from-serverDisplay a form to query the directory server. If given a non-@code{nil}argument the function first queries the server for the existing fieldsand displays a corresponding form. Not all protocols may support anon-@code{nil} argument here.@end deffnSince the names of the fields may not be explicit enough or adapted tobe directly displayed as prompt strings in the form, the variable@code{eudc-user-attribute-names-alist} lets you define more explicitnames for directory attribute names. This variable is ignored if@code{eudc-use-raw-directory-names} is non-@code{nil}.@defvar eudc-user-attribute-names-alistThis is an alist of user-defined names for the directory attributes used inquery/response forms. Prompt strings for attributes that are not in thisalist are derived by splitting the attribute name at underscores andcapitalizing the individual words.@end defvar@defvar eudc-use-raw-directory-namesIf non-@code{nil}, use attributes names as defined in the directory.Otherwise, directory query/response forms display the user attributenames defined in @code{eudc-user-attribute-names-alist}.@end defvar@node Display of Query Results, Inline Query Expansion, Query Form, Usage@comment node-name, next, previous, up@section Display of Query ResultsUpon successful completion of a form query, EUDC will display a buffercontaining the results of the query.The fields that are returned for each recordare controlled by @code{eudc-default-return-attributes} (@pxref{ReturnAttributes}). The display of each individual field can be performed by an arbitraryfunction which allows specific processing for binary values, such asimages or audio samples, as well as values with semantics, such asURLs.@defvar eudc-attribute-display-method-alistAn alist specifying methods to display attribute values. Each member ofthe list is of the form @code{(@var{name} . @var{func})} where@var{name} is a lowercased string naming a directory attribute(translated according to @code{eudc-user-attribute-names-alist} if@code{eudc-use-raw-directory-names} is non-nil) and @var{func} afunction that will be passed the corresponding attribute values fordisplay.@end defvarThis variable has protocol-local definitions (see @pxref{Server/ProtocolLocals}). For instance, it is defined as follows for LDAP:@lisp(eudc-protocol-set 'eudc-attribute-display-method-alist '(("jpegphoto" . eudc-display-jpeg-inline) ("labeledurl" . eudc-display-url) ("audio" . eudc-display-sound) ("labeledurl" . eudc-display-url) ("url" . eudc-display-url)) 'ldap)@end lispEUDC provides a set of built-in functions to display binary value types:@defun eudc-display-generic-binary dataDisplay a button for unidentified binary @var{data}.@end defun@defun eudc-display-url urlDisplay URL and make it clickable.@end defun@defun eudc-display-sound dataDisplay a button to play the sound @var{data}.@end defun@defun eudc-display-jpeg-inline dataDisplay the JPEG @var{data} inline at point if possible.@end defun@defun eudc-display-jpeg-as-button dataDisplay a button for the JPEG @var{data}.@end defunRight-clicking on a binary value button pops up a contextual menu withoptions to process the value. Among these are saving the attributevalue to a file or sending it to an external viewer command. Externalviewers should expect the value on their standard input and shoulddisplay it or perform arbitrary processing on it. Messages sent tostandard output are discarded. External viewers are listed in thevariable @code{eudc-external-viewers} which you can customize.@defvar eudc-external-viewersThis is a list of viewer program specifications. Each specification isa list whose first element is a string naming the viewer for uniqueidentification, the second element is the executable program whichshould be invoked and the following elements are arguments that shouldbe passed to the program.@end defvar@node Inline Query Expansion, The Server Hotlist, Display of Query Results, Usage@comment node-name, next, previous, up@section Inline Query ExpansionInline query expansion is a powerful method to get completion from yourdirectory server. The most common usage is for expanding names to emailaddresses in mail message buffers. The expansion is performed by thecommand @kbd{M-x eudc-expand-inline} which is available from the@samp{Expand Inline Query} menu item but can also be convenientlybound to a key shortcut (@pxref{Installation}). The operation iscontrolled by the variables @code{eudc-inline-expansion-format},@code{eudc-inline-query-format},@code{eudc-expanding-overwrites-query} and@code{eudc-multiple-match-handling-method}.If the query fails for a server, other servers may be tried successively until one of them finds a match (@pxref{Multi-server Queries}).@deffn Command eudc-expand-inline replace-pQuery the server and expand the query string before point. The querystring consists of the buffer substring from the point back to thepreceding comma, colon or beginning ofline. @code{eudc-inline-query-format} controls how individual wordsare mapped onto directory attribute names. After querying the serverfor the given string, the expansion specified by@code{eudc-inline-expansion-format} is inserted in the buffer atpoint. If @var{replace-p} is @code{t} then this expansion replaces thequery string in the buffer. If @code{eudc-expanding-overwrites-query}is non-@code{nil} then the meaning of @var{replace-p} is negated.@end deffn@defvar eudc-inline-query-formatFormat of an inline expansion query. This is actually a list of @var{format}s. A @var{format} is a list ofone or more EUDC attribute names. A @var{format} applies if it containsas many attributes as individual words in the inline query string. Ifseveral @var{format}s apply then they are tried in order until a matchis found. If @code{nil} all the words will be mapped onto the defaultserver/protocol attribute name (generally @code{name}).For instance, use the following @lisp(setq eudc-inline-query-format '((name) (firstname) (firstname name)))@end lisp@noindentto indicate that single word expansion queries are to be considered assurnames and if no match is found then they should be tried as firstnames. Inline queries consisting of two words are considered asconsisting of a first name followed by a surname. If the query consists of more than two words, then the first one is considered as the firstname and the remaining words are all considered as surname constituents.@var{format}s are in fact not limited to EUDC attribute names, you canuse server or protocol specific names in them. It may be safer if youdo so, to set the variable @code{eudc-inline-query-format} in a protocolor server local fashion (see @pxref{Server/Protocol Locals}).For instance you could use the following to match up to three wordsagainst the @code{cn} attribute of LDAP servers:@lisp(eudc-protocol-set 'eudc-inline-query-format '((cn) (cn cn) (cn cn cn)) 'ldap)@end lisp@end defvar@defvar eudc-inline-expansion-formatThis variable lets you control exactly what is inserted into the bufferupon an inline expansion request. It is a list whose first element is astring passed to @code{format}. Remaining elements are symbolscorresponding to directory attribute names. The corresponding attributevalues are passed as additional arguments to @code{format}. Default is@code{("%s" email)} but you may want to consider a value like @code{("%s<%s>" name email)}@end defvar@defvar eudc-multiple-match-handling-methodThis variable controls what to do when multiple entries match a queryfor an inline expansion. Possible values are:@table @code@item firstThe first match is considered as being the only one, the others arediscarded.@item selectA selection buffer pops up where you can choose a particular match. This is the default value of the variable.@item allThe expansion uses all records successively@item abortAn error is signaled. The expansion aborts.@end tableDefault is @code{select}@end defvar@node The Server Hotlist, Multi-server Queries, Inline Query Expansion, Usage@comment node-name, next, previous, up@section The Server HotlistEUDC lets you maintain a list of frequently used servers so that you can easily switch from one to another. This hotlist appears in the@samp{Server} submenu. You select a server in this list by clicking onits name. You can add the current server to the list with the command@kbd{M-x eudc-bookmark-current-server}. The list is contained in the variable@code{eudc-server-hotlist} which is stored in and retrieved from the filedesignated by @code{eudc-options-file}. EUDC also provides a facility toedit the hotlist interactively (@pxref{The Hotlist Edit Buffer}).The hotlist is also used to make queries on multiple serverssuccessively (@pxref{Multi-server Queries}). The order in which theservers are tried is the order they appear in the hotlist, therefore itis important to sort the hotlist appropriately.@deffn Command eudc-bookmark-server serverAdd @var{server} to the hotlist of servers@end deffn@deffn Command eudc-bookmark-current-serverAdd the current server to the hotlist of servers@end deffn@defvar eudc-options-fileThe name of a file where EUDC stores its internal variables(the hotlist and the current server). EUDC will try to load that file upon initialization so, if you choose a file namedifferent from the defaults @file{~/.eudc-options}, be sure to set thisvariable to the appropriate value @emph{before} EUDC is itselfloaded.@end defvar@menu* The Hotlist Edit Buffer:: An interactive hotlist editing facility@end menu@node The Hotlist Edit Buffer, , The Server Hotlist, The Server Hotlist@comment node-name, next, previous, up@subsection The Hotlist Edit BufferThe hotlist edit buffer offers a means to manage a list of frequentlyused servers. Commands are available in the context pop-up menugenerally bound to the right mouse button. Those commands also haveequivalent key bindings.@deffn Command eudc-hotlist-add-serverBound to @kbd{a}.Add a new server to the hotlist on the line after point@end deffn@deffn Command eudc-hotlist-delete-serverBound to @kbd{d}.Delete the server on the line point is on@end deffn@deffn Command eudc-hotlist-select-serverBound to @kbd{s}.Select the server the point is on as the current directory server forthe next queries@end deffn@deffn Command eudc-hotlist-transpose-serversBound to @kbd{t}.Bubble up the server the point is on to the top of the list@end deffn@deffn Command eudc-hotlist-quit-editBound to @kbd{q}.Save the changes and quit the hotlist edit buffer. Use @kbd{x} or@kbd{M-x kill-buffer} to exit without saving.@end deffn@node Multi-server Queries, Creating BBDB Records, The Server Hotlist, Usage@comment node-name, next, previous, up@section Multi-server QueriesWhen using inline query expansion (@pxref{Inline Query Expansion}), EUDCcan try to query successively a sequence of directory servers until oneof them successfully finds a match for the query.@defvar eudc-inline-expansion-serversThis variable controls which servers are tried and in which order whentrying to perform an inline query. Possible values are:@table @code@item current-serverOnly the current directory server is tried@item hotlistThe servers in the hotlist are tried in order until one finds a matchfor the query or `eudc-max-servers-to-query' is reached@item server-then-hotlistThe current server then the servers in the hotlist are tried in theorder they appear in the hotlist until one of them finds a match or`eudc-max-servers-to-query' is reached. This is the default.@end table@end defvar@defvar eudc-max-servers-to-queryThis variable indicates the maximum number of servers to query whenperforming a multi-server query. The default, @code{nil}, indicatesthat all available servers should be tried.@end defvar@node Creating BBDB Records, Server/Protocol Locals, Multi-server Queries, Usage@comment node-name, next, previous, up@section Creating BBDB Records@findex eudc-insert-record-at-point-into-bbdb@findex eudc-try-bbdb-insertWith EUDC, you can automatically create BBDB records(@pxref{Top,,BBDB,bbdb,BBDB Manual}) from records you get from adirectory server. You do this by moving point to the appropriaterecord in a query result display buffer and invoking the command@kbd{M-x eudc-insert-record-at-point-into-bbdb} with thekeyboard binding @kbd{b}@footnote{This key binding does not actuallycall @code{eudc-insert-record-at-point-into-bbdb} but uses@code{eudc-try-bbdb-insert} instead.}, or with the menu. EUDCcannot update an existing BBDB record and will signal an error if youtry to insert a record matching an existing one.@findex eudc-batch-export-records-to-bbdbIt is also possible to export to BBDB the whole batch of recordscontained in the directory query result with the command@kbd{M-x eudc-batch-export-records-to-bbdb}.Because directory systems may not enforce a strict record format, localserver installations may use different attribute names and havedifferent ways to organize the information. Furthermore BBDB has its ownrecord structure. For these reasons converting a record from itsexternal directory format to the BBDB format is a highly customizableprocess.@defvar eudc-bbdb-conversion-alistThe value of this variable should be a symbol naming an alist defining amapping between BBDB field names onto directory attribute names records.This is a protocol-local variable and is initialized upon protocolswitch (@pxref{Server/Protocol Locals}). The alist is made of cells of theform @code{(@var{bbdb-field} . @var{spec-or-list})}. @var{bbdb-field} is the name of a fieldthat must be defined in your BBDB environment (standard field names are@code{name}, @code{company}, @code{net}, @code{phone}, @code{address}and @code{notes}). @var{spec-or-list} is either a single mapping specification or a list ofmapping specifications. Lists of mapping specifications are valid forthe @code{phone} and @code{address} BBDB fields only. @var{spec}s areactually s-expressions which are evaluated as follows:@table @asis@item a string evaluates to itself@item a symbolevaluates to the symbol value. Symbols corresponding to directoryattribute names present in the record evaluate to the value of the fieldin the record@item a formis evaluated as a function. The argument list may contain attribute names which evaluate to the corresponding values in the record. The formevaluation should return something appropriate for the particular@var{bbdb-field} (see @code{bbdb-create-internal}).@code{eudc-bbdbify-phone} and @code{eudc-bbdbify-address} are provided asconvenience functions to parse phones and addresses.@end table@end defvarThe default value of the PH-specific value of that variable is@code{eudc-ph-bbdb-conversion-alist}:@lisp((name . name) (net . email) (address . (eudc-bbdbify-address address "Address")) (phone . ((eudc-bbdbify-phone phone "Phone") (eudc-bbdbify-phone office_phone "Office Phone"))))@end lispThis means that:@itemize @bullet@item the @code{name} field of the BBDB record gets its valuefrom the @code{name} attribute of the directory record@itemthe @code{net} field of the BBDB record gets its valuefrom the @code{email} attribute of the directory record@itemthe @code{address} field of the BBDB record is obtained by parsing the@code{address} attribute of the directory record with the function@code{eudc-bbdbify-address}@itemtwo @code{phone} fields are created (when possible) in the BBDB record.The first one has @cite{Phone} for location and its value is obtained byparsing the @code{phone} attribute of the PH/QI record with the function@code{eudc-bbdbify-phone}. The second one has @cite{Office Phone} for locationits value is obtained by parsing the @code{office_phone} attribute of thePH/QI record with the function @code{eudc-bbdbify-phone}.@end itemize@defun eudc-bbdbify-phone phone locationThis is a convenience function provided for use in@code{eudc-bbdb-conversion-alist}. It parses @var{phone} into a vectorcompatible with @code{bbdb-create-internal}. @var{phone} is either a stringsupposedly containing a phone number or a list of such strings which areconcatenated. @var{location} is used as the phone location for BBDB.@end defun@defun eudc-bbdbify-address addr locationThis is a convenience function provided for use in@code{eudc-bbdb-conversion-alist}. It parses @var{addr} into a vectorcompatible with @code{bbdb-create-internal}. @var{addr} should be anaddress string of no more than four lines or a list of lines. The lastline is searched for the zip code, city and state name. @var{location}is used as the phone location for BBDB.@end defunNote that only a subset of the attributes you selected with@code{eudc-default-return-attributes} and that are actually displayed mayactually be inserted as part of the newly created BBDB record.@node Server/Protocol Locals, , Creating BBDB Records, Usage@comment node-name, next, previous, up@section Server/Protocol LocalsEUDC can be customized independently for each server or directoryprotocol. All variables can be given local bindings that are activatedwhen a particular server and/or protocol becomes active. This is muchlike buffer-local bindings but on a per server or per protocol basis.@menu* Manipulating local bindings:: Functions to set and query local bindings@end menu@node Manipulating local bindings, , Server/Protocol Locals, Server/Protocol Locals@comment node-name, next, previous, up@subsection Manipulating local bindingsEUDC offers functions that let you set and query variables on a perserver or per protocol basis.The following predicates allow you to test the existence ofserver/protocol local bindings for a particular variable.@defun eudc-server-local-variable-p varReturn non-@code{nil} if @var{var} has server-local bindings@end defun@defun eudc-protocol-local-variable-p varReturn non-@code{nil} if @var{var} has protocol-local bindings@end defunThe following functions allow you to set the value of a variable withvarious degrees of locality.@defun eudc-default-set var valSet the EUDC default value of @var{var} to @var{val}.The current binding of @var{var} (if local to the current server orprotocol) is not changed.@end defun@defun eudc-protocol-set var val &optional protocolSet the binding of @var{var} local to @var{protocol} to @var{val}. Ifomitted, @var{protocol} defaults to the current value of@code{eudc-protocol}. The current binding of @var{var} is changed onlyif @var{protocol} is omitted.@end defun@defun eudc-server-set var val &optional serverSet the binding of @var{var} local to @var{server} to @var{val}. Ifomitted, @var{server} defaults to the current value of@code{eudc-server}. The current binding of @var{var} is changed only if@var{server} is omitted.@end defun@defun eudc-set var valSet the most local (server, protocol or default) binding of @var{var} to@var{val}. The current binding of @var{var} is also set to @var{val}.@end defunThe following variables allow you to query the various bindings of avariable (local or non-local).@defun eudc-variable-default-value varReturn the default binding of @var{var} (outside of a particular serveror protocol local binding).Return @code{unbound} if @var{var} has no EUDC default value.@end defun@defun eudc-variable-protocol-value var &optional protocolReturn the value of @var{var} local to @var{protocol}. Return@code{unbound} if @var{var} has no value local to @var{protocol}.@var{protocol} defaults to @code{eudc-protocol}.@end defun@defun eudc-variable-server-value var [server]Return the value of @var{var} local to @var{server}. Return @code{unbound} if @var{var} has no value local to @var{server}.@var{server} defaults to @code{eudc-server}.@end defunChanging a protocol-local or server-local value of a variable has noeffect on its current value. The following command is used tosynchronize the current values of variables with their local valuesgiven the current @code{eudc-server} and @code{eudc-protocol}:@defun eudc-update-local-variablesUpdate all EUDC variables according to their local settings.@end defun@node Credits, Command and Function Index, Usage, Top@comment node-name, next, previous, up@chapter CreditsEUDC was written by Oscar Figueiredo based on @file{ph.el} by the same author.Thanks to Soren Dayton for his suggestions, his enthusiasm and his helpin testing and proofreading the code and docs of @file{ph.el}.@node Command and Function Index, Variables Index, Credits, Top@comment node-name, next, previous, up@unnumbered Command and Function Index@printindex fn@node Variables Index, , Command and Function Index, Top@comment node-name, next, previous, up@unnumbered Variables Index@printindex vr@setchapternewpage odd@contents@bye