# HG changeset patch # User Reiner Steib # Date 1195763193 0 # Node ID 84e43f9352ad3f9f670386d7ba45a8dd0811445c # Parent d6fc6b220aa772611ac09dc22ab9fc64f6b4962a (smime-cert-by-ldap-1): Use `ldap-search' instead of `smime-ldap-search' for Emacs 22 and up. diff -r d6fc6b220aa7 -r 84e43f9352ad lisp/gnus/ChangeLog --- a/lisp/gnus/ChangeLog Thu Nov 22 20:26:33 2007 +0000 +++ b/lisp/gnus/ChangeLog Thu Nov 22 20:26:33 2007 +0000 @@ -1,3 +1,8 @@ +2007-11-22 Reiner Steib + + * smime.el (smime-cert-by-ldap-1): Use `ldap-search' instead of + `smime-ldap-search' for Emacs 22 and up. + 2007-11-22 Stefan Monnier * gnus-art.el (gnus-article-truncate-lines): Use `truncate-lines'. diff -r d6fc6b220aa7 -r 84e43f9352ad lisp/gnus/smime.el --- a/lisp/gnus/smime.el Thu Nov 22 20:26:33 2007 +0000 +++ b/lisp/gnus/smime.el Thu Nov 22 20:26:33 2007 +0000 @@ -122,7 +122,6 @@ ;;; Code: (require 'dig) -(require 'smime-ldap) (require 'password) (eval-when-compile (require 'cl)) @@ -589,8 +588,17 @@ (defun smime-cert-by-ldap-1 (mail host) "Get cetificate for MAIL from the ldap server at HOST." - (let ((ldapresult (smime-ldap-search (concat "mail=" mail) - host '("userCertificate") nil)) + (let ((ldapresult + (funcall + (if (or (featurep 'xemacs) + ;; For Emacs >= 22 we don't need smime-ldap.el + (< emacs-major-version 22)) + (progn + (require 'smime-ldap) + 'smime-ldap-search) + 'ldap-search) + (concat "mail=" mail) + host '("userCertificate") nil)) (retbuf (generate-new-buffer (format "*certificate for %s*" mail))) cert) (if (and (>= (length ldapresult) 1)