aboutsummaryrefslogtreecommitdiffstats
path: root/lispref
diff options
context:
space:
mode:
authorRichard M. Stallman2006-02-14 20:58:33 +0000
committerRichard M. Stallman2006-02-14 20:58:33 +0000
commit1324d26ee232ca437e4ded795131fb769029a539 (patch)
tree477296c1f0a53dc5ab768e7607184da168470e72 /lispref
parente1ec62a59692221b5979d5238272c1fbec31ed06 (diff)
downloademacs-1324d26ee232ca437e4ded795131fb769029a539.tar.gz
emacs-1324d26ee232ca437e4ded795131fb769029a539.zip
(File Local Variables): Clarifications.
Diffstat (limited to 'lispref')
-rw-r--r--lispref/ChangeLog4
-rw-r--r--lispref/variables.texi43
2 files changed, 24 insertions, 23 deletions
diff --git a/lispref/ChangeLog b/lispref/ChangeLog
index 1d1bf8fcaa6..8b523f288d6 100644
--- a/lispref/ChangeLog
+++ b/lispref/ChangeLog
@@ -1,3 +1,7 @@
12006-02-14 Richard M. Stallman <rms@gnu.org>
2
3 * variables.texi (File Local Variables): Clarifications.
4
12006-02-14 Juanma Barranquero <lekktu@gmail.com> 52006-02-14 Juanma Barranquero <lekktu@gmail.com>
2 6
3 * variables.texi (File Local Variables): Use @code for a cons 7 * variables.texi (File Local Variables): Use @code for a cons
diff --git a/lispref/variables.texi b/lispref/variables.texi
index 2677dd72bdb..c3fe6cf6a23 100644
--- a/lispref/variables.texi
+++ b/lispref/variables.texi
@@ -1777,30 +1777,27 @@ visiting a file could take over your Emacs. Emacs takes several
1777measures to prevent this. 1777measures to prevent this.
1778 1778
1779@cindex safe local variable 1779@cindex safe local variable
1780 When Emacs encounters a file local variable whose safety is not 1780 A variable can be marked as @dfn{safe} by setting its
1781guaranteed, it asks the user whether or not to obey the file variable 1781@code{safe-local-variable} property. If the property is @code{t},
1782specifications. If the user says no, Emacs ignores @emph{all} the 1782setting that variable in a file is always considered safe, regardless
1783file variables specified in that file. A variable can be marked as 1783of the value assigned to it. The @code{safe-local-variable} property
1784@dfn{safe} by setting its @code{safe-local-variable} property. If the 1784can also be a function of one argument. In that case, Emacs considers
1785property is @code{t}, that variable is always considered safe, 1785it safe to give the variable a certain value if the function returns
1786regardless of the value assigned to it. The 1786non-@code{nil} when given that value as argument. Many
1787@code{safe-local-variable} property can also be a function taking 1787commonly-encountered file variables standardly have
1788exactly one argument. In that case, Emacs considers it safe to give 1788@code{safe-local-variable} properties, including @code{fill-column},
1789the variable a certain value if the function returns non-@code{nil} 1789@code{fill-prefix}, and @code{indent-tabs-mode}.
1790when called with that value as argument. Many commonly-encountered
1791file variables possess @code{safe-local-variable} by default,
1792including @code{fill-column}, @code{fill-prefix}, and
1793@code{indent-tabs-mode}.
1794 1790
1795@defopt safe-local-variable-values 1791@defopt safe-local-variable-values
1796This variable provides another way to mark variables as safe. It is a 1792This variable provides another way to mark some variable values as
1797list of cons cells @code{(var . val)}, where @var{var} is a variable 1793safe. It is a list of cons cells @code{(@var{var} . @var{val})},
1798name and @var{val} is a value of that variable that is safe. 1794where @var{var} is a variable name and @var{val} is a value which is
1795safe for that variable.
1799 1796
1800When Emacs asks the user whether or not to obey a set of file variable 1797When Emacs asks the user whether or not to obey a set of file variable
1801specifications, the user can choose to mark them as safe. This adds 1798specifications, the user can choose to mark them as safe. Doing so
1802those variable-value pairs to @code{safe-local-variable-values}, and 1799adds those variable-value pairs to @code{safe-local-variable-values},
1803saves it to the user's custom file. 1800and saves it to the user's custom file.
1804@end defopt 1801@end defopt
1805 1802
1806@defun safe-local-variable-p sym val 1803@defun safe-local-variable-p sym val
@@ -1809,8 +1806,8 @@ the value @var{val}, based on the above criteria.
1809@end defun 1806@end defun
1810 1807
1811@cindex risky local variable 1808@cindex risky local variable
1812Some variables are considered @dfn{risky}. A variable whose name ends 1809 Some variables are considered @dfn{risky}. A variable whose name
1813in any of @samp{-command}, @samp{-frame-alist}, @samp{-function}, 1810ends in any of @samp{-command}, @samp{-frame-alist}, @samp{-function},
1814@samp{-functions}, @samp{-hook}, @samp{-hooks}, @samp{-form}, 1811@samp{-functions}, @samp{-hook}, @samp{-hooks}, @samp{-form},
1815@samp{-forms}, @samp{-map}, @samp{-map-alist}, @samp{-mode-alist}, 1812@samp{-forms}, @samp{-map}, @samp{-map-alist}, @samp{-mode-alist},
1816@samp{-program}, or @samp{-predicate} is considered risky. The 1813@samp{-program}, or @samp{-predicate} is considered risky. The
@@ -1825,7 +1822,7 @@ This function returns non-@code{nil} if @var{sym} is a risky variable,
1825based on the above criteria. 1822based on the above criteria.
1826@end defun 1823@end defun
1827 1824
1828If a variable is risky, it will not be entered automatically into 1825 If a variable is risky, it will not be entered automatically into
1829@code{safe-local-variable-values} as described above. Therefore, 1826@code{safe-local-variable-values} as described above. Therefore,
1830Emacs will always query before setting a risky variable, unless the 1827Emacs will always query before setting a risky variable, unless the
1831user explicitly allows it by editing @code{safe-local-variable-values} 1828user explicitly allows it by editing @code{safe-local-variable-values}