Variable: major-mode-remap-alist

major-mode-remap-alist is a customizable variable defined in files.el.gz.

Value

nil

Documentation

Alist mapping file-specified modes to alternative modes.

Each entry is of the form (MODE . FUNCTION) which means that in place of activating the major mode MODE (specified via something like auto-mode-alist, file-local variables, ...) we actually call FUNCTION instead. FUNCTION is typically a major mode which "does the same thing" as MODE, but can also be nil to hide other entries (either in this var or in major-mode-remap-defaults) and means that we should call MODE.

View in manual

Probably introduced at or before Emacs version 29.1.

Source Code

;; Defined in /usr/src/emacs/lisp/files.el.gz
(defcustom major-mode-remap-alist nil
  "Alist mapping file-specified modes to alternative modes.
Each entry is of the form (MODE . FUNCTION) which means that in place
of activating the major mode MODE (specified via something like
`auto-mode-alist', file-local variables, ...) we actually call FUNCTION
instead.
FUNCTION is typically a major mode which \"does the same thing\" as
MODE, but can also be nil to hide other entries (either in this var or
in `major-mode-remap-defaults') and means that we should call MODE."
  :type '(alist
          :tag "Remappings"
          :key-type (symbol :tag "From major mode")
          :value-type (function :tag "To mode (or function)")))