emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r106204: Make set-visited-file-name r


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r106204: Make set-visited-file-name reload local variables if needed.
Date: Wed, 26 Oct 2011 23:38:32 -0700
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 106204
fixes bug(s): http://debbugs.gnu.org/9796
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Wed 2011-10-26 23:38:32 -0700
message:
  Make set-visited-file-name reload local variables if needed.
  
  * lisp/files.el (set-visited-file-name):
  If the major-mode changed, reload the local variables.
modified:
  lisp/ChangeLog
  lisp/files.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-10-27 03:01:40 +0000
+++ b/lisp/ChangeLog    2011-10-27 06:38:32 +0000
@@ -1,3 +1,8 @@
+2011-10-27  Glenn Morris  <address@hidden>
+
+       * files.el (set-visited-file-name): If the major-mode changed,
+       reload the local variables.  (Bug#9796)
+
 2011-10-27  Chong Yidong  <address@hidden>
 
        * subr.el (change-major-mode-after-body-hook): New hook.

=== modified file 'lisp/files.el'
--- a/lisp/files.el     2011-10-23 03:38:23 +0000
+++ b/lisp/files.el     2011-10-27 06:38:32 +0000
@@ -3682,7 +3682,11 @@
          (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)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]