Previous: , Up: File Modes   [Index]


10.3.2 New Major Mode

The commands ‘C-x C-w’ (write-file) and set-visited-file-name change to a new major mode if the new file name implies a mode (see Saving). (‘C-x C-s’ (save-buffer) does this too, if the buffer wasn’t visiting a file.)

However, this does not happen if the buffer contents specify a major mode, and certain special major modes do not allow the mode to change. You can turn off this mode-changing feature by setting change-major-mode-with-file-name to nil.