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