; 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)
This commit is contained in:
Eli Zaretskii 2025-01-27 15:19:06 +02:00
parent 84595cbcc7
commit 5d021a711a
2 changed files with 8 additions and 6 deletions

View file

@ -1421,10 +1421,11 @@ this search is skipped for remote files. If needed, the search can be
extended for remote files by setting the variable extended for remote files by setting the variable
@code{enable-remote-dir-locals} to @code{t}. @code{enable-remote-dir-locals} to @code{t}.
You can also use @file{.dir-locals-2.el}; if found, Emacs loads it You can also use @file{.dir-locals-2.el}; if found in the same
in addition to @file{.dir-locals.el}. This is useful when directory as @file{.dir-locals.el}, Emacs loads it in addition to
@file{.dir-locals.el} is under version control in a shared repository @file{.dir-locals.el}. This is useful when @file{.dir-locals.el} is
and can't be used for personal customizations. 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 The @file{.dir-locals.el} file should hold a specially-constructed
list, which maps major mode names (symbols) to alists list, which maps major mode names (symbols) to alists

View file

@ -2205,8 +2205,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 files, Emacs uses the settings from the deepest file it finds starting
from the file's directory and moving up the directory tree. This 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 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, @file{.dir-locals-2.el}. If this second dir-locals file is present in
then that is loaded in addition to @file{.dir-locals.el}. This is useful 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 when @file{.dir-locals.el} is under version control in a shared
repository and cannot be used for personal customizations. The file repository and cannot be used for personal customizations. The file
specifies local variables as a specially formatted list; see specifies local variables as a specially formatted list; see