branch: scratch/editorconfig-cc
commit 11625f5c817a484e54304ecb9b91ddb325b4813d
Author: 10sr <8.slas...@gmail.com>
Commit: Stefan Monnier <monn...@iro.umontreal.ca>

    Add explicit support for rpm-spec-mode
---
 editorconfig.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/editorconfig.el b/editorconfig.el
index 0944c2debb..2504abb4df 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -538,7 +538,13 @@ To disable EditorConfig in some buffers, modify
   ;; 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
-                  read-only-mode-hook))
+                  read-only-mode-hook
+                  ;; Some modes call `kill-all-local-variables' in their init
+                  ;; code, which clears some values set by editorconfig.
+                  ;; For those modes, editorconfig-apply need to be called
+                  ;; explicitly through their hooks.
+                  rpm-spec-mode-hook
+                  ))
     (if editorconfig-mode
         (add-hook hook 'editorconfig-mode-apply)
       (remove-hook hook 'editorconfig-mode-apply))))

Reply via email to