From 92f8ce562cead3c6d187466a1b185b0b12c1f04f Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 6 Feb 2020 15:31:40 -0500 Subject: [PATCH] Fix dir-locals targeting fundamental-mode while evil-mode is active #2493 Due to hack upstream, in evil --- modules/editor/evil/config.el | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/editor/evil/config.el b/modules/editor/evil/config.el index 2ee9f58c7..111b40e05 100644 --- a/modules/editor/evil/config.el +++ b/modules/editor/evil/config.el @@ -156,6 +156,14 @@ directives. By default, this only recognizes C directives.") (advice-add #'evil-open-above :around #'+evil--insert-newline-above-and-respect-comments-a) (advice-add #'evil-open-below :around #'+evil--insert-newline-below-and-respect-comments-a) + ;; REVIEW Fix #2493: dir-locals cannot target fundamental-mode when evil-mode + ;; is active. See https://github.com/hlissner/doom-emacs/issues/2493. + ;; Revert this if this is ever fixed upstream. + (defadvice! fix-local-vars (&rest _) + :before #'turn-on-evil-mode + (when (eq major-mode 'fundamental-mode) + (hack-local-variables))) + ;; Recenter screen after most searches (dolist (fn '(evil-visualstar/begin-search-forward evil-visualstar/begin-search-backward