* lisp/files.el (set-visited-file-name):
If the major-mode changed, reload the local variables.
Fixes: debbugs:9796
+2011-10-27 Glenn Morris <rgm@gnu.org>
+
+ * files.el (set-visited-file-name): If the major-mode changed,
+ reload the local variables. (Bug#9796)
+
2011-10-27 Chong Yidong <cyd@gnu.org>
* subr.el (change-major-mode-after-body-hook): New hook.
(get major-mode 'mode-class)
;; Don't change the mode if the local variable list specifies it.
(hack-local-variables t)
- (set-auto-mode t))
+ ;; TODO consider making normal-mode handle this case.
+ (let ((old major-mode))
+ (set-auto-mode t)
+ (or (eq old major-mode)
+ (hack-local-variables))))
(error nil)))
(defun write-file (filename &optional confirm)