branch: scratch/editorconfig-cc
commit 82af619ed50b5159a058da472663c68fd41637df
Author: 10sr <[email protected]>
Commit: Stefan Monnier <[email protected]>
Use derived-mode-p for major-mode check (#180)
---
editorconfig.el | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/editorconfig.el b/editorconfig.el
index 17359095c9..08d87aa88b 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -310,14 +310,6 @@ number - `lisp-indent-offset' is not set only if
indent_size is
(> (string-to-number length) 0))
(setq fill-column (string-to-number length))))
-(defun editorconfig--is-a-mode-p (current want)
- "Return non-nil if major mode CURRENT is a major mode WANT."
- (or (eq current
- want)
- (let ((parent (get current 'derived-mode-parent)))
- (and parent
- (editorconfig--is-a-mode-p parent want)))))
-
(defun editorconfig-set-major-mode-from-name (filetype)
"Set buffer `major-mode' by FILETYPE.
@@ -356,8 +348,7 @@ different from MODE value (for example, `conf-mode' will
set `major-mode' to
editorconfig--apply-major-mode-currently))
(not (eq mode
major-mode))
- (not (editorconfig--is-a-mode-p major-mode
- mode)))
+ (not (derived-mode-p mode)))
(unwind-protect
(progn
(setq editorconfig--apply-major-mode-currently