emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] scratch/editorconfig-cc a6ab681950 038/351: Apply settings on m


From: Stefan Monnier
Subject: [nongnu] scratch/editorconfig-cc a6ab681950 038/351: Apply settings on major mode change
Date: Thu, 13 Jun 2024 18:38:39 -0400 (EDT)

branch: scratch/editorconfig-cc
commit a6ab681950f97211f201ca96315fee7f7375adfc
Author: Hong Xu <hong@topbug.net>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    Apply settings on major mode change
---
 editorconfig.el | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/editorconfig.el b/editorconfig.el
index 3b9d408352..64909c0052 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -216,11 +216,12 @@ NOTE: Only the **buffer local** value of VARIABLE will be 
set."
   "Toggle EditorConfig feature."
   :global t
   :lighter ""
-  (if editorconfig-mode
-    (add-hook 'find-file-hook
-      'editorconfig-apply)
-    (remove-hook 'find-file-hook
-      'editorconfig-apply)))
+  (dolist (hook (list
+                  'find-file-hook
+                  'after-change-major-mode-hook))
+    (if editorconfig-mode
+      (add-hook hook 'editorconfig-apply)
+      (remove-hook hook 'editorconfig-apply))))
 
 ;;;###autoload
 (add-to-list 'auto-mode-alist '("/\\.editorconfig\\'" . conf-unix-mode))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]