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

    Do not call major-mode when already enabled (#178)
---
 editorconfig.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/editorconfig.el b/editorconfig.el
index f30b0ee75f..ec0a78efac 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -349,8 +349,10 @@ This funcion will avoid such cases and set `major-mode' 
safely.
 Just checking current `major-mode' value is not enough, because it can be
 different from MODE value (for example, `conf-mode' will set `major-mode' to
 `conf-unix-mode' or another conf mode)."
-  (unless (eq mode
-              editorconfig--apply-major-mode-currently)
+  (when (and (not (eq mode
+                      editorconfig--apply-major-mode-currently))
+             (not (eq mode
+                      major-mode)))
     (unwind-protect
         (progn
           (setq editorconfig--apply-major-mode-currently

Reply via email to