From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Reiner Steib Newsgroups: gmane.emacs.devel Subject: Re: New Emacs facilities from Gnus Date: Wed, 07 Nov 2007 19:02:18 +0100 Message-ID: References: <87zly3y4ru.fsf@catnip.gol.com> <87odejy30k.fsf@catnip.gol.com> <87bqa8z601.fsf@arnested.dk> <87hcjz80jr.fsf@arnested.dk> Reply-To: Reiner Steib NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1194458649 20960 80.91.229.12 (7 Nov 2007 18:04:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 7 Nov 2007 18:04:09 +0000 (UTC) Cc: Arne =?iso-8859-1?Q?J=F8rgensen?= , rms@gnu.org, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 07 19:04:11 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IppG6-0004mq-Oy for ged-emacs-devel@m.gmane.org; Wed, 07 Nov 2007 19:04:11 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IppFv-0000JQ-EH for ged-emacs-devel@m.gmane.org; Wed, 07 Nov 2007 13:03:59 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IppFr-0000FT-H8 for emacs-devel@gnu.org; Wed, 07 Nov 2007 13:03:55 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IppFp-0000Bo-PV for emacs-devel@gnu.org; Wed, 07 Nov 2007 13:03:54 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IppFp-0000BP-HC for emacs-devel@gnu.org; Wed, 07 Nov 2007 13:03:53 -0500 Original-Received: from mail.uni-ulm.de ([134.60.1.11]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IppFl-0005jh-Cs; Wed, 07 Nov 2007 13:03:49 -0500 Original-Received: from bridgekeeper.physik.uni-ulm.de (bridgekeeper.physik.uni-ulm.de [134.60.41.37]) by mail.uni-ulm.de (8.14.1/8.14.1) with ESMTP id lA7I3j9p014135; Wed, 7 Nov 2007 19:03:46 +0100 (MET) Original-Received: from localhost (bridgekeeper.physik.uni-ulm.de [134.60.41.37]) by bridgekeeper.physik.uni-ulm.de (Postfix) with ESMTP id CC35012D56; Wed, 7 Nov 2007 19:03:45 +0100 (CET) X-Face: 1; h7XMU[7l}$T@J.D}5z*w8Tg'}B5ArAWc8>2X~otB; kOjKs8X%|hTC#dG:%Vpx")x7S/`v :VXU#fZW$X$zdhEU.RfVQ@<-m9IuN{Hm"fW{,5]6kR'M*vEs+{5Cj!L(JTRzA$(},?5J=sm; %Od, rms@gnu.org, emacs-devel@gnu.org, Arne =?iso-8859-1?Q?J=F8rgensen?= In-Reply-To: (Stefan Monnier's message of "Wed, 07 Nov 2007 12:22:13 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) X-DCC-debian-Metrics: poseidon 1169; Body=4 Fuz1=4 Fuz2=4 X-Virus-Scanned: by amavisd-new X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:82762 Archived-At: On Wed, Nov 07 2007, Stefan Monnier wrote: >> Couldn't we use a test to check if the "good" version of `ldap-search' >> is available so that the code in both versions (of smime.el?) stays >> identical? > > Maybe a simpler approach is to change (fboundp 'smime-ldap-search)? But (require 'smime-ldap) would fail so the user would get an error. Or am I missing something? How about this patch (and deleting `smime-ldap.el' in Emacs)? Cf. the tests in `smime-ldap-search'. --8<---------------cut here---------------start------------->8--- --- smime.el 28 Oct 2007 09:18:28 -0000 1.14 +++ smime.el 7 Nov 2007 18:01:39 -0000 @@ -122,7 +122,6 @@ ;;; Code: (require 'dig) -(require 'smime-ldap) (require 'password) (eval-when-compile (require 'cl)) @@ -590,8 +589,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) --8<---------------cut here---------------end--------------->8--- Bye, Reiner. -- ,,, (o o) ---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/