Variable: lexical-binding

lexical-binding is a buffer-local variable defined in lread.c.

Documentation

Whether to use lexical binding when evaluating code.

Non-nil means that the code in the current buffer should be evaluated 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.

Probably introduced at or before Emacs version 24.1.

Source Code

// Defined in /usr/src/emacs/src/lread.c
  DEFVAR_LISP ("lexical-binding", Vlexical_binding,
	       doc: /* Whether to use lexical binding when evaluating code.
Non-nil means that the code in the current buffer should be evaluated
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.  */);