summaryrefslogtreecommitdiff
path: root/doc/emacs/custom.texi
diff options
context:
space:
mode:
Diffstat (limited to 'doc/emacs/custom.texi')
-rw-r--r--doc/emacs/custom.texi32
1 files changed, 31 insertions, 1 deletions
diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi
index 4bd78f3ce83..4725af0ee5f 100644
--- a/doc/emacs/custom.texi
+++ b/doc/emacs/custom.texi
@@ -1329,6 +1329,15 @@ pairs in the file, by typing @kbd{i} at the confirmation prompt --
these pairs will thereafter be ignored in this file and in all other
files.
+ When Emacs asks for confirmation for setting directory-local
+variables (@pxref{Directory Variables}), typing @kbd{+} at the
+confirmation prompt will set all the variables, and also add the
+directory to the list in @code{safe-local-variable-directories}
+(described below), which will cause Emacs to consider this directory
+as safe for loading any directory-local variables in the future. The
+@kbd{+} response should only be used for directories whose contents
+you trust.
+
@vindex safe-local-variable-values
@vindex ignored-local-variable-values
@cindex risky variable
@@ -1345,6 +1354,16 @@ record safe values for risky variables, do it directly by customizing
Similarly, if you want to record values of risky variables that should
be permanently ignored, customize @code{ignored-local-variable-values}.
+@vindex safe-local-variable-directories
+ Sometimes it is helpful to always trust directory-variables in
+certain directories, and skip the confirmation prompt when local
+variables are loaded from those directories, even if the variables are
+risky. The variable @code{safe-local-variable-directories} holds the
+list of such directories. The names of the directories in this list
+must be full absolute file names. If the variable
+@code{enable-remote-dir-locals} has a non-@code{nil} value, the list
+can include remote directories as well (@pxref{Remote Files}).
+
@vindex enable-local-variables
The variable @code{enable-local-variables} allows you to change the
way Emacs processes local variables. Its default value is @code{t},
@@ -1489,7 +1508,18 @@ mode or subdirectory, and for variable and value, and adds the
entry defining the directory-local variable. @kbd{M-x
delete-dir-local-variable} deletes an entry. @kbd{M-x
copy-file-locals-to-dir-locals} copies the file-local variables in the
-current file into @file{.dir-locals.el}.
+current file into @file{.dir-locals.el}, or @file{.dir-locals-2.el} if
+that file is also present.
+
+With a prefix argument, all three commands prompt for the file you
+want to modify. Although it doesn't have to exist, you must enter a
+valid filename, either @file{.dir-locals.el} or
+@file{.dir-locals-2.el}.
+
+@findex customize-dirlocals
+There's also a command to pop up an Easy Customization buffer
+(@pxref{Easy Customization}) to edit directory local variables,
+@code{customize-dirlocals}.
@findex dir-locals-set-class-variables
@findex dir-locals-set-directory-class