summaryrefslogtreecommitdiff
path: root/doc/emacs
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2023-01-18 16:01:12 +0200
committerEli Zaretskii <eliz@gnu.org>2023-01-18 16:01:12 +0200
commitbd5ef3ef95e989fa7c2c4e9f24851d7e165abbdf (patch)
tree60bab2ef8ac83c6c0a3d89e6bd844e5ca58df85c /doc/emacs
parent1798ff5a6636d6b34d23ab2dadb966e94cc57467 (diff)
downloademacs-bd5ef3ef95e989fa7c2c4e9f24851d7e165abbdf.tar.gz
emacs-bd5ef3ef95e989fa7c2c4e9f24851d7e165abbdf.tar.bz2
emacs-bd5ef3ef95e989fa7c2c4e9f24851d7e165abbdf.zip
Improve the documentation of 'auto-mode-alist' search
* doc/emacs/modes.texi (Choosing Modes): Expand the description of "recursive extension stripping" using 'auto-mode-alist'. (Bug#60930)
Diffstat (limited to 'doc/emacs')
-rw-r--r--doc/emacs/modes.texi13
1 files changed, 9 insertions, 4 deletions
diff --git a/doc/emacs/modes.texi b/doc/emacs/modes.texi
index d0eacce0842..06f9929092c 100644
--- a/doc/emacs/modes.texi
+++ b/doc/emacs/modes.texi
@@ -430,10 +430,15 @@ For example, one element normally found in the list has the form
mode for files whose names end in @file{.c}. (Note that @samp{\\} is
needed in Lisp syntax to include a @samp{\} in the string, which must
be used to suppress the special meaning of @samp{.} in regexps.) If
-the element has the form @code{(@var{regexp} @var{mode-function}
-@var{flag})} and @var{flag} is non-@code{nil}, then after calling
-@var{mode-function}, Emacs discards the suffix that matched
-@var{regexp} and searches the list again for another match.
+the element has the form @w{@code{(@var{regexp} @var{mode-function}
+@var{flag})}} and @var{flag} is non-@code{nil}, then after calling
+@var{mode-function} (if it is non-@code{nil}), Emacs discards the
+suffix that matched @var{regexp} and searches the list again for
+another match. This ``recursive extension stripping'' is used for
+files which have multiple extensions, and the ``outer'' extension
+hides the ``inner'' one that actually specifies the right mode. For
+example, backup files and GPG-encrypted files with @file{.gpg}
+extension use this feature.
@vindex auto-mode-case-fold
On GNU/Linux and other systems with case-sensitive file names, Emacs