]> git.eshelyaron.com Git - emacs.git/commit
(dir-locals-collect-variables): Don't autoload if not needed (bug#74349)
authorStefan Monnier <monnier@iro.umontreal.ca>
Sun, 24 Nov 2024 03:05:33 +0000 (22:05 -0500)
committerEshel Yaron <me@eshelyaron.com>
Wed, 27 Nov 2024 19:54:00 +0000 (20:54 +0100)
commita743c2beb30905ac49b4a6af10777c662a9d67a0
tree517c87cff1e8f74639501eed7966f7ec0547fd8c
parent72a535cf7a29eb7e6dd7eda36ff2325d2121bec6
(dir-locals-collect-variables): Don't autoload if not needed (bug#74349)

While dir-local settings for `c-mode` may require (auto)loading `cc-mode.el`
to get all the `safe-local-variable` properties, they may not.  So before
(auto)loading that file, make sure we don't already have all the
`safe-local-variable` properties we need.

* lisp/files.el (dir-locals--load-mode-if-needed): New function.
(hack-one-local-variable): Don't inf-loop if `eval` calls a major mode.
(dir-locals-collect-variables): Use `dir-locals--load-mode-if-needed`.

(cherry picked from commit f713258416f224b93e4f25b2db24d5e8797bcbff)
lisp/files.el