comparison lisp/ldap.el @ 4783:e29fcfd8df5f

Eliminate most core code byte-compile warnings. 2009-12-18 Aidan Kehoe <kehoea@parhasard.net> * alist.el (modify-alist): * autoload.el (update-autoload-files, autoload-print-form): * bytecomp.el (batch-byte-compile-1) (byte-compile-multiple-value-call, byte-compile-funcall) (byte-compile-insert, byte-compile-concat, byte-compile-list) (byte-compile-normal-call, byte-compile-flush-pending): * cl-macs.el (letf): * cl.el: * disass.el (disassemble-1): * easy-mmode.el (easy-mmode-define-syntax): * faces.el (set-face-parent): * files.el (cd): * finder.el (finder-list-matches, finder-list-keywords) (finder-compile-keywords): * frame.el (frame-notice-user-settings) (frame-remove-geometry-props): * ldap.el (ldap-delete-entries, ldap-modify-entries) (ldap-add-entries): * loadhist.el (unload-feature): * map-ynp.el (map-y-or-n-p): * menubar-items.el (default-menubar): * mouse.el (default-mouse-track-next-move-rect) (default-mouse-track-next-move-rect) (default-mouse-track-cleanup-hook) (default-mouse-track-cleanup-extent): * mule/ethio-util.el (ethio-fidel-to-sera-buffer) (ethio-modify-vowel): * obsolete.el: * package-get.el (package-get-update-all): * package-ui.el (pui-list-packages) (pui-install-selected-packages, pui-install-selected-packages): * select.el (select-make-extent-for-selection) (dehilight-selection): * simple.el (clone-buffer): * term/tvi970.el: * term/wyse50.el: * unicode.el: (load-unicode-tables): * x-font-menu.el (fc-make-font-menu-entry) (x-reset-device-font-menus-xft): * x-misc.el (x-init-specifier-from-resources): Eliminate byte-compile warnings, with the exception of Stephen's various non-defined fontconfig functions, as I don't know if he plans to add them and is keeping the warnings around as a reminder. The warnings actually eliminated involve i) using mapcar instead of mapc where the result is discarded and ii) using a lambda quoted as data in a context where it is unequivocally used as a function.
author Aidan Kehoe <kehoea@parhasard.net>
date Fri, 18 Dec 2009 17:49:43 +0000
parents 7039e6323819
children f00192e1cd49 91b3aa59f49b
comparison
equal deleted inserted replaced
4782:1523f1d28be1 4783:e29fcfd8df5f
531 (if ldap-verbose 531 (if ldap-verbose
532 (message "Opening LDAP connection to %s..." host)) 532 (message "Opening LDAP connection to %s..." host))
533 (setq ldap (ldap-open host host-plist)) 533 (setq ldap (ldap-open host host-plist))
534 (if ldap-verbose 534 (if ldap-verbose
535 (message "Adding LDAP entries...")) 535 (message "Adding LDAP entries..."))
536 (mapcar (function 536 (mapc (function
537 (lambda (thisentry) 537 (lambda (thisentry)
538 (ldap-add ldap (car thisentry) (cdr thisentry)) 538 (ldap-add ldap (car thisentry) (cdr thisentry))
539 (if ldap-verbose 539 (if ldap-verbose
540 (message "%d added" i)) 540 (message "%d added" i))
541 (setq i (1+ i)))) 541 (setq i (1+ i))))
542 entries) 542 entries)
543 (ldap-close ldap))) 543 (ldap-close ldap)))
544 544
545 545
546 (defun ldap-modify-entries (entry-mods &optional host binddn passwd) 546 (defun ldap-modify-entries (entry-mods &optional host binddn passwd)
547 "Modify entries of an LDAP directory. 547 "Modify entries of an LDAP directory.
548 ENTRY_MODS is a list of entry modifications of the form 548 ENTRY_MODS is a list of entry modifications of the form
549 (DN MOD-SPEC1 MOD-SPEC2 ...) where DN is the distinguished name of 549 (DN MOD-SPEC1 MOD-SPEC2 ...) where DN is the distinguished name of
550 the entry to modify, the following are modification specifications. 550 the entry to modify, the following are modification specifications.
551 A modification specification is itself a list of the form 551 A modification specification is itself a list of the form
552 (MOD-OP ATTR VALUE1 VALUE2 ...) MOD-OP and ATTR are mandatory, 552 \(MOD-OP ATTR VALUE1 VALUE2 ...) MOD-OP and ATTR are mandatory,
553 VALUEs are optional depending on MOD-OP. 553 VALUEs are optional depending on MOD-OP.
554 MOD-OP is the type of modification, one of the symbols `add', `delete' 554 MOD-OP is the type of modification, one of the symbols `add', `delete'
555 or `replace'. ATTR is the LDAP attribute type to modify. 555 or `replace'. ATTR is the LDAP attribute type to modify.
556 HOST is the LDAP host, defaulting to `ldap-default-host'. 556 HOST is the LDAP host, defaulting to `ldap-default-host'.
557 BINDDN is the DN to bind as to the server. 557 BINDDN is the DN to bind as to the server.
571 (if ldap-verbose 571 (if ldap-verbose
572 (message "Opening LDAP connection to %s..." host)) 572 (message "Opening LDAP connection to %s..." host))
573 (setq ldap (ldap-open host host-plist)) 573 (setq ldap (ldap-open host host-plist))
574 (if ldap-verbose 574 (if ldap-verbose
575 (message "Modifying LDAP entries...")) 575 (message "Modifying LDAP entries..."))
576 (mapcar (function 576 (mapc (function
577 (lambda (thisentry) 577 (lambda (thisentry)
578 (ldap-modify ldap (car thisentry) (cdr thisentry)) 578 (ldap-modify ldap (car thisentry) (cdr thisentry))
579 (if ldap-verbose 579 (if ldap-verbose
580 (message "%d modified" i)) 580 (message "%d modified" i))
581 (setq i (1+ i)))) 581 (setq i (1+ i))))
582 entry-mods) 582 entry-mods)
583 (ldap-close ldap))) 583 (ldap-close ldap)))
584 584
585 585
586 (defun ldap-delete-entries (dn &optional host binddn passwd) 586 (defun ldap-delete-entries (dn &optional host binddn passwd)
587 "Delete an entry from an LDAP directory. 587 "Delete an entry from an LDAP directory.
606 (setq ldap (ldap-open host host-plist)) 606 (setq ldap (ldap-open host host-plist))
607 (if (consp dn) 607 (if (consp dn)
608 (let ((i 1)) 608 (let ((i 1))
609 (if ldap-verbose 609 (if ldap-verbose
610 (message "Deleting LDAP entries...")) 610 (message "Deleting LDAP entries..."))
611 (mapcar (function 611 (mapc (function
612 (lambda (thisdn) 612 (lambda (thisdn)
613 (ldap-delete ldap thisdn) 613 (ldap-delete ldap thisdn)
614 (if ldap-verbose 614 (if ldap-verbose
615 (message "%d deleted" i)) 615 (message "%d deleted" i))
616 (setq i (1+ i)))) 616 (setq i (1+ i))))
617 dn)) 617 dn))
618 (if ldap-verbose 618 (if ldap-verbose
619 (message "Deleting LDAP entry...")) 619 (message "Deleting LDAP entry..."))
620 (ldap-delete ldap dn)) 620 (ldap-delete ldap dn))
621 (ldap-close ldap))) 621 (ldap-close ldap)))
622 622