]> code.delx.au - gnu-emacs/blobdiff - doc/lispref/variables.texi
Merge from trunk.
[gnu-emacs] / doc / lispref / variables.texi
index 7e2c32334a4d043a0e8c7da8483480fd2beaed42..5bc9c1157e2dda091a592433116293b0a1015d56 100644 (file)
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990-1995, 1998-2011  Free Software Foundation, Inc.
+@c Copyright (C) 1990-1995, 1998-2012  Free Software Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @setfilename ../../info/variables
 @node Variables, Functions, Control Structures, Top
@@ -39,7 +39,6 @@ representing the variable.
 * Buffer-Local Variables::      Variable values in effect only in one buffer.
 * File Local Variables::        Handling local variable lists in files.
 * Directory Local Variables::   Local variables common to all files in a directory.
-* Frame-Local Variables::       Frame-local bindings for variables.
 * Variable Aliases::            Variables that are aliases for other variables.
 * Variables with Restricted Values::  Non-constant variables whose value can
                                         @emph{not} be an arbitrary Lisp object.
@@ -99,7 +98,7 @@ x
 
 @node Constant Variables
 @section Variables that Never Change
-@kindex setting-constant
+@cindex @code{setting-constant} error
 @cindex keyword symbol
 @cindex variable with constant value
 @cindex constant variables
@@ -288,7 +287,7 @@ has room to execute.
 
 @node Void Variables
 @section When a Variable is ``Void''
-@kindex void-variable
+@cindex @code{void-variable} error
 @cindex void variable
 
   If you have never given a symbol any value as a global variable, we
@@ -583,7 +582,8 @@ and is a string, and its first character is @samp{*}, then the variable
 is a user option.  Aliases of user options are also user options.
 @end defun
 
-@kindex variable-interactive
+@cindex @code{variable-interactive} property
+@findex set-variable
   If a user option variable has a @code{variable-interactive} property,
 the @code{set-variable} command uses that value to control reading the
 new value for the variable.  The property's value is used as if it were
@@ -1099,11 +1099,12 @@ use short names like @code{x}.
 @node Lexical Binding
 @subsection Use of Lexical Scoping
 
-Emacs Lisp can be evaluated in two different modes: in dynamic binding mode or
-lexical binding mode.  In dynamic binding mode, all local variables use dynamic
-scoping, whereas in lexical binding mode variables that have been declared
-@dfn{special} (i.e., declared with @code{defvar} or @code{defconst}) use
-dynamic scoping and all others use lexical scoping.
+Emacs Lisp can be evaluated in two different modes: in dynamic binding
+mode or lexical binding mode.  In dynamic binding mode, all local
+variables use dynamic scoping, whereas in lexical binding mode
+variables that have been declared @dfn{special} (i.e., declared with
+@code{defvar}, @code{defcustom} or @code{defconst}) use dynamic
+scoping and all others use lexical scoping.
 
 @defvar lexical-binding
 When non-nil, evaluation of Lisp code uses lexical scoping for non-special
@@ -1186,8 +1187,7 @@ additional, unusual kinds of variable binding, such as
 @dfn{buffer-local} bindings, which apply only in one buffer.  Having
 different values for a variable in different buffers is an important
 customization method.  (Variables can also have bindings that are
-local to each terminal, or to each frame.  @xref{Multiple Terminals},
-and @xref{Frame-Local Variables}.)
+local to each terminal.  @xref{Multiple Terminals}.)
 
 @menu
 * Intro to Buffer-Local::       Introduction and concepts.
@@ -1286,9 +1286,8 @@ buffer-local binding of buffer @samp{b}.
 values when you visit the file.  @xref{File Variables,,, emacs, The
 GNU Emacs Manual}.
 
-  A buffer-local variable cannot be made frame-local
-(@pxref{Frame-Local Variables}) or terminal-local (@pxref{Multiple
-Terminals}).
+  A buffer-local variable cannot be made terminal-local
+(@pxref{Multiple Terminals}).
 
 @node Creating Buffer-Local
 @subsection Creating and Deleting Buffer-Local Bindings
