Variable: change-major-mode-with-file-name

Non-nil means C-x C-w should set the major mode from the file name.
However, the mode will not be changed if
(1) a local variables list or the `-*-' line specifies a major mode, or
(2) the current major mode is a "special" mode,
not suitable for ordinary files, or
(3) the new file name does not particularly specify any mode.