Subject: bug#9796: 24.0.90; Major mode selection after "save as"

From: Stefan Monnier <[email-masked]>
Date: Fri, 21 Oct 2011 08:52:15 -0400

>>> set-auto-mode is being used here though, not normal-mode.
>> So I guess we shouldn't use set-auto-mode here.
> normal-mode first switches to fundamental-mode, then changes to the
> right mode, then turns font-lock off and on. Is that necessary here?
> Also it does not have a "keep-mode-if-same" argument.
> It seems simpler to me for set-visited-file-name just to
> hack-local-variables.

For 24.1, yes.  But in general we'd want to restructure the code a bit
to make it harder to avoid running hack-local-variables-hook (or maybe
provide a new hook to replace it, which is guaranteed to run after
changing a major-mode).

        Stefan