On
https://www.gnu.org/software/emacs/manual/html_node/emacs/Choosing-Modes.html, the manual says: "If the element has the form
(regexp mode-function flag)
and
flag is non-
nil
, then after calling
mode-function (if it is non-
nil
), Emacs discards the
suffix that matched
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
.gpg
extension use this feature."
My understanding of this paragraph is that the outside mode-function should be called, and then subsequent mode-functions should be called after. Currently, only the inner-most matched suffix has its mode-function called.
It looks like the (when mode (set-auto-mode-0 ...)) was moved from inside the (while name ...) to outside when the section was pulled into its own function. It's been four and a half years, so maybe it doesn't matter anymore, but if that's the case the manual should be updated; it would have saved me a couple hours of difficulty.
nat