aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2008-10-13 10:38:43 +0000
committerEli Zaretskii2008-10-13 10:38:43 +0000
commit0f7766a426ac45db65f5bf8b8a05bf66f08ed155 (patch)
tree80fadd0eb65e3959ef11ade7b02cc56695b5f449
parent02105f6bf3e9dcb0e480026a6f0b24b6a8bd6524 (diff)
downloademacs-0f7766a426ac45db65f5bf8b8a05bf66f08ed155.tar.gz
emacs-0f7766a426ac45db65f5bf8b8a05bf66f08ed155.zip
(Frame-Local Variables): New section.
(Buffer-Local Variables): Add an xref to it. (Intro to Buffer-Local, Creating Buffer-Local): A variable cannot have both frame-local and buffer-local binding.
-rw-r--r--doc/lispref/variables.texi43
1 files changed, 39 insertions, 4 deletions
diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi
index 1dd2a57945b..55422b7508d 100644
--- a/doc/lispref/variables.texi
+++ b/doc/lispref/variables.texi
@@ -41,6 +41,7 @@ variable.
41* Buffer-Local Variables:: Variable values in effect only in one buffer. 41* Buffer-Local Variables:: Variable values in effect only in one buffer.
42* Future Local Variables:: New kinds of local values we might add some day. 42* Future Local Variables:: New kinds of local values we might add some day.
43* File Local Variables:: Handling local variable lists in files. 43* File Local Variables:: Handling local variable lists in files.
44* Frame-Local Variables:: Frame-local bindings for variables.
44* Variable Aliases:: Variables that are aliases for other variables. 45* Variable Aliases:: Variables that are aliases for other variables.
45* Variables with Restricted Values:: Non-constant variables whose value can 46* Variables with Restricted Values:: Non-constant variables whose value can
46 @emph{not} be an arbitrary Lisp object. 47 @emph{not} be an arbitrary Lisp object.
@@ -1088,7 +1089,8 @@ additional, unusual kinds of variable binding, such as
1088@dfn{buffer-local} bindings, which apply only in one buffer. Having 1089@dfn{buffer-local} bindings, which apply only in one buffer. Having
1089different values for a variable in different buffers is an important 1090different values for a variable in different buffers is an important
1090customization method. (A few variables have bindings that are local 1091customization method. (A few variables have bindings that are local
1091to each terminal; see @ref{Multiple Displays}.) 1092to each terminal; see @ref{Multiple Displays}. You can also have
1093frame-local bindings for variables; see @ref{Frame-Local Variables}.)
1092 1094
1093@menu 1095@menu
1094* Intro to Buffer-Local:: Introduction and concepts. 1096* Intro to Buffer-Local:: Introduction and concepts.
@@ -1187,6 +1189,10 @@ buffer-local binding of buffer @samp{b}.
1187values when you visit the file. @xref{File Variables,,, emacs, The 1189values when you visit the file. @xref{File Variables,,, emacs, The
1188GNU Emacs Manual}. 1190GNU Emacs Manual}.
1189 1191
1192 A variable cannot be both buffer-local and frame-local
1193(@pxref{Frame-Local Variables}) or terminal-local (@pxref{Multiple
1194Displays}).
1195
1190@node Creating Buffer-Local 1196@node Creating Buffer-Local
1191@subsection Creating and Deleting Buffer-Local Bindings 1197@subsection Creating and Deleting Buffer-Local Bindings
1192 1198
@@ -1238,9 +1244,9 @@ is not current either on entry to or exit from the @code{let}. This is
1238because @code{let} does not distinguish between different kinds of 1244because @code{let} does not distinguish between different kinds of
1239bindings; it knows only which variable the binding was made for. 1245bindings; it knows only which variable the binding was made for.
1240 1246
1241If the variable is terminal-local, this function signals an error. Such 1247If the variable is terminal-local (@pxref{Multiple Displays}), or
1242variables cannot have buffer-local bindings as well. @xref{Multiple 1248frame-local (@pxref{Frame-Local Variables}), this function signals an
1243Displays}. 1249error. Such variables cannot have buffer-local bindings as well.
1244 1250
1245@strong{Warning:} do not use @code{make-local-variable} for a hook 1251@strong{Warning:} do not use @code{make-local-variable} for a hook
1246variable. The hook variables are automatically made buffer-local as 1252variable. The hook variables are automatically made buffer-local as
@@ -1666,6 +1672,35 @@ such predicates (it's safe if any predicate succeeds), or @code{t}
1666could include functions to call. So Emacs discards all text 1672could include functions to call. So Emacs discards all text
1667properties from string values specified for file local variables. 1673properties from string values specified for file local variables.
1668 1674
1675@node Frame-Local Variables
1676@section Frame-Local Values for Variables
1677@cindex frame-local variables
1678
1679 In addition to buffer-local variable bindings (@pxref{Buffer-Local
1680Variables}), Emacs supports @dfn{frame-local} bindings. A frame-local
1681binding for a variable is in effect in a frame for which it was
1682defined. Note that you cannot have frame-local bindings for a
1683variable that has a buffer-local binding.
1684
1685 To define a frame-specific binding for a variable @var{var} in frame
1686@var{frame}, set the @var{var} frame parameter for that frame:
1687
1688@lisp
1689 (modify-frame-parameters @var{frame} '((@var{var} . @var{value})))
1690@end lisp
1691
1692@noindent
1693This causes the variable @var{var} to be bound to the specified
1694@var{value} in the named @var{frame}. @xref{Parameter Access,
1695modify-frame-parameters}.
1696
1697@findex make-variable-frame-local@r{, deprecated}
1698 Use of @code{make-variable-frame-local} for defining frame-local
1699bindings is deprecated since Emacs 22.2.
1700
1701 To check the frame-specific values of such variables, use
1702@code{frame-parameter} (@pxref{Parameter Access, frame-parameter}).
1703
1669@node Variable Aliases 1704@node Variable Aliases
1670@section Variable Aliases 1705@section Variable Aliases
1671@cindex variable aliases 1706@cindex variable aliases