diff options
| author | Lars Ingebrigtsen | 2022-04-19 16:22:37 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2022-04-19 16:22:37 +0200 |
| commit | 35592141cc8951c91a4bd6cc02f73d1ddd35aca4 (patch) | |
| tree | f25d59e2c894cb9f4ccb763ea99166e6d9a606e5 /test | |
| parent | 71005decb4fb447635d7b2367104dd18bdfa64ac (diff) | |
| download | emacs-35592141cc8951c91a4bd6cc02f73d1ddd35aca4.tar.gz emacs-35592141cc8951c91a4bd6cc02f73d1ddd35aca4.zip | |
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 @@ | |||
| 1 | Local variables: | ||
| 2 | mode: text | ||
| 3 | mode: test-mode-undef | ||
| 4 | mode: outline | ||
| 5 | 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." | |||
| 1821 | ;; Check that the mode cookie doesn't override the explicit setting. | 1821 | ;; Check that the mode cookie doesn't override the explicit setting. |
| 1822 | (should (eq major-mode 'emacs-lisp-mode))) | 1822 | (should (eq major-mode 'emacs-lisp-mode))) |
| 1823 | 1823 | ||
| 1824 | (ert-deftest files-test-set-mode-multiple () | ||
| 1825 | (find-file (ert-resource-file "file-mode-multiple")) | ||
| 1826 | (should (eq major-mode 'outline-mode))) | ||
| 1827 | |||
| 1824 | (provide 'files-tests) | 1828 | (provide 'files-tests) |
| 1825 | ;;; files-tests.el ends here | 1829 | ;;; files-tests.el ends here |