From 03eab9c28bb42b145299cb95b33126cc374a66bc Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 27 Jan 2025 15:19:06 +0200 Subject: [PATCH] ; Improve documentation of '.dir-locals.el' * doc/lispref/variables.texi (Directory Local Variables): * doc/emacs/custom.texi (Directory Variables): Document that '.dir-locals-2.el' must be in the same directory as '.dir-locals.el'. (Bug#75890) (cherry picked from commit 5d021a711a9885100e4ab9d5bb286505a2a16827) --- doc/emacs/custom.texi | 9 +++++---- doc/lispref/variables.texi | 5 +++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi index 36aef8c84f6..3b1f2c69d0e 100644 --- a/doc/emacs/custom.texi +++ b/doc/emacs/custom.texi @@ -1420,10 +1420,11 @@ this search is skipped for remote files. If needed, the search can be extended for remote files by setting the variable @code{enable-remote-dir-locals} to @code{t}. - You can also use @file{.dir-locals-2.el}; if found, Emacs loads it -in addition to @file{.dir-locals.el}. This is useful when -@file{.dir-locals.el} is under version control in a shared repository -and can't be used for personal customizations. + You can also use @file{.dir-locals-2.el}; if found in the same +directory as @file{.dir-locals.el}, Emacs loads it in addition to +@file{.dir-locals.el}. This is useful when @file{.dir-locals.el} is +under version control in a shared repository and can't be used for +personal customizations. The @file{.dir-locals.el} file should hold a specially-constructed list, which maps major mode names (symbols) to alists diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index a2bb1834477..f44ba777072 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -2212,8 +2212,9 @@ If some of the subdirectories have their own @file{.dir-locals.el} files, Emacs uses the settings from the deepest file it finds starting from the file's directory and moving up the directory tree. This constant is also used to derive the name of a second dir-locals file -@file{.dir-locals-2.el}. If this second dir-locals file is present, -then that is loaded in addition to @file{.dir-locals.el}. This is useful +@file{.dir-locals-2.el}. If this second dir-locals file is present in +the same directory as @file{.dir-locals.el}, then it will be loaded in +addition to @file{.dir-locals.el}. This is useful when @file{.dir-locals.el} is under version control in a shared repository and cannot be used for personal customizations. The file specifies local variables as a specially formatted list; see -- 2.39.5