summaryrefslogtreecommitdiff
path: root/doc/emacs/modes.texi
diff options
context:
space:
mode:
Diffstat (limited to 'doc/emacs/modes.texi')
-rw-r--r--doc/emacs/modes.texi10
1 files changed, 7 insertions, 3 deletions
diff --git a/doc/emacs/modes.texi b/doc/emacs/modes.texi
index cc25d3e1e33..9014221edff 100644
--- a/doc/emacs/modes.texi
+++ b/doc/emacs/modes.texi
@@ -357,8 +357,12 @@ preferences. If you personally want to use a minor mode for a
particular file type, it is better to enable the minor mode via a
major mode hook (@pxref{Major Modes}).
+ Second, Emacs checks whether the file's extension matches an entry
+in any directory-local @code{auto-mode-alist}. These are found using
+the @file{.dir-locals.el} facility (@pxref{Directory Variables}).
+
@vindex interpreter-mode-alist
- Second, if there is no file variable specifying a major mode, Emacs
+ Third, if there is no file variable specifying a major mode, Emacs
checks whether the file's contents begin with @samp{#!}. If so, that
indicates that the file can serve as an executable shell command,
which works by running an interpreter named on the file's first line
@@ -376,7 +380,7 @@ same is true for man pages which start with the magic string
@samp{'\"} to specify a list of troff preprocessors.
@vindex magic-mode-alist
- Third, Emacs tries to determine the major mode by looking at the
+ Fourth, Emacs tries to determine the major mode by looking at the
text at the start of the buffer, based on the variable
@code{magic-mode-alist}. By default, this variable is @code{nil} (an
empty list), so Emacs skips this step; however, you can customize it
@@ -404,7 +408,7 @@ where @var{match-function} is a Lisp function that is called at the
beginning of the buffer; if the function returns non-@code{nil}, Emacs
set the major mode with @var{mode-function}.
- Fourth---if Emacs still hasn't found a suitable major mode---it
+ Fifth---if Emacs still hasn't found a suitable major mode---it
looks at the file's name. The correspondence between file names and
major modes is controlled by the variable @code{auto-mode-alist}. Its
value is a list in which each element has this form,