Skip to content

Commit

Permalink
Do not call major-mode when already enabled (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
10sr authored Sep 25, 2018
1 parent 01a0640 commit 03b9008
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions editorconfig.el
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 03b9008

Please sign in to comment.