diff options
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/files.el | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lisp/files.el b/lisp/files.el index ea718410bd3..60a45aac4b5 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -1391,7 +1391,13 @@ and we don't even do that unless it would come from the file name." | |||
| 1391 | keep-going nil))) | 1391 | keep-going nil))) |
| 1392 | (setq alist (cdr alist)))) | 1392 | (setq alist (cdr alist)))) |
| 1393 | (if mode | 1393 | (if mode |
| 1394 | (funcall mode) | 1394 | ;; When JUST-FROM-FILE-NAME is set, |
| 1395 | ;; we are working on behalf of set-visited-file-name. | ||
| 1396 | ;; In that case, if the major mode specified is the | ||
| 1397 | ;; same one we already have, don't actually reset it. | ||
| 1398 | ;; We don't want to lose minor modes such as Font Lock. | ||
| 1399 | (unless (and just-from-file-name (eq mode major-mode)) | ||
| 1400 | (funcall mode)) | ||
| 1395 | ;; If we can't deduce a mode from the file name, | 1401 | ;; If we can't deduce a mode from the file name, |
| 1396 | ;; look for an interpreter specified in the first line. | 1402 | ;; look for an interpreter specified in the first line. |
| 1397 | ;; As a special case, allow for things like "#!/bin/env perl", | 1403 | ;; As a special case, allow for things like "#!/bin/env perl", |