If you have a .dir-locals.el like
((nil . ((agda2-program-name . "some-other-mikan")
then it will be clobbered during initializtaion of agda2-mode. The root of the problem is that agda2-mode is transitively a derived mode of fundamental-mode, which calls kill-all-local-variables as part of mode initialization, and only restores them using hack-local-variables after we've started the mode.
A similar bug impacts users of envrc.el: global minor modes are initialized as a part of after-change-major-mode-hook, which gets called after we've started the mode.
If you have a `.dir-locals.el` like
```emacs-lisp
((nil . ((agda2-program-name . "some-other-mikan")
```
then it will be clobbered during initializtaion of `agda2-mode`. The root of the problem is that `agda2-mode` is transitively a derived mode of `fundamental-mode`, which calls `kill-all-local-variables` as part of mode initialization, and only restores them using `hack-local-variables` *after* we've started the mode.
A similar bug impacts users of `envrc.el`: global minor modes are initialized as a part of `after-change-major-mode-hook`, which gets called after we've started the mode.