From 22f29ad44e949773021e2c79b77e6508541c8533 Mon Sep 17 00:00:00 2001 From: 10sr <8.slashes@gmail.com> Date: Tue, 25 Sep 2018 14:16:07 +0900 Subject: [PATCH] Do not call major-mode when already enabled --- editorconfig.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/editorconfig.el b/editorconfig.el index 954850e3..258d91d9 100644 --- a/editorconfig.el +++ b/editorconfig.el @@ -464,8 +464,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