emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] GnuTLS support on Woe32


From: Juanma Barranquero
Subject: Re: [PATCH] GnuTLS support on Woe32
Date: Mon, 2 May 2011 21:00:40 +0200

2011/5/2 Ted Zlatanov <address@hidden>:

> 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).  Or you can do
> it once at init time, which seems less convenient to the user but less
> work.  I 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.  It 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.

    Juanma



reply via email to

[Prev in Thread] Current Thread [Next in Thread]