Fix regression with multiple mode: entries in the prop line

* lisp/files.el (hack-local-variables--find-variables): Use the
final mode: line (which is the same as having several mode: bits
in the header line.
This commit is contained in:
Lars Ingebrigtsen 2022-04-19 18:06:31 +02:00
parent 35592141cc
commit e45abc832d
3 changed files with 6 additions and 1 deletions

View file

@ -3900,7 +3900,7 @@ inhibited."
;; Note this is a no-op if enable-local-variables is nil.
(hack-dir-local-variables))
(let ((result (append (hack-local-variables--find-variables handle-mode)
(hack-local-variables-prop-line))))
(hack-local-variables-prop-line handle-mode))))
(if (and enable-local-variables
(not (inhibit-local-variables-p)))
(progn

View file

@ -0,0 +1 @@
-*- mode: notexist; mode: text -*-

View file

@ -1825,5 +1825,9 @@ Prompt users for any modified buffer with `buffer-offer-save' non-nil."
(find-file (ert-resource-file "file-mode-multiple"))
(should (eq major-mode 'outline-mode)))
(ert-deftest files-test-set-mode-prop-line ()
(find-file (ert-resource-file "file-mode-prop-line"))
(should (eq major-mode 'text-mode)))
(provide 'files-tests)
;;; files-tests.el ends here