X-Git-Url: http://cgit.sxemacs.org/?p=gnus;a=blobdiff_plain;f=lisp%2Fsmime-ldap.el;h=66ae9c5de4dc2ca3ff2a976f1474b75aa3620228;hp=0480735e7ff48c43b04898e571d307e120d14d09;hb=94f288135f95ca48fb50f5aa43bc09f9669c5c23;hpb=c9a393eeb329a99695566342a9f03b8a30000898 diff --git a/lisp/smime-ldap.el b/lisp/smime-ldap.el index 0480735e7..66ae9c5de 100644 --- a/lisp/smime-ldap.el +++ b/lisp/smime-ldap.el @@ -20,9 +20,7 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. +;; along with GNU Emacs. If not, see . ;;; Commentary: @@ -53,28 +51,8 @@ Additional search parameters can be specified through ;; for XEmacs (if (fboundp 'ldap-search-entries) (ldap-search-entries filter host attributes attrsonly) - ;; for Emacs 22 - (if (>= emacs-major-version 22) - (cdr (ldap-search filter host attributes attrsonly)) - ;; for Emacs 21.x - (or host - (setq host ldap-default-host) - (error "No LDAP host specified")) - (let ((host-plist (cdr (assoc host ldap-host-parameters-alist))) - result) - (setq result (smime-ldap-search-internal - (append host-plist - (list 'host host - 'filter filter - 'attributes attributes - 'attrsonly attrsonly - 'withdn withdn)))) - (cdr (if ldap-ignore-attribute-codings - result - (mapcar (function - (lambda (record) - (mapcar 'ldap-decode-attribute record))) - result))))))) + ;; for Emacs + (cdr (ldap-search filter host attributes attrsonly)))) (defun smime-ldap-search-internal (search-plist) "Perform a search on a LDAP server. @@ -120,8 +98,7 @@ an alist of attribute/value pairs." (equal "" filter)) (error "No search filter")) (setq filter (cons filter attributes)) - (save-excursion - (set-buffer buf) + (with-current-buffer buf (erase-buffer) (if (and host (not (equal "" host))) @@ -181,8 +158,7 @@ an alist of attribute/value pairs." "\\(<[\t ]*file://\\)?\\(.*\\)$")) (setq name (match-string 1) value (match-string 4)) - (save-excursion - (set-buffer bufval) + (with-current-buffer bufval (erase-buffer) (insert-file-contents-literally value) (delete-file value)