unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Vlexical_binding is sometimes NULL
@ 2012-07-24  0:56 BT Templeton
  2012-08-11 15:34 ` Stefan Monnier
  2012-08-15  4:11 ` Stefan Monnier
  0 siblings, 2 replies; 3+ messages in thread
From: BT Templeton @ 2012-07-24  0:56 UTC (permalink / raw)
  To: emacs-devel

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!




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Vlexical_binding is sometimes NULL
  2012-07-24  0:56 Vlexical_binding is sometimes NULL BT Templeton
@ 2012-08-11 15:34 ` Stefan Monnier
  2012-08-15  4:11 ` Stefan Monnier
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2012-08-11 15:34 UTC (permalink / raw)
  To: BT Templeton; +Cc: emacs-devel

> 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

Installed, thank you,


        Stefan



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Vlexical_binding is sometimes NULL
  2012-07-24  0:56 Vlexical_binding is sometimes NULL BT Templeton
  2012-08-11 15:34 ` Stefan Monnier
@ 2012-08-15  4:11 ` Stefan Monnier
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2012-08-15  4:11 UTC (permalink / raw)
  To: BT Templeton; +Cc: emacs-devel

> 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

Fixed, thanks,


        Stefan "I think I sent this already, but can't find it"



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-08-15  4:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-24  0:56 Vlexical_binding is sometimes NULL BT Templeton
2012-08-11 15:34 ` Stefan Monnier
2012-08-15  4:11 ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).