diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2022-04-19 16:22:37 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2022-04-19 16:22:37 +0200 |
commit | 35592141cc8951c91a4bd6cc02f73d1ddd35aca4 (patch) | |
tree | f25d59e2c894cb9f4ccb763ea99166e6d9a606e5 /test | |
parent | 71005decb4fb447635d7b2367104dd18bdfa64ac (diff) | |
download | emacs-35592141cc8951c91a4bd6cc02f73d1ddd35aca4.tar.gz |
Allow several mode: elements in the local variable section
* etc/NEWS (mode): Fall back on outline-mode in older Emacsen.
* 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.
Diffstat (limited to 'test')
-rw-r--r-- | test/lisp/files-resources/file-mode-multiple | 5 | ||||
-rw-r--r-- | test/lisp/files-tests.el | 4 |
2 files changed, 9 insertions, 0 deletions
diff --git a/test/lisp/files-resources/file-mode-multiple b/test/lisp/files-resources/file-mode-multiple new file mode 100644 index 00000000000..ac051ccbcbd --- /dev/null +++ b/test/lisp/files-resources/file-mode-multiple @@ -0,0 +1,5 @@ +Local variables: +mode: text +mode: test-mode-undef +mode: outline +end: diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el index f76d047f302..c886bd79851 100644 --- a/test/lisp/files-tests.el +++ b/test/lisp/files-tests.el @@ -1821,5 +1821,9 @@ Prompt users for any modified buffer with `buffer-offer-save' non-nil." ;; Check that the mode cookie doesn't override the explicit setting. (should (eq major-mode 'emacs-lisp-mode))) +(ert-deftest files-test-set-mode-multiple () + (find-file (ert-resource-file "file-mode-multiple")) + (should (eq major-mode 'outline-mode))) + (provide 'files-tests) ;;; files-tests.el ends here |