aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2006-02-15 04:33:46 +0000
committerRichard M. Stallman2006-02-15 04:33:46 +0000
commit2b2ea6dbc5a2d5da046f9e294ce5b2b489e3fd29 (patch)
tree51693cad54a8d61cd6ec87f1c207375c22aa7aa9
parent9ca66103163cfe43b813f6d4fc6a430a0ceab0bb (diff)
downloademacs-2b2ea6dbc5a2d5da046f9e294ce5b2b489e3fd29.tar.gz
emacs-2b2ea6dbc5a2d5da046f9e294ce5b2b489e3fd29.zip
(Safe File Variables): Lots of clarification.
Renamed from Unsafe File Variables.
-rw-r--r--man/ChangeLog5
-rw-r--r--man/custom.texi89
2 files changed, 49 insertions, 45 deletions
diff --git a/man/ChangeLog b/man/ChangeLog
index 141115ec00e..a4fa515512a 100644
--- a/man/ChangeLog
+++ b/man/ChangeLog
@@ -1,3 +1,8 @@
12006-02-14 Richard M. Stallman <rms@gnu.org>
2
3 * custom.texi (Safe File Variables): Lots of clarification.
4 Renamed from Unsafe File Variables.
5
12006-02-14 Chong Yidong <cyd@stupidchicken.com> 62006-02-14 Chong Yidong <cyd@stupidchicken.com>
2 7
3 * custom.texi (Unsafe File Variables): File variable confirmation 8 * custom.texi (Unsafe File Variables): File variable confirmation
diff --git a/man/custom.texi b/man/custom.texi
index 8c414e6393c..db88f64f839 100644
--- a/man/custom.texi
+++ b/man/custom.texi
@@ -1045,14 +1045,13 @@ buffer, and sets them to the values specified in the file.
1045 1045
1046@menu 1046@menu
1047* Specifying File Variables:: Specifying file local variables. 1047* Specifying File Variables:: Specifying file local variables.
1048* Unsafe File Variables:: Handling local variables that may not 1048* Safe File Variables:: Making sure file local variables are safe.
1049 be safe.
1050@end menu 1049@end menu
1051 1050
1052@node Specifying File Variables 1051@node Specifying File Variables
1053@subsubsection Specifying File Variables 1052@subsubsection Specifying File Variables
1054 1053
1055 There are two ways to specify local variable values: in the first 1054 There are two ways to specify file local variable values: in the first
1056line, or with a local variables list. Here's how to specify them in the 1055line, or with a local variables list. Here's how to specify them in the
1057first line: 1056first line:
1058 1057
@@ -1098,7 +1097,7 @@ variables list and a @samp{-*-} line, Emacs processes @emph{everything}
1098in the @samp{-*-} line first, and @emph{everything} in the local 1097in the @samp{-*-} line first, and @emph{everything} in the local
1099variables list afterward. 1098variables list afterward.
1100 1099
1101Here is an example of a local variables list: 1100 Here is an example of a local variables list:
1102 1101
1103@example 1102@example
1104;;; Local Variables: *** 1103;;; Local Variables: ***
@@ -1179,52 +1178,52 @@ list need not take the time to search the whole file.
1179major mode of a buffer according to the file name and contents, 1178major mode of a buffer according to the file name and contents,
1180including the local variables list if any. @xref{Choosing Modes}. 1179including the local variables list if any. @xref{Choosing Modes}.
1181 1180
1182@node Unsafe File Variables 1181@node Safe File Variables
1183@subsubsection Unsafe File Variables 1182@subsubsection Safety of File Variables
1184 1183
1185 File variables create a certain amount of risk; when you visit 1184 File-local variables can be dangerous; when you visit someone else's
1186someone else's file, its variables could affect your Emacs in 1185file, there's no telling what its local variables list could do to
1187arbitrary ways. A special risk is posed by the @code{eval} 1186your Emacs. Improper values of the @code{eval} ``variable,'' and
1188``variable,'' which can potentially execute arbitrary code, and 1187other variables such as @code{load-path}, could execute Lisp code you
1189certain actual variables such as @code{load-path}. 1188didn't intend to run.
1190 1189
1191 Therefore, whenever Emacs encounters file variables that are not 1190 Therefore, whenever Emacs encounters file local variable values that
1192known to be safe, it displays the entire list of variables defined in 1191are not known to be safe, it displays the file's entire local
1193that file, and asks you for confirmation before setting them. You can 1192variables list, and asks you for confirmation before setting them.
1194type @samp{y} or @samp{SPC} to apply the local variables list, or 1193You can type @kbd{y} or @key{SPC} to put the local variables list into
1195@samp{n} to ignore it. 1194effect, or @kbd{n} to ignore it. When Emacs is run in batch mode
1196 1195(@pxref{Initial Options}), it can't really ask you, so it assumes the
1197 When Emacs is run in batch mode (@pxref{Initial Options}), it 1196answer @samp{n}.
1198assumes that the answer is @samp{n}. 1197
1199 1198 Emacs normally recognizes certain variables/value pairs as safe.
1200 There is a set of file variables and values that are known to be 1199For instance, it is safe to give @code{comment-column} or
1201safe. For instance, it is safe to give @code{comment-column} or
1202@code{fill-column} any integer value. If a file specifies only safe 1200@code{fill-column} any integer value. If a file specifies only safe
1203variable-value pairs, Emacs will not ask for confirmation before 1201variable/value pairs, Emacs does not ask for confirmation before
1204setting them. You can also tell Emacs that a set of variable-value 1202setting them. Otherwise, you can tell Emacs to record that all the
1205pairs is safe, by entering @samp{!} at the file variables confirmation 1203variable/value pairs in the file are safe, by typing @kbd{!} at the
1206prompt. In that case, Emacs will not ask for confirmation if it 1204confirmation prompt. When Emacs encounters these variable/value pairs
1207encounters these variable-value pairs in the future. You can directly 1205subsequently, in the same file or others, it will assume they are
1208edit the list of safe variable-value pairs by customizing 1206safe.
1207
1208@vindex safe-local-variable-values
1209@cindex risky variable
1210 Some variables, such as @code{load-path}, are considered
1211particularly @dfn{risky}: there is seldom any reason to specify them
1212as local variables, and changing them can be dangerous. Even if you
1213enter @kbd{!} at the confirmation prompt, Emacs will not record any
1214values as safe for these variables. If you really want to record safe
1215values for these variables, do it directly by customizing
1209@samp{safe-local-variable-values} (@pxref{Easy Customization}). 1216@samp{safe-local-variable-values} (@pxref{Easy Customization}).
1210 1217
1211 Some variables, such as @code{load-path}, are considered 1218@vindex enable-local-variables
1212@dfn{risky}: there is seldom any reason to specify them as file
1213variables, and changing them can be dangerous. Even if you enter
1214@samp{!} at the confirmation prompt, Emacs will not save these values
1215for the future. Therefore, you will be prompted each time the
1216variable is encountered. If you really want to allow such a variable,
1217you can avoid the prompt by editing @samp{safe-local-variable-values}.
1218
1219@findex enable-local-variables
1220 The variable @code{enable-local-variables} allows you to change the 1219 The variable @code{enable-local-variables} allows you to change the
1221way Emacs processes local variables. Its default value is @code{t}, 1220way Emacs processes local variables. Its default value is @code{t},
1222which means the behavior described above. If you set the value to 1221which specifies the behavior described above. If it is @code{nil},
1223@code{nil}, Emacs simply ignores local variables in files. Any other 1222Emacs simply ignores all file local variables. Any other value says
1224value says to query you about each file that has local variables, even 1223to query you about each file that has local variables, without trying
1225if the variables are known to be safe. 1224to determine whether the values are known to be safe.
1226 1225
1227@findex enable-local-eval 1226@vindex enable-local-eval
1228 The variable @code{enable-local-eval} controls whether Emacs 1227 The variable @code{enable-local-eval} controls whether Emacs
1229processes @code{eval} variables. The three possibilities for the 1228processes @code{eval} variables. The three possibilities for the
1230variable's value are @code{t}, @code{nil}, and anything else, just as 1229variable's value are @code{t}, @code{nil}, and anything else, just as
@@ -1232,7 +1231,7 @@ for @code{enable-local-variables}. The default is @code{maybe}, which
1232is neither @code{t} nor @code{nil}, so normally Emacs does ask for 1231is neither @code{t} nor @code{nil}, so normally Emacs does ask for
1233confirmation about processes @code{eval} variables. 1232confirmation about processes @code{eval} variables.
1234 1233
1235@findex safe-local-eval-forms 1234@vindex safe-local-eval-forms
1236 The @code{safe-local-eval-forms} is a customizable list of eval 1235 The @code{safe-local-eval-forms} is a customizable list of eval
1237forms which are safe to eval, so Emacs should not ask for 1236forms which are safe to eval, so Emacs should not ask for
1238confirmation to evaluate these forms. 1237confirmation to evaluate these forms.