mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
(set-auto-mode): When just-from-file-name is set, don't
actually switch modes if the new mode is the same as the current one.
This commit is contained in:
parent
7f9fcc0f57
commit
3b9ffb776b
1 changed files with 7 additions and 1 deletions
|
|
@ -1391,7 +1391,13 @@ and we don't even do that unless it would come from the file name."
|
|||
keep-going nil)))
|
||||
(setq alist (cdr alist))))
|
||||
(if mode
|
||||
(funcall mode)
|
||||
;; When JUST-FROM-FILE-NAME is set,
|
||||
;; we are working on behalf of set-visited-file-name.
|
||||
;; In that case, if the major mode specified is the
|
||||
;; same one we already have, don't actually reset it.
|
||||
;; We don't want to lose minor modes such as Font Lock.
|
||||
(unless (and just-from-file-name (eq mode major-mode))
|
||||
(funcall mode))
|
||||
;; If we can't deduce a mode from the file name,
|
||||
;; look for an interpreter specified in the first line.
|
||||
;; As a special case, allow for things like "#!/bin/env perl",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue