mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-06-14 12:31:25 +00:00
Fix major-mode setting regression when there's a mode: cookie
* lisp/files.el (hack-local-variables): Fix regression in setting the major mode when there are mode: cookies in the file (bug#54993).
This commit is contained in:
parent
736fd8b258
commit
713a199705
3 changed files with 11 additions and 1 deletions
|
|
@ -3899,7 +3899,7 @@ inhibited."
|
|||
(with-demoted-errors "Directory-local variables error: %s"
|
||||
;; Note this is a no-op if enable-local-variables is nil.
|
||||
(hack-dir-local-variables))
|
||||
(let ((result (append (hack-local-variables--find-variables)
|
||||
(let ((result (append (hack-local-variables--find-variables handle-mode)
|
||||
(hack-local-variables-prop-line))))
|
||||
(if (and enable-local-variables
|
||||
(not (inhibit-local-variables-p)))
|
||||
|
|
|
|||
3
test/lisp/files-resources/file-mode
Normal file
3
test/lisp/files-resources/file-mode
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
Local variables:
|
||||
mode: text
|
||||
end:
|
||||
|
|
@ -1814,5 +1814,12 @@ Prompt users for any modified buffer with `buffer-offer-save' non-nil."
|
|||
(should (equal (file-name-split "/foo/bar/") '("" "foo" "bar" "")))
|
||||
(should (equal (file-name-split "foo/bar/") '("foo" "bar" ""))))
|
||||
|
||||
(ert-deftest files-test-set-mode ()
|
||||
(find-file (ert-resource-file "file-mode"))
|
||||
(should (eq major-mode 'text-mode))
|
||||
(emacs-lisp-mode)
|
||||
;; Check that the mode cookie doesn't override the explicit setting.
|
||||
(should (eq major-mode 'emacs-lisp-mode)))
|
||||
|
||||
(provide 'files-tests)
|
||||
;;; files-tests.el ends here
|
||||
|
|
|
|||
Loading…
Reference in a new issue