diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2022-10-03 11:17:51 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2022-10-03 11:17:51 -0400 |
commit | 59f8c56d9e71a1b61ca8cc0794a6de4aa2f240e4 (patch) | |
tree | d23a5838d344d534165eb79231c0cb4f9e9c30cb /doc/emacs/modes.texi | |
parent | 5fec9182dbeffa88cef6651d8c798ef9665d6681 (diff) | |
download | emacs-59f8c56d9e71a1b61ca8cc0794a6de4aa2f240e4.tar.gz |
files.el (major-mode-remap-alist): New custom var (bug#58075)
* lisp/files.el (major-mode-remap-alist): New custom var.
(set-auto-mode--last): New var.
(set-auto-mode-0): Obey `major-mode-remap-alist`.
* doc/emacs/modes.texi (Choosing Modes): Document `major-mode-remap-alist`.
* lisp/progmodes/cperl-mode.el: Recommend the use of
`major-mode-remap-alist` over the crude `defalias` solution.
* lisp/textmodes/tex-mode.el (tex--guess-mode): Simplify.
(tex--redirect-to-submode): Obey `major-mode-remap-alist`.
Diffstat (limited to 'doc/emacs/modes.texi')
-rw-r--r-- | doc/emacs/modes.texi | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/doc/emacs/modes.texi b/doc/emacs/modes.texi index c348130807c..56b779f8de6 100644 --- a/doc/emacs/modes.texi +++ b/doc/emacs/modes.texi @@ -454,6 +454,13 @@ only @emph{after} @code{auto-mode-alist}. By default, files, HTML/XML/SGML files, PostScript files, and Unix style Conf files. +@vindex major-mode-remap-alist + Once a major mode is found, Emacs does a final check to see if the +mode has been remapped by @code{major-mode-remap-alist}, in which case +it uses the remapped mode instead. This is used when several +different major modes can be used for the same file type, so you can +specify which mode you prefer. + @findex normal-mode If you have changed the major mode of a buffer, you can return to the major mode Emacs would have chosen automatically, by typing |