diff options
| author | Stefan Monnier <monnier@iro.umontreal.ca> | 2013-04-13 22:55:21 -0400 |
|---|---|---|
| committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2013-04-13 22:55:21 -0400 |
| commit | 91e8293cc55d1de50796300412084e8774c60e7f (patch) | |
| tree | 3767b8b3abadb37b68a83edae466a46818441379 | |
| parent | 830aed4d5e06af8644db9514f1dd4f59e1026499 (diff) | |
| download | emacs-91e8293cc55d1de50796300412084e8774c60e7f.tar.gz | |
* lisp/files.el (normal-mode): Only use default major-mode if no other mode
was specified.
Fixes: debbugs:14089
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/files.el | 9 |
2 files changed, 8 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3d92d79fd0a..b0997a307f5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2013-04-14 Stefan Monnier <monnier@iro.umontreal.ca> + * files.el (normal-mode): Only use default major-mode if no other mode + was specified. + * emacs-lisp/trace.el (trace-values): New function. * files.el: Allow : in local variables (bug#14089). diff --git a/lisp/files.el b/lisp/files.el index 6be3685c875..ce032534f04 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -1986,8 +1986,7 @@ Do you want to revisit the file normally now? ") (set-buffer-multibyte nil) (setq buffer-file-coding-system 'no-conversion) (set-buffer-major-mode buf) - (make-local-variable 'find-file-literally) - (setq find-file-literally t)) + (setq-local find-file-literally t)) (after-find-file error (not nowarn))) (current-buffer)))) @@ -2175,7 +2174,7 @@ not set local variables (though we do notice a mode specified with -*-.) or from Lisp without specifying the optional argument FIND-FILE; in that case, this function acts as if `enable-local-variables' were t." (interactive) - (funcall (or (default-value 'major-mode) 'fundamental-mode)) + (fundamental-mode) (let ((enable-local-variables (or (not find-file) enable-local-variables))) ;; FIXME this is less efficient than it could be, since both ;; s-a-m and h-l-v may parse the same regions, looking for "mode:". @@ -2759,7 +2758,9 @@ we don't actually set it to the same mode the buffer already has." (if (functionp re) (funcall re) (looking-at re))))))) - (set-auto-mode-0 done keep-mode-if-same))))) + (set-auto-mode-0 done keep-mode-if-same))) + (unless done + (set-buffer-major-mode (current-buffer))))) ;; When `keep-mode-if-same' is set, we are working on behalf of ;; set-visited-file-name. In that case, if the major mode specified is the |
