From: Mike Kupfer Date: Tue, 26 Nov 2024 00:52:05 +0000 (-0800) Subject: Mention special variables in lexical binding documentation X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d250ddb87f6f6e0312192aa34674179ed29c5e71;p=emacs.git Mention special variables in lexical binding documentation * doc/lispref/variables.texi (Lexical Binding): Briefly mention special variables and their semantics. (Bug#74540) (cherry picked from commit 3f99cdaf26dc606012384a6f191dc9d96483d437) --- diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index af11e498d86..0e9124920d1 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -1096,7 +1096,7 @@ x ; @r{Note that @code{x} has no global value.} @end example @noindent -The @code{let} binding defines a lexical environment in which the +Here, the @code{let} binding defines a lexical environment in which the variable @code{x} is locally bound to 0. Within this binding construct, we define a lambda expression which increments @code{x} by one and returns the incremented value. This lambda expression is @@ -1113,6 +1113,12 @@ functions which take a symbol argument (like @code{symbol-value}, variable's dynamic binding (i.e., the contents of its symbol's value cell). + Note also that variables may be declared special, in which case they +will use dynamic binding, even for new bindings such as a @code{let} +binding. Depending on how the variable is declared, it can be +special globally, for a single file, or for a portion of a file. +@xref{Dynamic Binding} for details. + @node Dynamic Binding @subsection Dynamic Binding