Mercurial > emacs
annotate lisp/net/eudc-vars.el @ 53109:420dc7ac8867
(File Attributes): Describe new parameter ID-FORMAT.
author | Lars Hansen <larsh@soem.dk> |
---|---|
date | Fri, 21 Nov 2003 18:25:20 +0000 |
parents | 695cf19ef79e |
children | 18a818a2ee7c 375f2633d815 |
rev | line source |
---|---|
27313 | 1 ;;; eudc-vars.el --- Emacs Unified Directory Client |
2 | |
42552
27d9f14cc4af
(eudc-external-viewers): Do not use xv, it is not free.
Pavel Janík <Pavel@Janik.cz>
parents:
38422
diff
changeset
|
3 ;; Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc. |
27313 | 4 |
42778
6d743d659035
New maintainer. Change author's address.
Pavel Janík <Pavel@Janik.cz>
parents:
42574
diff
changeset
|
5 ;; Author: Oscar Figueiredo <oscar@cpe.fr> |
6d743d659035
New maintainer. Change author's address.
Pavel Janík <Pavel@Janik.cz>
parents:
42574
diff
changeset
|
6 ;; Maintainer: Pavel Janík <Pavel@Janik.cz> |
42574 | 7 ;; Keywords: comm |
27313 | 8 |
9 ;; This file is part of GNU Emacs. | |
10 | |
11 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
12 ;; it under the terms of the GNU General Public License as published by | |
13 ;; the Free Software Foundation; either version 2, or (at your option) | |
14 ;; any later version. | |
15 | |
16 ;; GNU Emacs is distributed in the hope that it will be useful, | |
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 ;; GNU General Public License for more details. | |
20 | |
21 ;; You should have received a copy of the GNU General Public License | |
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
24 ;; Boston, MA 02111-1307, USA. | |
25 | |
38422
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
35355
diff
changeset
|
26 ;;; Commentary: |
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
35355
diff
changeset
|
27 |
27313 | 28 ;;; Code: |
29 | |
30 (require 'custom) | |
31 | |
32 ;;{{{ EUDC Main Custom Group | |
33 | |
32229 | 34 (defgroup eudc nil |
27313 | 35 "Emacs Unified Directory Client." |
32229 | 36 :version "21.1" |
37 :link '(info-link "(eudc)") | |
27313 | 38 :group 'mail |
39 :group 'comm) | |
40 | |
41 (defcustom eudc-server nil | |
42 "*The name or IP address of the directory server. | |
43 A port number may be specified by appending a colon and a | |
44 number to the name of the server. Use `localhost' if the directory | |
45 server resides on your computer (BBDB backend)." | |
35355
581e16bc15c7
(eudc-server, eudc-protocol): Fix :type.
Dave Love <fx@gnu.org>
parents:
32229
diff
changeset
|
46 :type '(choice (string :tag "Server") (const :tag "None" nil)) |
27313 | 47 :group 'eudc) |
48 | |
49 ;; Known protocols (used in completion) | |
50 ;; Not to be mistaken with `eudc-supported-protocols' | |
51 (defvar eudc-known-protocols '(bbdb ph ldap)) | |
52 | |
53 (defvar eudc-supported-protocols nil | |
54 "Protocols currently supported by EUDC. | |
55 This variable is updated when protocol-specific libraries | |
56 are loaded, *do not change manually*.") | |
57 | |
58 (defcustom eudc-protocol nil | |
59 "*The directory protocol to use to query the server. | |
60 Supported protocols are specified by `eudc-supported-protocols'." | |
61 :type `(choice :menu-tag "Protocol" | |
32229 | 62 ,@(mapcar (lambda (s) |
27313 | 63 (list 'const ':tag (symbol-name s) s)) |
35355
581e16bc15c7
(eudc-server, eudc-protocol): Fix :type.
Dave Love <fx@gnu.org>
parents:
32229
diff
changeset
|
64 eudc-known-protocols) |
581e16bc15c7
(eudc-server, eudc-protocol): Fix :type.
Dave Love <fx@gnu.org>
parents:
32229
diff
changeset
|
65 (const :tag "None" nil)) |
27313 | 66 :group 'eudc) |
67 | |
68 | |
69 (defcustom eudc-strict-return-matches t | |
70 "*Ignore or allow entries not containing all requested return attributes. | |
71 If non-nil, such entries are ignored." | |
72 :type 'boolean | |
73 :group 'eudc) | |
74 | |
75 (defcustom eudc-default-return-attributes nil | |
76 "*A list of default attributes to extract from directory entries. | |
77 If set to the symbol `all', return all attributes. | |
78 A value of nil means return the default attributes as configured in the | |
79 server." | |
80 :type '(choice :menu-tag "Return Attributes" | |
81 (const :menu-tag "Server defaults (nil)" nil) | |
82 (const :menu-tag "All" all) | |
32229 | 83 (repeat :menu-tag "Attribute list" |
27313 | 84 :tag "Attribute name" |
85 :value (nil) | |
86 (symbol :tag "Attribute name"))) | |
87 :group 'eudc) | |
88 | |
89 (defcustom eudc-multiple-match-handling-method 'select | |
90 "*What to do when multiple entries match an inline expansion query. | |
32229 | 91 Possible values are: |
27313 | 92 `first' (equivalent to nil) which means keep the first match only, |
93 `select' pop-up a selection buffer, | |
94 `all' expand to all matches, | |
95 `abort' the operation is aborted, an error is signaled." | |
96 :type '(choice :menu-tag "Method" | |
32229 | 97 (const :menu-tag "Use First" |
27313 | 98 :tag "Use First" first) |
32229 | 99 (const :menu-tag "Select Interactively" |
27313 | 100 :tag "Select Interactively" select) |
32229 | 101 (const :menu-tag "Use All" |
27313 | 102 :tag "Use All" all) |
32229 | 103 (const :menu-tag "Abort Operation" |
27313 | 104 :tag "Abort Operation" abort) |
32229 | 105 (const :menu-tag "Default (Use First)" |
27313 | 106 :tag "Default (Use First)" nil)) |
107 :group 'eudc) | |
108 | |
109 (defcustom eudc-duplicate-attribute-handling-method '((email . duplicate)) | |
110 "*A method to handle entries containing duplicate attributes. | |
111 This is either an alist (ATTR . METHOD) or a symbol METHOD. | |
112 The alist form of the variable associates a method to an individual attribute, | |
113 the second form specifies a method applicable to all attributes. | |
114 Available methods are: | |
115 `list' or nil lets the value of the attribute be a list of values, | |
116 `first' keeps the first value and discards the others, | |
117 `concat' concatenates the values into a single multiline string, | |
32229 | 118 `duplicate' duplicates the entire entry into as many instances as |
27313 | 119 different values." |
120 :type '(choice (const :menu-tag "List" list) | |
121 (const :menu-tag "First" first) | |
122 (const :menu-tag "Concat" concat) | |
123 (const :menu-tag "Duplicate" duplicate) | |
124 (repeat :menu-tag "Per Attribute Specification" | |
125 :tag "Per Attribute Specification" | |
126 (cons :tag "Attribute/Method" | |
127 :value (nil . list) | |
128 (symbol :tag "Attribute name") | |
129 (choice :tag "Method" | |
130 :menu-tag "Method" | |
131 (const :menu-tag "List" list) | |
132 (const :menu-tag "First" first) | |
133 (const :menu-tag "Concat" concat) | |
134 (const :menu-tag "Duplicate" duplicate))))) | |
135 :group 'eudc) | |
136 | |
32229 | 137 (defcustom eudc-inline-query-format '((name) |
27313 | 138 (firstname name)) |
139 "*Format of an inline expansion query. | |
32229 | 140 This is a list of FORMATs. A FORMAT is itself a list of one or more |
27313 | 141 EUDC attribute names. A FORMAT applies if it contains as many attributes as |
142 there are individual words in the inline query string. | |
32229 | 143 If several FORMATs apply then they are tried in order until a match |
144 is found. | |
145 If nil, all the words are mapped onto the default server or protocol | |
27313 | 146 attribute name. |
147 | |
148 The attribute names in FORMATs are not restricted to EUDC attribute names | |
149 but can also be protocol/server specific names. In this case, this variable | |
150 must be set in a protocol/server-local fashion, see `eudc-server-set' and | |
151 `eudc-protocol-set'." | |
152 :tag "Format of Inline Expansion Queries" | |
153 :type '(repeat | |
154 (repeat | |
155 :menu-tag "Format" | |
156 :tag "Format" | |
157 (choice | |
158 :tag "Attribute" | |
159 (const :menu-tag "First Name" :tag "First Name" firstname) | |
160 (const :menu-tag "Surname" :tag "Surname" name) | |
161 (const :menu-tag "Email Address" :tag "Email Address" email) | |
162 (const :menu-tag "Phone" :tag "Phone" phone) | |
163 (symbol :menu-tag "Other" :tag "Attribute name")))) | |
164 :group 'eudc) | |
165 | |
166 (defcustom eudc-expansion-overwrites-query t | |
167 "*If non nil, expanding a query overwrites the query string." | |
168 :type 'boolean | |
169 :group 'eudc) | |
170 | |
171 (defcustom eudc-inline-expansion-format '("%s" email) | |
172 "*A list specifying the format of the expansion of inline queries. | |
173 This variable controls what `eudc-expand-inline' actually inserts in | |
174 the buffer. First element is a string passed to `format'. Remaining | |
175 elements are symbols indicating attribute names; the corresponding values | |
176 are passed as additional arguments to `format'." | |
32229 | 177 :type '(list |
27313 | 178 (string :tag "Format String") |
179 (repeat :inline t | |
180 :tag "Attributes" | |
32229 | 181 (choice |
27313 | 182 :tag "Attribute" |
183 (const :menu-tag "First Name" :tag "First Name" firstname) | |
184 (const :menu-tag "Surname" :tag "Surname" name) | |
185 (const :menu-tag "Email Address" :tag "Email Address" email) | |
186 (const :menu-tag "Phone" :tag "Phone" phone) | |
187 (symbol :menu-tag "Other") | |
188 (symbol :tag "Attribute name")))) | |
189 :group 'eudc) | |
190 | |
191 (defcustom eudc-inline-expansion-servers 'server-then-hotlist | |
192 "*Which servers to contact for the expansion of inline queries. | |
193 Possible values are: | |
194 `current-server': the EUDC current server. | |
195 `hotlist': the servers of the hotlist in the order they appear, | |
32229 | 196 `server-then-hotlist': the current server and then the servers of |
27313 | 197 the hotlist." |
198 :type '(choice :tag "Servers" | |
199 :menu-tag "Servers" | |
200 (const :menu-tag "Current server" current-server) | |
201 (const :menu-tag "Servers in the hotlist" hotlist) | |
202 (const :menu-tag "Current server then hotlist" server-then-hotlist)) | |
203 :group 'eudc) | |
204 | |
205 (defcustom eudc-max-servers-to-query nil | |
206 "*Maximum number of servers to query for an inline expansion. | |
207 If nil, query all servers available from `eudc-inline-expansion-servers'." | |
208 :tag "Max Number of Servers to Query" | |
209 :type '(choice :tag "Max. Servers" | |
210 :menu-tag "Max. Servers" | |
211 (const :menu-tag "No limit" nil) | |
212 (const :menu-tag "1" 1) | |
213 (const :menu-tag "2" 2) | |
214 (const :menu-tag "3" 3) | |
215 (const :menu-tag "4" 4) | |
216 (const :menu-tag "5" 5) | |
217 (integer :menu-tag "Set")) | |
218 :group 'eudc) | |
219 | |
220 (defcustom eudc-query-form-attributes '(name firstname email phone) | |
221 "*A list of attributes presented in the query form." | |
222 :tag "Attributes in Query Forms" | |
32229 | 223 :type '(repeat |
27313 | 224 (choice |
225 :tag "Attribute" | |
226 (const :menu-tag "First Name" :tag "First Name" firstname) | |
227 (const :menu-tag "Surname" :tag "Surname" name) | |
228 (const :menu-tag "Email Address" :tag "Email Address" email) | |
229 (const :menu-tag "Phone" :tag "Phone" phone) | |
230 (symbol :menu-tag "Other" :tag "Attribute name"))) | |
231 :group 'eudc) | |
232 | |
233 (defcustom eudc-user-attribute-names-alist '((url . "URL") | |
234 (callsign . "HAM Call Sign") | |
235 (id . "ID") | |
236 (email . "E-Mail") | |
237 (firstname . "First Name") | |
238 (cn . "Full Name") | |
239 (sn . "Surname") | |
240 (givenname . "First Name") | |
241 (ou . "Unit") | |
242 (labeledurl . "URL") | |
243 (postaladdress . "Address") | |
244 (postalcode . "Postal Code") | |
245 (l . "Location") | |
246 (c . "Country") | |
247 (o . "Organization") | |
248 (roomnumber . "Office") | |
249 (telephonenumber . "Phone") | |
250 (uniqueidentifier . "ID") | |
251 (objectclass . "Object Class")) | |
252 "*Alist of user-defined names for directory attributes. | |
32229 | 253 These names are used as prompt strings in query/response forms |
27313 | 254 instead of the raw directory attribute names. |
255 Prompt strings for attributes that are not listed here | |
256 are derived by splitting the attribute name | |
257 at `_' characters and capitalizing the individual words." | |
258 :tag "User-defined Names of Directory Attributes" | |
259 :type '(repeat (cons :tag "Field" | |
260 (symbol :tag "Directory attribute") | |
261 (string :tag "User friendly name "))) | |
262 :group 'eudc) | |
263 | |
264 (defcustom eudc-use-raw-directory-names nil | |
265 "*If non-nil, use attributes names as defined in the directory. | |
266 Otherwise, directory query/response forms display the user attribute | |
267 names defined in `eudc-user-attribute-names-alist'." | |
268 :type 'boolean | |
269 :group 'eudc) | |
270 | |
271 (defcustom eudc-attribute-display-method-alist nil | |
272 "*An alist specifying methods to display attribute values. | |
273 Each member of the list is of the form (NAME . FUNC) where NAME is a lowercased | |
32229 | 274 string naming a directory attribute (translated according to |
275 `eudc-user-attribute-names-alist' if `eudc-use-raw-directory-names' is | |
276 non-nil) and FUNC a function that will be passed the corresponding | |
27313 | 277 attribute values for display." |
278 :tag "Attribute Decoding Functions" | |
279 :type '(repeat (cons :tag "Attribute" | |
280 (symbol :tag "Name") | |
281 (symbol :tag "Display Function"))) | |
282 :group 'eudc) | |
283 | |
42552
27d9f14cc4af
(eudc-external-viewers): Do not use xv, it is not free.
Pavel Janík <Pavel@Janik.cz>
parents:
38422
diff
changeset
|
284 (defcustom eudc-external-viewers '(("ImageMagick" "display" "-") |
27313 | 285 ("ShowAudio" "showaudio")) |
286 "*A list of viewer program specifications. | |
287 Viewers are programs which can be piped a directory attribute value for | |
32229 | 288 display or arbitrary processing. Each specification is a list whose |
289 first element is a string naming the viewer. The second element is the | |
27313 | 290 executable program which should be invoked, and following elements are |
291 arguments that should be passed to the program." | |
292 :tag "External Viewer Programs" | |
293 :type '(repeat (list :tag "Viewer" | |
294 (string :tag "Name") | |
295 (string :tag "Executable program") | |
296 (repeat | |
297 :tag "Arguments" | |
298 :inline t | |
299 (string :tag "Argument")))) | |
300 :group 'eudc) | |
301 | |
302 (defcustom eudc-options-file "~/.eudc-options" | |
303 "*A file where the `servers' hotlist is stored." | |
304 :type '(file :Tag "File Name:") | |
305 :group 'eudc) | |
306 | |
307 (defcustom eudc-mode-hook nil | |
308 "*Normal hook run on entry to EUDC mode." | |
309 :type '(repeat (sexp :tag "Hook definition")) | |
310 :group 'eudc) | |
311 | |
312 ;;}}} | |
313 | |
314 ;;{{{ PH Custom Group | |
315 | |
32229 | 316 (defgroup eudc-ph nil |
27313 | 317 "Emacs Unified Directory Client - CCSO PH/QI Backend." |
318 :group 'eudc) | |
319 | |
320 (defcustom eudc-ph-bbdb-conversion-alist | |
321 '((name . name) | |
322 (net . email) | |
323 (address . (eudc-bbdbify-address address "Address")) | |
324 (phone . ((eudc-bbdbify-phone phone "Phone") | |
325 (eudc-bbdbify-phone office_phone "Office Phone")))) | |
326 "*A mapping from BBDB to PH/QI fields. | |
327 This is a list of cons cells (BBDB-FIELD . SPEC-OR-LIST) where | |
328 BBDB-FIELD is the name of a field that must be defined in your BBDB | |
329 environment (standard field names are `name', `company', `net', `phone', | |
330 `address' and `notes'). SPEC-OR-LIST is either a single SPEC or a list | |
331 of SPECs. Lists of specs are valid only for the `phone' and `address' | |
332 BBDB fields. SPECs are sexps which are evaluated: | |
333 a string evaluates to itself, | |
334 a symbol evaluates to the symbol value. Symbols naming PH/QI fields | |
335 present in the record evaluate to the value of the field in the record, | |
32229 | 336 a form is evaluated as a function. The argument list may contain PH/QI |
27313 | 337 field names which eval to the corresponding values in the |
338 record. The form evaluation should return something appropriate for | |
339 the particular BBDB-FIELD (see `bbdb-create-internal'). | |
340 `eudc-bbdbify-phone' and `eudc-bbdbify-address' are provided as convenience | |
341 functions to parse phones and addresses." | |
342 :tag "BBDB to PH Field Name Mapping" | |
343 :type '(repeat (cons :tag "Field Name" | |
344 (symbol :tag "BBDB Field") | |
345 (sexp :tag "Conversion Spec"))) | |
346 :group 'eudc-ph) | |
347 | |
348 ;;}}} | |
349 | |
350 ;;{{{ LDAP Custom Group | |
351 | |
32229 | 352 (defgroup eudc-ldap nil |
27313 | 353 "Emacs Unified Directory Client - LDAP Backend." |
354 :group 'eudc) | |
355 | |
356 (defcustom eudc-ldap-bbdb-conversion-alist | |
357 '((name . cn) | |
358 (net . mail) | |
359 (address . (eudc-bbdbify-address postaladdress "Address")) | |
360 (phone . ((eudc-bbdbify-phone telephonenumber "Phone")))) | |
361 "*A mapping from BBDB to LDAP attributes. | |
362 This is a list of cons cells (BBDB-FIELD . SPEC-OR-LIST) where | |
363 BBDB-FIELD is the name of a field that must be defined in your BBDB | |
364 environment (standard field names are `name', `company', `net', `phone', | |
365 `address' and `notes'). SPEC-OR-LIST is either a single SPEC or a list | |
366 of SPECs. Lists of specs are valid only for the `phone' and `address' | |
367 BBDB fields. SPECs are sexps which are evaluated: | |
368 a string evaluates to itself, | |
369 a symbol evaluates to the symbol value. Symbols naming LDAP attributes | |
370 present in the record evaluate to the value of the field in the record, | |
32229 | 371 a form is evaluated as a function. The argument list may contain LDAP |
27313 | 372 field names which eval to the corresponding values in the |
373 record. The form evaluation should return something appropriate for | |
374 the particular BBDB-FIELD (see `bbdb-create-internal'). | |
375 `eudc-bbdbify-phone' and `eudc-bbdbify-address' are provided as convenience | |
376 functions to parse phones and addresses." | |
377 :tag "BBDB to LDAP Attribute Names Mapping" | |
378 :type '(repeat (cons :tag "Field Name" | |
379 (symbol :tag "BBDB Field") | |
380 (sexp :tag "Conversion Spec"))) | |
381 :group 'eudc-ldap) | |
382 | |
383 ;;}}} | |
384 | |
385 ;;{{{ BBDB Custom Group | |
386 | |
32229 | 387 (defgroup eudc-bbdb nil |
27313 | 388 "Emacs Unified Directory Client - BBDB Backend." |
389 :group 'eudc) | |
390 | |
391 (defcustom eudc-bbdb-use-locations-as-attribute-names t | |
392 "If non-nil, BBDB address and phone locations are used as attribute names. | |
393 This has no effect on queries (you can't search for a specific location) | |
42563 | 394 but influences the way records are displayed." |
27313 | 395 :type 'boolean |
396 :group 'eudc-bbdb) | |
397 | |
398 (defcustom eudc-bbdb-enable-substring-matches t | |
399 "If non-nil, authorize substring match in the same way BBDB does. | |
400 Otherwise records must match queries exactly." | |
401 :type 'boolean | |
402 :group 'eudc-bbdb) | |
403 | |
404 ;;}}} | |
405 | |
406 | |
407 (provide 'eudc-vars) | |
408 | |
52401 | 409 ;;; arch-tag: 80050575-b838-4246-8ebc-b2d7c5a2e482 |
27313 | 410 ;;; eudc-vars.el ends here |