38 |
;; The main entry points of EUDC are: |
;; The main entry points of EUDC are: |
39 |
;; `eudc-query-form': Query a directory server from a query form |
;; `eudc-query-form': Query a directory server from a query form |
40 |
;; `eudc-expand-inline': Query a directory server for the e-mail address |
;; `eudc-expand-inline': Query a directory server for the e-mail address |
41 |
;; of the name before cursor and insert it in the |
;; of the name before cursor and insert it in the |
42 |
;; buffer |
;; buffer |
43 |
;; `eudc-get-phone': Get a phone number from a directory server |
;; `eudc-get-phone': Get a phone number from a directory server |
44 |
;; `eudc-get-email': Get an e-mail address from a directory server |
;; `eudc-get-email': Get an e-mail address from a directory server |
134 |
(defun eudc-plist-get (plist prop &optional default) |
(defun eudc-plist-get (plist prop &optional default) |
135 |
"Extract a value from a property list. |
"Extract a value from a property list. |
136 |
PLIST is a property list, which is a list of the form |
PLIST is a property list, which is a list of the form |
137 |
(PROP1 VALUE1 PROP2 VALUE2...). This function returns the value |
\(PROP1 VALUE1 PROP2 VALUE2...). This function returns the value |
138 |
corresponding to the given PROP, or DEFAULT if PROP is not |
corresponding to the given PROP, or DEFAULT if PROP is not |
139 |
one of the properties on the list." |
one of the properties on the list." |
140 |
(if (eudc-plist-member plist prop) |
(if (eudc-plist-member plist prop) |
207 |
(defun eudc-default-set (var val) |
(defun eudc-default-set (var val) |
208 |
"Set the EUDC default value of VAR to VAL. |
"Set the EUDC default value of VAR to VAL. |
209 |
The current binding of VAR is not changed." |
The current binding of VAR is not changed." |
210 |
(put var 'eudc-locals |
(put var 'eudc-locals |
211 |
(plist-put (get var 'eudc-locals) 'default val)) |
(plist-put (get var 'eudc-locals) 'default val)) |
212 |
(add-to-list 'eudc-local-vars var)) |
(add-to-list 'eudc-local-vars var)) |
213 |
|
|
221 |
(protocol-locals (eudc-plist-get eudc-locals 'protocol))) |
(protocol-locals (eudc-plist-get eudc-locals 'protocol))) |
222 |
(setq protocol-locals (plist-put protocol-locals (or protocol |
(setq protocol-locals (plist-put protocol-locals (or protocol |
223 |
eudc-protocol) val)) |
eudc-protocol) val)) |
224 |
(setq eudc-locals |
(setq eudc-locals |
225 |
(plist-put eudc-locals 'protocol protocol-locals)) |
(plist-put eudc-locals 'protocol protocol-locals)) |
226 |
(put var 'eudc-locals eudc-locals) |
(put var 'eudc-locals eudc-locals) |
227 |
(add-to-list 'eudc-local-vars var) |
(add-to-list 'eudc-local-vars var) |
293 |
(eudc-plist-member eudc-locals 'server))) |
(eudc-plist-member eudc-locals 'server))) |
294 |
'unbound |
'unbound |
295 |
(setq server-locals (eudc-plist-get eudc-locals 'server)) |
(setq server-locals (eudc-plist-get eudc-locals 'server)) |
296 |
(eudc-lax-plist-get server-locals |
(eudc-lax-plist-get server-locals |
297 |
(or server |
(or server |
298 |
eudc-server) 'unbound)))) |
eudc-server) 'unbound)))) |
299 |
|
|
789 |
(let (formats) |
(let (formats) |
790 |
(while (and (null formats) |
(while (and (null formats) |
791 |
(> n 0)) |
(> n 0)) |
792 |
(setq formats |
(setq formats |
793 |
(delq nil |
(delq nil |
794 |
(mapcar '(lambda (format) |
(mapcar '(lambda (format) |
795 |
(if (= n |
(if (= n |
1103 |
|
|
1104 |
;;}}} |
;;}}} |
1105 |
|
|
1106 |
;;{{{ Menus an keymaps |
;;{{{ Menus and keymaps |
1107 |
|
|
1108 |
(require 'easymenu) |
(require 'easymenu) |
1109 |
|
|
1185 |
(add-submenu '("Tools") (eudc-menu))) |
(add-submenu '("Tools") (eudc-menu))) |
1186 |
(eudc-emacs-p |
(eudc-emacs-p |
1187 |
(cond |
(cond |
1188 |
|
((fboundp 'easy-menu-create-menu) |
1189 |
|
(define-key |
1190 |
|
global-map |
1191 |
|
[menu-bar tools directory-search] |
1192 |
|
(cons "Directory Search" |
1193 |
|
(easy-menu-create-menu "Directory Search" (cdr (eudc-menu)))))) |
1194 |
((fboundp 'easy-menu-add-item) |
((fboundp 'easy-menu-add-item) |
1195 |
(let ((menu (eudc-menu))) |
(let ((menu (eudc-menu))) |
1196 |
(easy-menu-add-item nil '("tools") (easy-menu-create-menu (car menu) |
(easy-menu-add-item nil '("tools") (easy-menu-create-menu (car menu) |