emacs-devel
[Top][All Lists]
Advanced

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

Vlexical_binding is sometimes NULL


From: BT Templeton
Subject: Vlexical_binding is sometimes NULL
Date: Mon, 23 Jul 2012 20:56:09 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)

The `Vlexical_binding' is sometimes NULL in a context where it can be
accessed from Lisp code. For example, if I run `temacs -Q' (non-dumped
Emacs) and evaluate `lexical-binding' in the scratch buffer, it
evaluates to zero (NULL interpreted as a fixnum).

This doesn't cause any obvious problems right now, but it may if the
Lisp object representation changes; in Guile-Emacs it can cause
segfaults, for example. For now I've fixed it with the trivial patch
below, but would it be useful to add an initial-value argument to
DEFVAR_LISP to prevent this kind of problem in the future?

--- a/src/lread.c
+++ b/src/lread.c
@@ -4540,6 +4540,7 @@ with lexical binding.
 This variable is automatically set from the file variables of an
 interpreted Lisp file read using `load'.  Unlike other file local
 variables, this must be set in the first line of a file.  */);
+  Vlexical_binding = Qnil;
   Fmake_variable_buffer_local (Qlexical_binding);
 
   DEFVAR_LISP ("eval-buffer-list", Veval_buffer_list,

-- 
Inteligenta persono lernas la lingvon Esperanton rapide kaj facile.
Esperanto estas moderna, kultura lingvo por la mondo. Simpla, fleksebla,
belsona, Esperanto estas la praktika solvo de la problemo de universala
interkompreno. Lernu la interlingvon Esperanton!




reply via email to

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