From bd5ef3ef95e989fa7c2c4e9f24851d7e165abbdf Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 18 Jan 2023 16:01:12 +0200 Subject: [PATCH] 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) --- doc/emacs/modes.texi | 13 +++++++++---- 1 file 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 -- 2.39.2