aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuc Teirlinck2005-05-15 17:33:59 +0000
committerLuc Teirlinck2005-05-15 17:33:59 +0000
commit0b2892c66e677ebe818d2c60ec28cee9ebd143de (patch)
tree230dd1342ef860359d6944758562b09aa416efd2
parentceea381865b488578e413659fa17398550e4382a (diff)
downloademacs-0b2892c66e677ebe818d2c60ec28cee9ebd143de.tar.gz
emacs-0b2892c66e677ebe818d2c60ec28cee9ebd143de.zip
Reorder nodes.
(Variables): Update menu.
-rw-r--r--lispref/variables.texi174
1 files changed, 87 insertions, 87 deletions
diff --git a/lispref/variables.texi b/lispref/variables.texi
index 6040a4c09ae..27f0f4a7029 100644
--- a/lispref/variables.texi
+++ b/lispref/variables.texi
@@ -42,8 +42,8 @@ variable.
42* Buffer-Local Variables:: Variable values in effect only in one buffer. 42* Buffer-Local Variables:: Variable values in effect only in one buffer.
43* Frame-Local Variables:: Variable values in effect only in one frame. 43* Frame-Local Variables:: Variable values in effect only in one frame.
44* Future Local Variables:: New kinds of local values we might add some day. 44* Future Local Variables:: New kinds of local values we might add some day.
45* Variable Aliases:: Variables that are aliases for other variables.
46* File Local Variables:: Handling local variable lists in files. 45* File Local Variables:: Handling local variable lists in files.
46* Variable Aliases:: Variables that are aliases for other variables.
47* Variables with Restricted Values:: Non-constant variables whose value can 47* Variables with Restricted Values:: Non-constant variables whose value can
48 @emph{not} be an arbitrary Lisp object. 48 @emph{not} be an arbitrary Lisp object.
49@end menu 49@end menu
@@ -1688,6 +1688,92 @@ bindings offer a way to handle these situations more robustly.
1688 If sufficient application is found for either of these two kinds of 1688 If sufficient application is found for either of these two kinds of
1689local bindings, we will provide it in a subsequent Emacs version. 1689local bindings, we will provide it in a subsequent Emacs version.
1690 1690
1691@node File Local Variables
1692@section File Local Variables
1693
1694 This section describes the functions and variables that affect
1695processing of file local variables. @xref{File variables, ,
1696Local Variables in Files, emacs, The GNU Emacs Manual}, for basic
1697information about file local variables.
1698
1699@defopt enable-local-variables
1700This variable controls whether to process file local variables. A
1701value of @code{t} means process them unconditionally; @code{nil} means
1702ignore them; anything else means ask the user what to do for each
1703file. The default value is @code{t}.
1704@end defopt
1705
1706@defun hack-local-variables &optional mode-only
1707This function parses, and binds or evaluates as appropriate, any local
1708variables specified by the contents of the current buffer. The variable
1709@code{enable-local-variables} has its effect here. However, this
1710function does not look for the @samp{mode:} local variable in the
1711@w{@samp{-*-}} line. @code{set-auto-mode} does that, also taking
1712@code{enable-local-variables} into account (@pxref{Auto Major Mode}).
1713
1714If the optional argument @var{mode-only} is non-@code{nil}, then all
1715this function does is return @code{t} if the @w{@samp{-*-}} line or
1716the local variables list specifies a mode and @code{nil} otherwise.
1717It does not set the mode nor any other file local variable.
1718@end defun
1719
1720 If a file local variable could specify a function that would
1721be called later, or an expression that would be executed later, simply
1722visiting a file could take over your Emacs. To prevent this, Emacs
1723takes care not to allow to set such file local variables.
1724
1725 For one thing, any variable whose name ends in @samp{-command},
1726@samp{-frame-alist}, @samp{-function}, @samp{-functions},
1727@samp{-hook}, @samp{-hooks}, @samp{-form}, @samp{-forms}, @samp{-map},
1728@samp{-map-alist}, @samp{-mode-alist}, @samp{-program}, or
1729@samp{-predicate} cannot be given a file local value. In general,
1730you should use such a name whenever it is appropriate for the
1731variable's meaning. The variables @samp{font-lock-keywords},
1732@samp{font-lock-keywords-[0-9]}, and
1733@samp{font-lock-syntactic-keywords} cannot be given file local values either.
1734These rules can be overridden by giving the variable's
1735name a non-@code{nil} @code{safe-local-variable} property. If one
1736gives it a @code{safe-local-variable} property of @code{t}, then one
1737can give the variable any file local value. One can also give any
1738symbol, including the above, a @code{safe-local-variable} property
1739that is a function taking exactly one argument. In that case, giving
1740a variable with that name a file local value is only allowed if the
1741function returns non-@code{nil} when called with that value as
1742argument.
1743
1744 In addition, any variable whose name has a non-@code{nil}
1745@code{risky-local-variable} property is also ignored. So are all
1746variables listed in @code{ignored-local-variables}:
1747
1748@defvar ignored-local-variables
1749This variable holds a list of variables that should not be given local
1750values by files. Any value specified for one of these variables is
1751ignored.
1752@end defvar
1753
1754@defun risky-local-variable-p sym &optional val
1755If @var{val} is non-@code{nil}, returns non-@code{nil} if giving
1756@var{sym} a file local value of @var{val} would be risky, for any of
1757the reasons stated above. If @var{val} is @code{nil} or omitted, only
1758returns @code{nil} if @var{sym} can be safely assigned any file local
1759value whatsoever.
1760@end defun
1761
1762 The @samp{Eval:} ``variable'' is also a potential loophole, so Emacs
1763normally asks for confirmation before handling it.
1764
1765@defopt enable-local-eval
1766This variable controls processing of @samp{Eval:} in @samp{-*-} lines
1767or local variables
1768lists in files being visited. A value of @code{t} means process them
1769unconditionally; @code{nil} means ignore them; anything else means ask
1770the user what to do for each file. The default value is @code{maybe}.
1771@end defopt
1772
1773 Text properties are also potential loopholes, since their values
1774could include functions to call. So Emacs discards all text
1775properties from string values specified for file local variables.
1776
1691@node Variable Aliases 1777@node Variable Aliases
1692@section Variable Aliases 1778@section Variable Aliases
1693 1779
@@ -1780,92 +1866,6 @@ foo
1780 @result{} 0 1866 @result{} 0
1781@end example 1867@end example
1782 1868
1783@node File Local Variables
1784@section File Local Variables
1785
1786 This section describes the functions and variables that affect
1787processing of file local variables. @xref{File variables, ,
1788Local Variables in Files, emacs, The GNU Emacs Manual}, for basic
1789information about file local variables.
1790
1791@defopt enable-local-variables
1792This variable controls whether to process file local variables. A
1793value of @code{t} means process them unconditionally; @code{nil} means
1794ignore them; anything else means ask the user what to do for each
1795file. The default value is @code{t}.
1796@end defopt
1797
1798@defun hack-local-variables &optional mode-only
1799This function parses, and binds or evaluates as appropriate, any local
1800variables specified by the contents of the current buffer. The variable
1801@code{enable-local-variables} has its effect here. However, this
1802function does not look for the @samp{mode:} local variable in the
1803@w{@samp{-*-}} line. @code{set-auto-mode} does that, also taking
1804@code{enable-local-variables} into account (@pxref{Auto Major Mode}).
1805
1806If the optional argument @var{mode-only} is non-@code{nil}, then all
1807this function does is return @code{t} if the @w{@samp{-*-}} line or
1808the local variables list specifies a mode and @code{nil} otherwise.
1809It does not set the mode nor any other file local variable.
1810@end defun
1811
1812 If a file local variable could specify a function that would
1813be called later, or an expression that would be executed later, simply
1814visiting a file could take over your Emacs. To prevent this, Emacs
1815takes care not to allow to set such file local variables.
1816
1817 For one thing, any variable whose name ends in @samp{-command},
1818@samp{-frame-alist}, @samp{-function}, @samp{-functions},
1819@samp{-hook}, @samp{-hooks}, @samp{-form}, @samp{-forms}, @samp{-map},
1820@samp{-map-alist}, @samp{-mode-alist}, @samp{-program}, or
1821@samp{-predicate} cannot be given a file local value. In general,
1822you should use such a name whenever it is appropriate for the
1823variable's meaning. The variables @samp{font-lock-keywords},
1824@samp{font-lock-keywords-[0-9]}, and
1825@samp{font-lock-syntactic-keywords} cannot be given file local values either.
1826These rules can be overridden by giving the variable's
1827name a non-@code{nil} @code{safe-local-variable} property. If one
1828gives it a @code{safe-local-variable} property of @code{t}, then one
1829can give the variable any file local value. One can also give any
1830symbol, including the above, a @code{safe-local-variable} property
1831that is a function taking exactly one argument. In that case, giving
1832a variable with that name a file local value is only allowed if the
1833function returns non-@code{nil} when called with that value as
1834argument.
1835
1836 In addition, any variable whose name has a non-@code{nil}
1837@code{risky-local-variable} property is also ignored. So are all
1838variables listed in @code{ignored-local-variables}:
1839
1840@defvar ignored-local-variables
1841This variable holds a list of variables that should not be given local
1842values by files. Any value specified for one of these variables is
1843ignored.
1844@end defvar
1845
1846@defun risky-local-variable-p sym &optional val
1847If @var{val} is non-@code{nil}, returns non-@code{nil} if giving
1848@var{sym} a file local value of @var{val} would be risky, for any of
1849the reasons stated above. If @var{val} is @code{nil} or omitted, only
1850returns @code{nil} if @var{sym} can be safely assigned any file local
1851value whatsoever.
1852@end defun
1853
1854 The @samp{Eval:} ``variable'' is also a potential loophole, so Emacs
1855normally asks for confirmation before handling it.
1856
1857@defopt enable-local-eval
1858This variable controls processing of @samp{Eval:} in @samp{-*-} lines
1859or local variables
1860lists in files being visited. A value of @code{t} means process them
1861unconditionally; @code{nil} means ignore them; anything else means ask
1862the user what to do for each file. The default value is @code{maybe}.
1863@end defopt
1864
1865 Text properties are also potential loopholes, since their values
1866could include functions to call. So Emacs discards all text
1867properties from string values specified for file local variables.
1868
1869@node Variables with Restricted Values 1869@node Variables with Restricted Values
1870@section Variables with Restricted Values 1870@section Variables with Restricted Values
1871 1871