2010-01-01 TAKAHASHI Kaoru <kaoru@kaisei.org>
+ * pldap.el (ldap-search-entries): Don't use `function' for lambda.
+ (ldap-add-entries, ldap-modify-entries): Use `mapc' instead of `mapcar'.
+ (ldap-delete-entries): Use `mapc' instead of `mapcar'. Don't use
+ `function' for lambda.
+
* modb-standard.el (modb-standard-cleanup-stale-entities): Use
`string-to-number' instead of `string-to-int'.
(set-buffer-multibyte nil)
(if ldap-ignore-attribute-codings
result
- (mapcar (function
- (lambda (record)
- (mapcar 'ldap-decode-attribute record)))
- result)))))
+ (mapcar
+ (lambda (record)
+ (mapcar 'ldap-decode-attribute record))
+ result)))))
(defun ldap-add-entries (entries &optional host binddn passwd)
"Add entries to an LDAP directory.
(setq ldap (ldap-open host host-plist))
(if ldap-verbose
(message "Adding LDAP entries..."))
- (mapcar (lambda (thisentry)
- (setcdr thisentry
- (mapcar
- (lambda (add-spec)
- (setq add-spec (ldap-encode-attribute
- (list (car add-spec)
- (cdr add-spec))))
- (cons (nth 0 add-spec)
- (nth 1 add-spec)))
- (cdr thisentry)))
- (setq thisentry (ldap-encode-attribute thisentry))
- (ldap-add ldap (car thisentry) (cdr thisentry))
- (if ldap-verbose
- (message "%d added" i))
- (setq i (1+ i)))
- entries)
+ (mapc (lambda (thisentry)
+ (setcdr thisentry
+ (mapcar
+ (lambda (add-spec)
+ (setq add-spec (ldap-encode-attribute
+ (list (car add-spec)
+ (cdr add-spec))))
+ (cons (nth 0 add-spec)
+ (nth 1 add-spec)))
+ (cdr thisentry)))
+ (setq thisentry (ldap-encode-attribute thisentry))
+ (ldap-add ldap (car thisentry) (cdr thisentry))
+ (if ldap-verbose
+ (message "%d added" i))
+ (setq i (1+ i)))
+ entries)
(ldap-close ldap)))
(defun ldap-modify-entries (entry-mods &optional host binddn passwd)
(setq ldap (ldap-open host host-plist))
(if ldap-verbose
(message "Modifying LDAP entries..."))
- (mapcar (lambda (thisentry)
- (setcdr thisentry
- (mapcar
- (lambda (mod-spec)
- (if (or (eq (car mod-spec) 'add)
- (eq (car mod-spec) 'replace))
- (append (list (nth 0 mod-spec))
- (ldap-encode-attribute
- (cdr mod-spec)))))
- (cdr thisentry)))
- (ldap-modify ldap (car thisentry) (cdr thisentry))
- (if ldap-verbose
- (message "%d modified" i))
- (setq i (1+ i)))
- entry-mods)
+ (mapc
+ (lambda (thisentry)
+ (setcdr thisentry
+ (mapcar
+ (lambda (mod-spec)
+ (if (or (eq (car mod-spec) 'add)
+ (eq (car mod-spec) 'replace))
+ (append (list (nth 0 mod-spec))
+ (ldap-encode-attribute
+ (cdr mod-spec)))))
+ (cdr thisentry)))
+ (ldap-modify ldap (car thisentry) (cdr thisentry))
+ (if ldap-verbose
+ (message "%d modified" i))
+ (setq i (1+ i)))
+ entry-mods)
(ldap-close ldap)))
(defun ldap-delete-entries (dn &optional host binddn passwd)
(let ((i 1))
(if ldap-verbose
(message "Deleting LDAP entries..."))
- (mapcar (function
- (lambda (thisdn)
- (ldap-delete ldap thisdn)
- (if ldap-verbose
- (message "%d deleted" i))
- (setq i (1+ i))))
- dn))
+ (mapc
+ (lambda (thisdn)
+ (ldap-delete ldap thisdn)
+ (if ldap-verbose
+ (message "%d deleted" i))
+ (setq i (1+ i)))
+ dn))
(if ldap-verbose
(message "Deleting LDAP entry..."))
(ldap-delete ldap dn))