Add example for enabling minor modes in .dir-local.el

* doc/emacs/custom.texi (Directory Variables): Add an example that
shows how a minor mode can be enabled in a .dir-local.el (Bug#27639).
Clarify that indent-tabs-mode is not a minor mode.
This commit is contained in:
Kaushal Modi 2019-06-25 00:42:20 +02:00 committed by Lars Ingebrigtsen
parent 6e27086941
commit f70cdd4caa

View file

@ -1361,7 +1361,8 @@ files in that subdirectory.
@example
((nil . ((indent-tabs-mode . t)
(fill-column . 80)))
(fill-column . 80)
(mode . auto-fill)))
(c-mode . ((c-file-style . "BSD")
(subdirs . nil)))
("src/imported"
@ -1370,13 +1371,16 @@ files in that subdirectory.
@end example
@noindent
This sets @samp{indent-tabs-mode} and @code{fill-column} for any file
in the directory tree, and the indentation style for any C source
file. The special @code{subdirs} element is not a variable, but a
special keyword which indicates that the C mode settings are only to
be applied in the current directory, not in any subdirectories.
Finally, it specifies a different @file{ChangeLog} file name for any
file in the @file{src/imported} subdirectory.
This sets the variables @samp{indent-tabs-mode} and @code{fill-column}
for any file in the directory tree, and the indentation style for any
C source file. The special @code{mode} element specifies the minor
mode to be enabled. So @code{(mode . auto-fill)} specifies that the
minor mode @code{auto-fill-mode} needs to be enabled. The special
@code{subdirs} element is not a variable, but a special keyword which
indicates that the C mode settings are only to be applied in the
current directory, not in any subdirectories. Finally, it specifies a
different @file{ChangeLog} file name for any file in the
@file{src/imported} subdirectory.
If the @file{.dir-locals.el} file contains multiple different values
for a variable using different mode names or directories, the values