diff options
| author | Eli Zaretskii | 2023-01-18 16:01:12 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2023-01-18 16:01:12 +0200 |
| commit | bd5ef3ef95e989fa7c2c4e9f24851d7e165abbdf (patch) | |
| tree | 60bab2ef8ac83c6c0a3d89e6bd844e5ca58df85c | |
| parent | 1798ff5a6636d6b34d23ab2dadb966e94cc57467 (diff) | |
| download | emacs-bd5ef3ef95e989fa7c2c4e9f24851d7e165abbdf.tar.gz 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)
| -rw-r--r-- | doc/emacs/modes.texi | 13 |
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 | |||
| 430 | mode for files whose names end in @file{.c}. (Note that @samp{\\} is | 430 | mode for files whose names end in @file{.c}. (Note that @samp{\\} is |
| 431 | needed in Lisp syntax to include a @samp{\} in the string, which must | 431 | needed in Lisp syntax to include a @samp{\} in the string, which must |
| 432 | be used to suppress the special meaning of @samp{.} in regexps.) If | 432 | be used to suppress the special meaning of @samp{.} in regexps.) If |
| 433 | the element has the form @code{(@var{regexp} @var{mode-function} | 433 | the element has the form @w{@code{(@var{regexp} @var{mode-function} |
| 434 | @var{flag})} and @var{flag} is non-@code{nil}, then after calling | 434 | @var{flag})}} and @var{flag} is non-@code{nil}, then after calling |
| 435 | @var{mode-function}, Emacs discards the suffix that matched | 435 | @var{mode-function} (if it is non-@code{nil}), Emacs discards the |
| 436 | @var{regexp} and searches the list again for another match. | 436 | suffix that matched @var{regexp} and searches the list again for |
| 437 | another match. This ``recursive extension stripping'' is used for | ||
| 438 | files which have multiple extensions, and the ``outer'' extension | ||
| 439 | hides the ``inner'' one that actually specifies the right mode. For | ||
| 440 | example, backup files and GPG-encrypted files with @file{.gpg} | ||
| 441 | extension use this feature. | ||
| 437 | 442 | ||
| 438 | @vindex auto-mode-case-fold | 443 | @vindex auto-mode-case-fold |
| 439 | On GNU/Linux and other systems with case-sensitive file names, Emacs | 444 | On GNU/Linux and other systems with case-sensitive file names, Emacs |