From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] GnuTLS support on Woe32 Date: Mon, 2 May 2011 21:00:40 +0200 Message-ID: References: <87ipvwl1nx.wl%claudio.bley@gmail.com> <87wrjquacf.fsf@lifelogs.com> <87lj05svwh.fsf@lifelogs.com> <87bp11imgb.wl%claudio.bley@gmail.com> <8739mc5nes.fsf@lifelogs.com> <87ipuubao6.fsf@lifelogs.com> <87fwpjfkkz.fsf@lifelogs.com> <87bp072fb1.fsf@lifelogs.com> <874o5vimm5.fsf@lifelogs.com> <87zknjmcyk.fsf@lifelogs.com> <87sjta2zvp.fsf@lifelogs.com> <87liyzglkh.fsf@lifelogs.com> <4DB77682.1070605@gmail.com> <8762q04ba1.fsf@lifelogs.com> <87hb9dufao.fsf@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1304362901 19415 80.91.229.12 (2 May 2011 19:01:41 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 2 May 2011 19:01:41 +0000 (UTC) Cc: emacs-devel@gnu.org To: Ted Zlatanov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 02 21:01:37 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QGyNC-0006md-Bo for ged-emacs-devel@m.gmane.org; Mon, 02 May 2011 21:01:34 +0200 Original-Received: from localhost ([::1]:35139 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QGyNC-00028y-09 for ged-emacs-devel@m.gmane.org; Mon, 02 May 2011 15:01:34 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:56523) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QGyN4-00028p-OG for emacs-devel@gnu.org; Mon, 02 May 2011 15:01:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QGyMz-0000rk-2g for emacs-devel@gnu.org; Mon, 02 May 2011 15:01:26 -0400 Original-Received: from mail-yw0-f41.google.com ([209.85.213.41]:38981) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QGyMy-0000rg-VN for emacs-devel@gnu.org; Mon, 02 May 2011 15:01:21 -0400 Original-Received: by ywa1 with SMTP id 1so2486733ywa.0 for ; Mon, 02 May 2011 12:01:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=rROw0uZJoGXmRpa7e+0FI4nQZRLivAanlpXD82cE474=; b=S9KPxsFEORIk2ZO9fFqNFWy9liGjNXhejn2Q66hkoBe9e6F9GnoZFd9Jck2LDbL1oG Vc5nwghwDf225aVdB3PScTFXo/z9HFy165Uw/34LM8TJadI35VHjdlvAYxd/7pWSESW2 YscN4fPYfPRTZ1k6RxPu5sS7ar1Dxil6bHZ9g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=vBGNFxWQLQxZkvFz9P22+BXIR6EweHM/s7rvvVxcDtDXJWAhHlgtvW6DDefh23WinO cN3i4VNqqiTDpihbXTpZz7v7OrrA4JHVBksGNZB0bNoulfCkHQ5gkKKEFogbutUFUVMN Kz808/tLtiTetxJs4WtlW6Hf3QuXrPRM8ymI8= Original-Received: by 10.146.33.3 with SMTP id g3mr6977201yag.23.1304362880173; Mon, 02 May 2011 12:01:20 -0700 (PDT) Original-Received: by 10.147.182.5 with HTTP; Mon, 2 May 2011 12:00:40 -0700 (PDT) In-Reply-To: <87hb9dufao.fsf@lifelogs.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.213.41 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:138980 Archived-At: 2011/5/2 Ted Zlatanov : > All the C GnuTLS init code (currently `gnutls-boot') calls > `emacs_gnutls_global_init' *every time*, which is short enough to quote > here: [...] > So we just need to modify `emacs_gnutls_global_init' to load and check > the GnuTLS library and return an appropriate error (which can be any > ELisp number object, so you can attach debug info to it). =C2=A0Or you ca= n do > it once at init time, which seems less convenient to the user but less > work. =C2=A0I don't have an opinion either way. No, I prefer to do it in emacs_gnutls_global_init, so the .DLLs are loaded on demand. But to avoid repeated attempts in case the library is not present, I'll do as with the image libraries: cache the result. That means that the library must be present the fist time it is used, or it won't be available during the complete run of that Emacs instance. > I think gnutls.el should not know about this. =C2=A0It should simply get = an > error from the C layer if the library could not be loaded. What if some elisp code wants to know whether GnuTLS is available? (fboundp 'gnutls-whatever) won't do, because the functions are defined (just non-functional). IMO (if (gnutls-available-p) ; do something ; do something else seems cleaner that (condition-case err ; use gnutls (;catch the error)) but it is your call. =C2=A0 =C2=A0 Juanma