diff options
| author | Richard M. Stallman | 2006-02-14 20:58:33 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2006-02-14 20:58:33 +0000 |
| commit | 1324d26ee232ca437e4ded795131fb769029a539 (patch) | |
| tree | 477296c1f0a53dc5ab768e7607184da168470e72 /lispref | |
| parent | e1ec62a59692221b5979d5238272c1fbec31ed06 (diff) | |
| download | emacs-1324d26ee232ca437e4ded795131fb769029a539.tar.gz emacs-1324d26ee232ca437e4ded795131fb769029a539.zip | |
(File Local Variables): Clarifications.
Diffstat (limited to 'lispref')
| -rw-r--r-- | lispref/ChangeLog | 4 | ||||
| -rw-r--r-- | lispref/variables.texi | 43 |
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 @@ | |||
| 1 | 2006-02-14 Richard M. Stallman <rms@gnu.org> | ||
| 2 | |||
| 3 | * variables.texi (File Local Variables): Clarifications. | ||
| 4 | |||
| 1 | 2006-02-14 Juanma Barranquero <lekktu@gmail.com> | 5 | 2006-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 | |||
| 1777 | measures to prevent this. | 1777 | measures 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 |
| 1781 | guaranteed, it asks the user whether or not to obey the file variable | 1781 | @code{safe-local-variable} property. If the property is @code{t}, |
| 1782 | specifications. If the user says no, Emacs ignores @emph{all} the | 1782 | setting that variable in a file is always considered safe, regardless |
| 1783 | file variables specified in that file. A variable can be marked as | 1783 | of the value assigned to it. The @code{safe-local-variable} property |
| 1784 | @dfn{safe} by setting its @code{safe-local-variable} property. If the | 1784 | can also be a function of one argument. In that case, Emacs considers |
| 1785 | property is @code{t}, that variable is always considered safe, | 1785 | it safe to give the variable a certain value if the function returns |
| 1786 | regardless of the value assigned to it. The | 1786 | non-@code{nil} when given that value as argument. Many |
| 1787 | @code{safe-local-variable} property can also be a function taking | 1787 | commonly-encountered file variables standardly have |
| 1788 | exactly one argument. In that case, Emacs considers it safe to give | 1788 | @code{safe-local-variable} properties, including @code{fill-column}, |
| 1789 | the variable a certain value if the function returns non-@code{nil} | 1789 | @code{fill-prefix}, and @code{indent-tabs-mode}. |
| 1790 | when called with that value as argument. Many commonly-encountered | ||
| 1791 | file variables possess @code{safe-local-variable} by default, | ||
| 1792 | including @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 |
| 1796 | This variable provides another way to mark variables as safe. It is a | 1792 | This variable provides another way to mark some variable values as |
| 1797 | list of cons cells @code{(var . val)}, where @var{var} is a variable | 1793 | safe. It is a list of cons cells @code{(@var{var} . @var{val})}, |
| 1798 | name and @var{val} is a value of that variable that is safe. | 1794 | where @var{var} is a variable name and @var{val} is a value which is |
| 1795 | safe for that variable. | ||
| 1799 | 1796 | ||
| 1800 | When Emacs asks the user whether or not to obey a set of file variable | 1797 | When Emacs asks the user whether or not to obey a set of file variable |
| 1801 | specifications, the user can choose to mark them as safe. This adds | 1798 | specifications, the user can choose to mark them as safe. Doing so |
| 1802 | those variable-value pairs to @code{safe-local-variable-values}, and | 1799 | adds those variable-value pairs to @code{safe-local-variable-values}, |
| 1803 | saves it to the user's custom file. | 1800 | and 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 |
| 1812 | Some variables are considered @dfn{risky}. A variable whose name ends | 1809 | Some variables are considered @dfn{risky}. A variable whose name |
| 1813 | in any of @samp{-command}, @samp{-frame-alist}, @samp{-function}, | 1810 | ends 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, | |||
| 1825 | based on the above criteria. | 1822 | based on the above criteria. |
| 1826 | @end defun | 1823 | @end defun |
| 1827 | 1824 | ||
| 1828 | If 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, |
| 1830 | Emacs will always query before setting a risky variable, unless the | 1827 | Emacs will always query before setting a risky variable, unless the |
| 1831 | user explicitly allows it by editing @code{safe-local-variable-values} | 1828 | user explicitly allows it by editing @code{safe-local-variable-values} |