]> git.eshelyaron.com Git - emacs.git/commit
Add auto-mode-alist functionality to .dir-locals.el
authorTom Tromey <tom@tromey.com>
Fri, 23 Jul 2021 13:51:11 +0000 (15:51 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Fri, 23 Jul 2021 13:51:11 +0000 (15:51 +0200)
commitad5faa424a5d2f0d67265906d21f7af98220df26
tree87d76eb9e3ead110b7057ecdcfdc79ae85fcdc3e
parent6a3b89f9df85d0718e55d460164ff65e7bdd823e
Add auto-mode-alist functionality to .dir-locals.el

* doc/emacs/custom.texi (Directory Variables): Document
auto-mode-alist in .dir-locals.el (Bug#18721)
* doc/emacs/modes.texi (Choosing Modes): Update.
* lisp/files.el (set-auto-mode--apply-alist): New function,
from set-auto-mode.
(set-auto-mode): Check directory locals for auto-mode-alist.
(dir-locals-collect-variables): Add "predicate" parameter.
(hack-dir-local--get-variables): New function, from
hack-dir-local-variables.
(hack-dir-local-variables): Call hack-dir-local--get-variables.
* test/lisp/files-resources/.dir-locals.el: New file.
* test/lisp/files-resources/whatever.quux: New file.
* test/lisp/files-tests.el (files-tests-data-dir): New variable.
(files-test-dir-locals-auto-mode-alist): New test.
doc/emacs/custom.texi
doc/emacs/modes.texi
etc/NEWS
lisp/files.el
test/lisp/files-resources/.dir-locals.el [new file with mode: 0644]
test/lisp/files-resources/whatever.quux [new file with mode: 0644]
test/lisp/files-tests.el