aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2013-04-13 22:55:21 -0400
committerStefan Monnier2013-04-13 22:55:21 -0400
commit91e8293cc55d1de50796300412084e8774c60e7f (patch)
tree3767b8b3abadb37b68a83edae466a46818441379
parent830aed4d5e06af8644db9514f1dd4f59e1026499 (diff)
downloademacs-91e8293cc55d1de50796300412084e8774c60e7f.tar.gz
emacs-91e8293cc55d1de50796300412084e8774c60e7f.zip
* lisp/files.el (normal-mode): Only use default major-mode if no other mode
was specified. Fixes: debbugs:14089
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/files.el9
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 @@
12013-04-14 Stefan Monnier <monnier@iro.umontreal.ca> 12013-04-14 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * files.el (normal-mode): Only use default major-mode if no other mode
4 was specified.
5
3 * emacs-lisp/trace.el (trace-values): New function. 6 * emacs-lisp/trace.el (trace-values): New function.
4 7
5 * files.el: Allow : in local variables (bug#14089). 8 * 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? ")
1986 (set-buffer-multibyte nil) 1986 (set-buffer-multibyte nil)
1987 (setq buffer-file-coding-system 'no-conversion) 1987 (setq buffer-file-coding-system 'no-conversion)
1988 (set-buffer-major-mode buf) 1988 (set-buffer-major-mode buf)
1989 (make-local-variable 'find-file-literally) 1989 (setq-local find-file-literally t))
1990 (setq find-file-literally t))
1991 (after-find-file error (not nowarn))) 1990 (after-find-file error (not nowarn)))
1992 (current-buffer)))) 1991 (current-buffer))))
1993 1992
@@ -2175,7 +2174,7 @@ not set local variables (though we do notice a mode specified with -*-.)
2175or from Lisp without specifying the optional argument FIND-FILE; 2174or from Lisp without specifying the optional argument FIND-FILE;
2176in that case, this function acts as if `enable-local-variables' were t." 2175in that case, this function acts as if `enable-local-variables' were t."
2177 (interactive) 2176 (interactive)
2178 (funcall (or (default-value 'major-mode) 'fundamental-mode)) 2177 (fundamental-mode)
2179 (let ((enable-local-variables (or (not find-file) enable-local-variables))) 2178 (let ((enable-local-variables (or (not find-file) enable-local-variables)))
2180 ;; FIXME this is less efficient than it could be, since both 2179 ;; FIXME this is less efficient than it could be, since both
2181 ;; s-a-m and h-l-v may parse the same regions, looking for "mode:". 2180 ;; 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."
2759 (if (functionp re) 2758 (if (functionp re)
2760 (funcall re) 2759 (funcall re)
2761 (looking-at re))))))) 2760 (looking-at re)))))))
2762 (set-auto-mode-0 done keep-mode-if-same))))) 2761 (set-auto-mode-0 done keep-mode-if-same)))
2762 (unless done
2763 (set-buffer-major-mode (current-buffer)))))
2763 2764
2764;; When `keep-mode-if-same' is set, we are working on behalf of 2765;; When `keep-mode-if-same' is set, we are working on behalf of
2765;; set-visited-file-name. In that case, if the major mode specified is the 2766;; set-visited-file-name. In that case, if the major mode specified is the