branch: scratch/editorconfig-cc commit b3a61f717d768cb0326c59b35fc352901368913a Author: Jay Kamat <jaygka...@gmail.com> Commit: Stefan Monnier <monn...@iro.umontreal.ca>
Change hook editorconfig is applied on (#143) Change from `after-change-major-mode-hook' to `change-major-mode-after-body-hook' to allow dir-local variables to take precedence over editorconfig. Closes #141 --- editorconfig.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/editorconfig.el b/editorconfig.el index c04767cc5c..6ec416fd7e 100644 --- a/editorconfig.el +++ b/editorconfig.el @@ -413,7 +413,9 @@ when first visiting files or changing major modes if the major mode is not listed in `editorconfig-exclude-modes'." :global t :lighter " EditorConfig" - (dolist (hook '(after-change-major-mode-hook)) + ;; See https://github.com/editorconfig/editorconfig-emacs/issues/141 for why + ;; not `after-change-major-mode-hook' + (dolist (hook '(change-major-mode-after-body-hook)) (if editorconfig-mode (add-hook hook 'editorconfig-mode-apply) (remove-hook hook 'editorconfig-mode-apply))))