@@ -1339,9 +1338,9 @@ is not current either on entry to or exit from the @code{let}.  This is
 because @code{let} does not distinguish between different kinds of
 bindings; it knows only which variable the binding was made for.
 
-If the variable is terminal-local (@pxref{Multiple Terminals}), or
-frame-local (@pxref{Frame-Local Variables}), this function signals an
-error.  Such variables cannot have buffer-local bindings as well.
+If the variable is terminal-local (@pxref{Multiple Terminals}), this
+function signals an error.  Such variables cannot have buffer-local
+bindings as well.
 
 @strong{Warning:} do not use @code{make-local-variable} for a hook
 variable.  The hook variables are automatically made buffer-local as
@@ -1670,12 +1669,16 @@ This function works by walking the alist stored in
 @code{file-local-variables-alist} and applying each local variable in
 turn.  It calls @code{before-hack-local-variables-hook} and
 @code{hack-local-variables-hook} before and after applying the
-variables, respectively.
+variables, respectively.  It only calls the before-hook if the alist
+is non-@code{nil}; it always calls the other hook.  This
+function ignores a @samp{mode} element if it specifies the same major
+mode as the buffer already has.
 
 If the optional argument @var{mode-only} is non-@code{nil}, then all
-this function does is return @code{t} if the @w{@samp{-*-}} line or
-the local variables list specifies a mode and @code{nil} otherwise.
-It does not set the mode nor any other file-local variable.
+this function does is return a symbol specifying the major mode,
+if the @w{@samp{-*-}} line or the local variables list specifies one,
+and @code{nil} otherwise.  It does not set the mode nor any other
+file-local variable.
 @end defun
 
 @defvar file-local-variables-alist
@@ -1826,6 +1829,15 @@ function works by calling @code{dir-locals-set-class-variables} and
 @code{dir-locals-set-directory-class}, described below.
 @end defun
 
+@defun hack-dir-local-variables-non-file-buffer
+This function looks for directory-local variables, and immediately
+applies them in the current buffer.  It is intended to be called in
+the mode commands for non-file buffers, such as Dired buffers, to let
+them obey directory-local variable settings.  For non-file buffers,
+Emacs looks for directory-local variables in @code{default-directory}
+and its parent directories.
+@end defun
+
 @defun dir-locals-set-class-variables class variables
 This function defines a set of variable settings for the named
 @var{class}, which is a symbol.  You can later assign the class to one
@@ -1875,36 +1887,6 @@ modification times of the associated directory local variables file
 updates this list.
 @end defvar
 
-@node Frame-Local Variables
-@section Frame-Local Values for Variables
-@cindex frame-local variables
-
-  In addition to buffer-local variable bindings (@pxref{Buffer-Local
-Variables}), Emacs supports @dfn{frame-local} bindings.  A frame-local
-binding for a variable is in effect in a frame for which it was
-defined.
-
-  In practice, frame-local variables have not proven very useful.
-Ordinary frame parameters are generally used instead (@pxref{Frame
-Parameters}).  The function @code{make-variable-frame-local}, which
-was used to define frame-local variables, has been deprecated since
-Emacs 22.2.  However, you can still define a frame-specific binding
-for a variable @var{var} in frame @var{frame}, by setting the
-@var{var} frame parameter for that frame:
-
-@lisp
-  (modify-frame-parameters @var{frame} '((@var{var} . @var{value})))
-@end lisp
-
-@noindent
-This causes the variable @var{var} to be bound to the specified
-@var{value} in the named @var{frame}.  To check the frame-specific
-values of such variables, use @code{frame-parameter}.  @xref{Parameter
-Access}.
-
-  Note that you cannot have a frame-local binding for a variable that
-has a buffer-local binding.
-
 @node Variable Aliases
 @section Variable Aliases
 @cindex variable aliases
@@ -2025,6 +2007,6 @@ This variable holds a list of all variables of type @code{DEFVAR_BOOL}.
 Attempting to assign them any other value will result in an error:
 
 @example
-(setq window-min-height 5.0)
-@error{} Wrong type argument: integerp, 5.0
+(setq undo-limit 1000.0)
+@error{} Wrong type argument: integerp, 1000.0
 @end example