From 750c33f71e7281e651f7315689f9085a1d0894d7 Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Sun, 17 Jul 2011 00:49:20 +0200 Subject: [PATCH] Move the defintion of `gnutls-log-level' to the C level to avoid loading problems --- lisp/ChangeLog | 2 ++ lisp/net/gnutls.el | 5 ----- src/ChangeLog | 3 +++ src/gnutls.c | 16 ++++++++-------- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 186917010ab..15f742ed91a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2011-07-16 Lars Magne Ingebrigtsen + * net/gnutls.el (gnutls-log-level): Removed. + * textmodes/fill.el (adaptive-fill-regexp): Include EN DASH as an indentation character (bug#6380). diff --git a/lisp/net/gnutls.el b/lisp/net/gnutls.el index edbf9a54afc..9cb071b185d 100644 --- a/lisp/net/gnutls.el +++ b/lisp/net/gnutls.el @@ -42,11 +42,6 @@ :prefix "gnutls-" :group 'net-utils) -(defcustom gnutls-log-level 0 - "Logging level to be used by `starttls-negotiate' and GnuTLS." - :type 'integer - :group 'gnutls) - (defcustom gnutls-algorithm-priority nil "If non-nil, this should be a TLS priority string. For instance, if you want to skip the \"dhe-rsa\" algorithm, diff --git a/src/ChangeLog b/src/ChangeLog index 961b3e0234a..27a375c978d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -4,6 +4,9 @@ 2011-07-16 Lars Magne Ingebrigtsen + * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since + it's used from the C level. + * process.c: Use the same condition for POLL_FOR_INPUT in both keyboard.c and process.c (bug#1858). diff --git a/src/gnutls.c b/src/gnutls.c index fdc0c13a53b..52e80a69ae5 100644 --- a/src/gnutls.c +++ b/src/gnutls.c @@ -35,7 +35,6 @@ static int emacs_gnutls_handle_error (gnutls_session_t, int err); static Lisp_Object Qgnutls_dll; -static Lisp_Object Qgnutls_log_level; static Lisp_Object Qgnutls_code; static Lisp_Object Qgnutls_anon, Qgnutls_x509pki; static Lisp_Object Qgnutls_e_interrupted, Qgnutls_e_again, @@ -146,7 +145,6 @@ static int init_gnutls_functions (Lisp_Object libraries) { HMODULE library; - Lisp_Object gnutls_log_level = Fsymbol_value (Qgnutls_log_level); int max_log_level = 1; if (!(library = w32_delayed_load (libraries, Qgnutls_dll))) @@ -195,8 +193,8 @@ init_gnutls_functions (Lisp_Object libraries) LOAD_GNUTLS_FN (library, gnutls_x509_crt_import); LOAD_GNUTLS_FN (library, gnutls_x509_crt_init); - if (NUMBERP (gnutls_log_level)) - max_log_level = XINT (gnutls_log_level); + if (NUMBERP (Vgnutls_log_level)) + max_log_level = XINT (Vgnutls_log_level); GNUTLS_LOG2 (1, max_log_level, "GnuTLS library loaded:", SDATA (Fget (Qgnutls_dll, QCloaded_from))); @@ -399,7 +397,6 @@ emacs_gnutls_read (struct Lisp_Process *proc, char *buf, EMACS_INT nbyte) static int emacs_gnutls_handle_error (gnutls_session_t session, int err) { - Lisp_Object gnutls_log_level = Fsymbol_value (Qgnutls_log_level); int max_log_level = 0; int ret; @@ -409,8 +406,8 @@ emacs_gnutls_handle_error (gnutls_session_t session, int err) if (err >= 0) return 0; - if (NUMBERP (gnutls_log_level)) - max_log_level = XINT (gnutls_log_level); + if (NUMBERP (Vgnutls_log_level)) + max_log_level = XINT (Vgnutls_log_level); /* TODO: use gnutls-error-fatalp and gnutls-error-string. */ @@ -1118,7 +1115,6 @@ syms_of_gnutls (void) gnutls_global_initialized = 0; DEFSYM (Qgnutls_dll, "gnutls"); - DEFSYM (Qgnutls_log_level, "gnutls-log-level"); DEFSYM (Qgnutls_code, "gnutls-code"); DEFSYM (Qgnutls_anon, "gnutls-anon"); DEFSYM (Qgnutls_x509pki, "gnutls-x509pki"); @@ -1158,6 +1154,10 @@ syms_of_gnutls (void) defsubr (&Sgnutls_deinit); defsubr (&Sgnutls_bye); defsubr (&Sgnutls_available_p); + + DEFVAR_INT ("gnutls-log-level", Vgnutls_log_level, + doc: /* Logging level used by the GnuTLS functions. */); + Vgnutls_log_level = make_number (0); } #endif /* HAVE_GNUTLS */ -- 2.39.5